示例#1
0
    def setup_method(self, method):

        Rb87_5s12_F1 = hyperfine.LevelF(I=1.5, J=0.5, F=1)
        Rb87_5s12_F2 = hyperfine.LevelF(I=1.5, J=0.5, F=2)
        Rb87_5p12_F1 = hyperfine.LevelF(I=1.5, J=0.5, F=1)
        Rb87_5p12_F2 = hyperfine.LevelF(I=1.5, J=0.5, F=2)

        self.Rb87_5s12_5p12 = hyperfine.Atom1e(element='Rb', isotope='87')
        self.Rb87_5s12_5p12.add_F_level(Rb87_5s12_F1)
        self.Rb87_5s12_5p12.add_F_level(Rb87_5s12_F2)
        self.Rb87_5s12_5p12.add_F_level(Rb87_5p12_F1)
        self.Rb87_5s12_5p12.add_F_level(Rb87_5p12_F2)

        Rb87_5p32_F0 = hyperfine.LevelF(I=1.5, J=1.5, F=0)
        Rb87_5p32_F1 = hyperfine.LevelF(I=1.5, J=1.5, F=1)
        Rb87_5p32_F2 = hyperfine.LevelF(I=1.5, J=1.5, F=2)
        Rb87_5p32_F3 = hyperfine.LevelF(I=1.5, J=1.5, F=3)

        self.Rb87_5s12_5p32 = hyperfine.Atom1e(element='Rb', isotope='87')
        self.Rb87_5s12_5p32.add_F_level(Rb87_5s12_F1)
        self.Rb87_5s12_5p32.add_F_level(Rb87_5s12_F2)
        self.Rb87_5s12_5p32.add_F_level(Rb87_5p32_F0)
        self.Rb87_5s12_5p32.add_F_level(Rb87_5p32_F1)
        self.Rb87_5s12_5p32.add_F_level(Rb87_5p32_F2)
        self.Rb87_5s12_5p32.add_F_level(Rb87_5p32_F3)
示例#2
0
    def test_Rb87_5s12_5p12(self):
        """ TODO: put a levels diagram here. """

        Rb87_5s12_5p12 = hyperfine.Atom1e(element='Rb', isotope='87')
        # Create F levels and add to atom
        Rb87_5s12_F1 = hyperfine.LevelF(I=1.5, J=0.5, F=1)
        Rb87_5s12_F2 = hyperfine.LevelF(I=1.5, J=0.5, F=2)
        Rb87_5p12_F1 = hyperfine.LevelF(I=1.5, J=1.5, F=1)
        Rb87_5p12_F2 = hyperfine.LevelF(I=1.5, J=1.5, F=2)
        Rb87_5s12_5p12.add_F_level(Rb87_5s12_F1)
        Rb87_5s12_5p12.add_F_level(Rb87_5s12_F2)
        Rb87_5s12_5p12.add_F_level(Rb87_5p12_F1)
        Rb87_5s12_5p12.add_F_level(Rb87_5p12_F2)

        self.assertEqual(Rb87_5s12_5p12.get_num_mF_levels(), 16)

        map = [0] * 3 + [1] * 5 + [2] * 3 + [3] * 5
        self.assertEqual(Rb87_5s12_5p12.get_F_level_idx_map(), map)

        self.assertEqual(len(Rb87_5s12_5p12.get_coupled_levels([0], [2])),
                         3 * 3)
        self.assertEqual(len(Rb87_5s12_5p12.get_coupled_levels([0], [3])),
                         3 * 5)

        self.assertEqual(len(Rb87_5s12_5p12.get_coupled_levels([0], [2, 3])),
                         3 * 8)
        self.assertEqual(len(Rb87_5s12_5p12.get_coupled_levels([0, 1], [2])),
                         8 * 3)