scipp / scipp/ess

Add flipper matrices for the antiparallel spin case

Open
#411 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

esspolarization
Dominant language
Python
Stars
1
Forks
3
Avg merge
2d 11h
Merged PRs (30d)
17

Description

Executive summary

Adding another flipper matrix depending on the ttransmitted spin direction through the flipper when it is off

Context and background knowledge

Until now we have considered the case:
When the spin coming into the flipper is parallel to the outer magnetic field (typically called "parallel spin") and is transmitted (not flipped) when the flipper is off, hence afterwards still "parallel".

Now it should be inserted the case:
When the spin coming into the flipper is antiparallel to the outer magnetic field and is transmitted (not flipped) when the flipper is off, hence afterwards still "antiparallel".

These two cases have different spin flipper matrices F1 and F2 as described in Inputs

Inputs

I have saved the new flipper matrices in the inverse_of_polarization_matrices.ipynb in the branch Flipper-matrices-antiparallel.
Flipper matrices parallel case (already inserted):

F1_parallel = sp.ImmutableDenseMatrix([
    [1, 0, 0, 0],
    [0, 1, 0, 0],
    [1-f1, 0, f1, 0],
    [0, 1-f1, 0, f1],
])
F2_parallel = sp.ImmutableDenseMatrix([
    [1, 0, 0, 0],
    [1-f2, f2, 0, 0],
    [0, 0, 1, 0],
    [0, 0, 1-f2, f2],
])

Flipper matrices antiparallel case:

F1_antiparallel = sp.ImmutableDenseMatrix([
    [f1, 0, 1-f1, 0],
    [0, f1, 0, 1-f1],
    [0, 0, 1, 0],
    [0, 0, 0, 1],
])

F2_antiparallel = sp.ImmutableDenseMatrix([
    [1, 1-f2, 0, 0],
    [0, f2, 0, 0],
    [0, 0, 1, 1-f2],
    [0, 0, 0, f2],
    
])
Methodology

Use same methodology

Outputs

Use same correction workflow

Which interfaces are required?

Python script

Test cases

Use same correction_test.py

Comments

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with inverse_of_polarization_matrices.ipynb and the existing parallel flipper-matrix implementation. Review correction_test.py and the Python correction workflow to determine where the antiparallel case belongs. Done means the F1_antiparallel and F2_antiparallel matrices are integrated and the existing correction tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.