Exemple #1
0
    def get_clebsch_hf_factors(self, F_level_idxs_a, F_level_idxs_b, q):
        """ Returns a list of Clebsch-Gordan coefficients for the hyperfine 
            transition dipole matrix elements for each coupled level pair.
        
        Args:
            F_level_idx_a (int): F level the transition is from (lower level)
            F_level_idx_b (int): F level the transition is to (upper level)
            q (int): The field polarisation. Choose from [-1, 0, 1].

        Returns:
            (list): factors, length of mF_list

        """

        # TODO: Selection rules? Either needs to be here or get_coupled_levels

        mF_list = self.get_mF_list()
        coupled_levels = self.get_coupled_levels(F_level_idxs_a,
                                                 F_level_idxs_b)
        factors = np.empty(len(coupled_levels))
        for i, cl in enumerate(coupled_levels):
            a = mF_list[cl[0]]
            b = mF_list[cl[1]]
            factors[i] = calc_clebsch_hf(J_a=a['J'],
                                         I_a=a['I'],
                                         F_a=a['F'],
                                         mF_a=a['mF'],
                                         J_b=b['J'],
                                         I_b=b['I'],
                                         F_b=b['F'],
                                         mF_b=b['mF'],
                                         q=q)
        return factors
Exemple #2
0
        def chf_17(F_b, mF_a): return angmom.calc_clebsch_hf(J_a=J_a, I_a=I_a,
            F_a=2, mF_a=mF_a, J_b=J_b, I_b=I_b, F_b=F_b, mF_b=mF_a - 1, q=1)

        self.assertAlmostEqual(chf_17(F_b=1, mF_a=-2), np.sqrt(0))
