Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hfs sign test #53

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions atomic_physics/tests/test_hfs_sign.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""Test hfs constant sign"""
import unittest
from atomic_physics.ions import ba133, ba137


class TesLevel(unittest.TestCase):
"""
Test hfs constant sign
"""

def test_positive_hfs(self):
level = ba137.ground_level
ion = ba137.Ba137(B=100e-4, level_filter=[level])

# check that states in F=1 have indices 0-2
for i in range(3):
self.assertEqual(ion.index(level, -(i - 1), F=1), i)

# check that states in F=2 have indices 3-7
for i in range(5):
self.assertEqual(ion.index(level, i - 2, F=2), i + 3)

def test_negative_hfs(self):
level = ba133.ground_level
ion = ba133.Ba133(B=100e-4, level_filter=[level])

# check that states in F=1 have indices 0-2
for i in range(3):
self.assertEqual(ion.index(level, i - 1, F=1), i)

# check that F=0, mF=0 has index 3
self.assertEqual(ion.index(level, 0, F=0), 3)
2 changes: 1 addition & 1 deletion atomic_physics/tests/test_level.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Test Spin 1/2 nuclei"""
"""Test level assignment"""
import unittest
from atomic_physics.ions import ca40

Expand Down