Exemple #3
0
    def test_Rb_87_5s12_5p12(self):
        """ Testing Clebsch-Gordan coefficients for the Rb87 D1 line hyperfine
            transitions. These coefficients are from Tables 15-20 in ref [1].

        Notes:
            [1]: Daniel A. Steck, 'Rubidium 87 D Line Data' available online
            at http://steck.us/alkalidata. (revision 2.1.4, 23 Dec 2010).
        """

        J_a = 1/2
        J_b = 1/2
        I_a = 3/2
        I_b = 3/2

        # Table 15
        chf_15 = lambda F_b, mF_a: angmom.calc_clebsch_hf(J_a=J_a, I_a=I_a,
            F_a=2, mF_a=mF_a, J_b=J_b, I_b=I_b, F_b=F_b, mF_b=mF_a + 1, q=-1)

        self.assertAlmostEqual(chf_15(F_b=1, mF_a=-2), np.sqrt(1/2))
        self.assertAlmostEqual(chf_15(F_b=1, mF_a=-1), np.sqrt(1/4))
        self.assertAlmostEqual(chf_15(F_b=1, mF_a=0), np.sqrt(1/12))
        self.assertAlmostEqual(chf_15(F_b=1, mF_a=1), np.sqrt(0))
        self.assertAlmostEqual(chf_15(F_b=1, mF_a=2), np.sqrt(0))

        self.assertAlmostEqual(chf_15(F_b=2, mF_a=-2), np.sqrt(1 / 6))
        self.assertAlmostEqual(chf_15(F_b=2, mF_a=-1), np.sqrt(1 / 4))
        self.assertAlmostEqual(chf_15(F_b=2, mF_a=0), np.sqrt(1 / 4))
        self.assertAlmostEqual(chf_15(F_b=2, mF_a=1), np.sqrt(1/6))
        self.assertAlmostEqual(chf_15(F_b=2, mF_a=2), np.sqrt(0))

        # Table 16
        chf_16 = lambda F_b, mF_a: angmom.calc_clebsch_hf(J_a=J_a, I_a=I_a,
            F_a=2, mF_a=mF_a, J_b=J_b, I_b=I_b, F_b=F_b, mF_b=mF_a, q=0)

        self.assertAlmostEqual(chf_16(F_b=1, mF_a=-2), np.sqrt(0))
        self.assertAlmostEqual(chf_16(F_b=1, mF_a=-1), np.sqrt(1/4))
        self.assertAlmostEqual(chf_16(F_b=1, mF_a=0), np.sqrt(1/3))
        self.assertAlmostEqual(chf_16(F_b=1, mF_a=1), np.sqrt(1/4))
        self.assertAlmostEqual(chf_16(F_b=1, mF_a=2), np.sqrt(0))

        self.assertAlmostEqual(chf_16(F_b=2, mF_a=-2), -np.sqrt(1/3))
        self.assertAlmostEqual(chf_16(F_b=2, mF_a=-1), -np.sqrt(1/12))
        self.assertAlmostEqual(chf_16(F_b=2, mF_a=0), np.sqrt(0))
        self.assertAlmostEqual(chf_16(F_b=2, mF_a=1), np.sqrt(1/12))
        self.assertAlmostEqual(chf_16(F_b=2, mF_a=2), np.sqrt(1/3))

        # Table 17
        def chf_17(F_b, mF_a): return angmom.calc_clebsch_hf(J_a=J_a, I_a=I_a,
            F_a=2, mF_a=mF_a, J_b=J_b, I_b=I_b, F_b=F_b, mF_b=mF_a - 1, q=1)

        self.assertAlmostEqual(chf_17(F_b=1, mF_a=-2), np.sqrt(0))
        self.assertAlmostEqual(chf_17(F_b=1, mF_a=-1), np.sqrt(0))
        self.assertAlmostEqual(chf_17(F_b=1, mF_a=0), np.sqrt(1/12))
        self.assertAlmostEqual(chf_17(F_b=1, mF_a=1), np.sqrt(1/4))
        self.assertAlmostEqual(chf_17(F_b=1, mF_a=2), np.sqrt(1/2))

        self.assertAlmostEqual(chf_17(F_b=2, mF_a=-2), np.sqrt(0))
        self.assertAlmostEqual(chf_17(F_b=2, mF_a=-1), -np.sqrt(1/6))
        self.assertAlmostEqual(chf_17(F_b=2, mF_a=0), -np.sqrt(1/4))
        self.assertAlmostEqual(chf_17(F_b=2, mF_a=1), -np.sqrt(1/4))
        self.assertAlmostEqual(chf_17(F_b=2, mF_a=2), -np.sqrt(1/6))

        # Table 18
        chf_18 = lambda F_b, mF_a: angmom.calc_clebsch_hf(J_a=J_a, I_a=I_a,
            F_a=1, mF_a=mF_a, J_b=J_b, I_b=I_b, F_b=F_b, mF_b=mF_a+1, q=-1)

        self.assertAlmostEqual(chf_18(F_b=1, mF_a=-1), -np.sqrt(1/12))
        self.assertAlmostEqual(chf_18(F_b=1, mF_a=0), -np.sqrt(1/12))
        self.assertAlmostEqual(chf_18(F_b=1, mF_a=1), np.sqrt(0))

        self.assertAlmostEqual(chf_18(F_b=2, mF_a=-1), -np.sqrt(1/12))
        self.assertAlmostEqual(chf_18(F_b=2, mF_a=0), -np.sqrt(1/4))
        self.assertAlmostEqual(chf_18(F_b=2, mF_a=1), -np.sqrt(1/2))

        # Table 19
        chf_19 = lambda F_b, mF_a: angmom.calc_clebsch_hf(J_a=J_a, I_a=I_a,
            F_a=1, mF_a=mF_a, J_b=J_b, I_b=I_b, F_b=F_b, mF_b=mF_a, q=0)

        self.assertAlmostEqual(chf_19(F_b=1, mF_a=-1), np.sqrt(1/12))
        self.assertAlmostEqual(chf_19(F_b=1, mF_a=0), np.sqrt(0))
        self.assertAlmostEqual(chf_19(F_b=1, mF_a=1), -np.sqrt(1/12))

        self.assertAlmostEqual(chf_19(F_b=2, mF_a=-1), np.sqrt(1/4))
        self.assertAlmostEqual(chf_19(F_b=2, mF_a=0), np.sqrt(1/3))
        self.assertAlmostEqual(chf_19(F_b=2, mF_a=1), np.sqrt(1/4))

        # Table 20
        def chf_20(F_b, mF_a): return angmom.calc_clebsch_hf(J_a=J_a, I_a=I_a,
            F_a=1, mF_a=mF_a, J_b=J_b, I_b=I_b, F_b=F_b, mF_b=mF_a - 1, q=1)

        self.assertAlmostEqual(chf_20(F_b=1, mF_a=-1), np.sqrt(0))
        self.assertAlmostEqual(chf_20(F_b=1, mF_a=0), np.sqrt(1 / 12))
        self.assertAlmostEqual(chf_20(F_b=1, mF_a=1), np.sqrt(1 / 12))

        self.assertAlmostEqual(chf_20(F_b=2, mF_a=-1), -np.sqrt(1 / 2))
        self.assertAlmostEqual(chf_20(F_b=2, mF_a=0), -np.sqrt(1 / 4))
        self.assertAlmostEqual(chf_20(F_b=2, mF_a=1), -np.sqrt(1 / 12))