Esempio n. 1
0
    def test_gamma3(self):
        """
        Test the calculation of gamma3. Test performed for N = 4.
        """
        true_gamma_1 = 0
        true_gamma_2 = 1.3333333730697632
        true_gamma_3 = 1.3333333730697632
        true_gamma_4 = 0
        true_gamma_5 = 0
        true_gamma_6 = 0

        N = 4
        test_dicke = _Dicke(N=N, collective_emission=1)
        test_gamma_1 = test_dicke.gamma3((1, 1, 1))
        test_dicke = _Dicke(N=N, emission=1)
        test_gamma_2 = test_dicke.gamma3((1, 1, 1))
        test_dicke = _Dicke(N=N, emission=1, collective_emission=2)
        test_gamma_3 = test_dicke.gamma3((1, 1, 1))
        test_dicke = _Dicke(N=N, dephasing=4)
        test_gamma_4 = test_dicke.gamma3((1, 1, 1))
        test_dicke = _Dicke(N=N, collective_pumping=2)
        test_gamma_5 = test_dicke.gamma3((1, 1, 1))
        test_dicke = _Dicke(N=N, collective_dephasing=2)
        test_gamma_6 = test_dicke.gamma3((1, 1, 1))
        #
        assert_almost_equal(true_gamma_1, test_gamma_1)
        assert_almost_equal(true_gamma_2, test_gamma_2)
        assert_almost_equal(true_gamma_3, test_gamma_3)
        assert_almost_equal(true_gamma_4, test_gamma_4)
        assert_almost_equal(true_gamma_5, test_gamma_5)
        assert_almost_equal(true_gamma_6, test_gamma_6)
Esempio n. 2
0
    def test_gamma1(self):
        """
        Test the calculation of gamma1.
        """
        true_gamma_1 = -2
        true_gamma_2 = -3
        true_gamma_3 = -7
        true_gamma_4 = -1
        true_gamma_5 = 0
        true_gamma_6 = 0

        N = 4
        test_dicke = _Dicke(N=N, collective_emission=1)
        test_gamma_1 = test_dicke.gamma1((1, 1, 1))
        test_dicke = _Dicke(N=N, emission=1)
        test_gamma_2 = test_dicke.gamma1((1, 1, 1))
        test_dicke = _Dicke(N=N, emission=1, collective_emission=2)
        test_gamma_3 = test_dicke.gamma1((1, 1, 1))
        test_dicke = _Dicke(N=N, dephasing=4)
        test_gamma_4 = test_dicke.gamma1((1, 1, 1))
        test_dicke = _Dicke(N=N, collective_pumping=2)
        test_gamma_5 = test_dicke.gamma1((1, 1, 1))
        test_dicke = _Dicke(N=N, collective_dephasing=2)
        test_gamma_6 = test_dicke.gamma1((1, 1, 1))

        assert_almost_equal(true_gamma_1, test_gamma_1)
        assert_almost_equal(true_gamma_2, test_gamma_2)
        assert_almost_equal(true_gamma_3, test_gamma_3)
        assert_almost_equal(true_gamma_4, test_gamma_4)
        assert_almost_equal(true_gamma_5, test_gamma_5)
        assert_almost_equal(true_gamma_6, test_gamma_6)
Esempio n. 3
0
    def lindbladian(self):
        """Build the Lindbladian superoperator of the dissipative dynamics.

        Returns
        -------
        lindbladian: :class: qutip.Qobj
            The Lindbladian matrix as a `qutip.Qobj`.
        """
        cythonized_dicke = _Dicke(int(self.N), float(self.emission),
                                  float(self.dephasing), float(self.pumping),
                                  float(self.collective_emission),
                                  float(self.collective_dephasing),
                                  float(self.collective_pumping))
        return cythonized_dicke.lindbladian()
Esempio n. 4
0
 def test_lindbladian_dims(self):
     """
     Test the calculation of the lindbladian matrix.
     """
     true_L = [[-4, 0, 0, 3], [0, -3.54999995, 0, 0],
               [0, 0, -3.54999995, 0], [4, 0, 0, -3]]
     true_L = Qobj(true_L)
     true_L.dims = [[[2], [2]], [[2], [2]]]
     N = 1
     test_dicke = _Dicke(N=N,
                         pumping=1,
                         collective_pumping=2,
                         emission=1,
                         collective_emission=3,
                         dephasing=0.1)
     test_L = test_dicke.lindbladian()
     assert_array_almost_equal(test_L.full(), true_L.full())
     assert_array_equal(test_L.dims, true_L.dims)
Esempio n. 5
0
 def test_gamma9(self):
     """
     Test the calculation of gamma9. Test performed for N = 4.
     """
     true_gamma_1 = 1
     true_gamma_2 = 0
     true_gamma_3 = 0.5
     true_gamma_4 = 0
     N = 4
     test_dicke = _Dicke(N=N, pumping=1, collective_pumping=2)
     test_gamma_1 = test_dicke.gamma9((1, 1, 1))
     test_gamma_2 = test_dicke.gamma9((2, 0, 0))
     test_gamma_3 = test_dicke.gamma9((1, 0, 0))
     test_gamma_4 = test_dicke.gamma9((2, -1, -1))
     assert_almost_equal(true_gamma_1, test_gamma_1)
     assert_almost_equal(true_gamma_2, test_gamma_2)
     assert_almost_equal(true_gamma_3, test_gamma_3)
     assert_almost_equal(true_gamma_4, test_gamma_4)
Esempio n. 6
0
    def test_gamma6(self):
        """
        Test the calculation of gamma6. Test performed for N = 4.
        """
        true_gamma_1 = 0.25
        true_gamma_2 = 1
        true_gamma_3 = 0
        true_gamma_4 = 0.25

        N = 4
        test_dicke = _Dicke(N=N, dephasing=1)
        test_gamma_1 = test_dicke.gamma6((1, 1, 1))
        test_gamma_2 = test_dicke.gamma6((0, 0, 0))
        test_gamma_3 = test_dicke.gamma6((2, 1, 1))
        test_gamma_4 = test_dicke.gamma6((1, -1, 1))

        assert_almost_equal(true_gamma_1, test_gamma_1)
        assert_almost_equal(true_gamma_2, test_gamma_2)
        assert_almost_equal(true_gamma_3, test_gamma_3)
        assert_almost_equal(true_gamma_4, test_gamma_4)
Esempio n. 7
0
    def test_gamma4(self):
        """
        Test the calculation of gamma4. Test performed for N = 4.
        """
        true_gamma_1 = 0.1666666716337204
        true_gamma_2 = 2
        true_gamma_3 = 0
        true_gamma_4 = 0.40824830532073975

        N = 4
        test_dicke = _Dicke(N=N, emission=1, collective_emission=2)
        test_gamma_1 = test_dicke.gamma4((1, 1, 1))
        test_gamma_2 = test_dicke.gamma4((0, 0, 0))
        test_gamma_3 = test_dicke.gamma4((2, 1, 1))
        test_gamma_4 = test_dicke.gamma4((1, -1, 1))

        assert_almost_equal(true_gamma_1, test_gamma_1)
        assert_almost_equal(true_gamma_2, test_gamma_2)
        assert_almost_equal(true_gamma_3, test_gamma_3)
        assert_almost_equal(true_gamma_4, test_gamma_4)
Esempio n. 8
0
    def test_gamma(self):
        """
        Test the calculation of various gamma values for diagonal system.

        For N = 6 |j, m> would be :

        | 3, 3>
        | 3, 2> | 2, 2>
        | 3, 1> | 2, 1> | 1, 1>
        | 3, 0> | 2, 0> | 1, 0> |0, 0>
        | 3,-1> | 2,-1> | 1,-1>
        | 3,-2> | 2,-2>
        | 3,-3>
        """
        N = 6
        collective_emission = 1.
        emission = 1.
        dephasing = 1.
        pumping = 1.
        collective_pumping = 1.
        model = _Dicke(N,
                       collective_emission=collective_emission,
                       emission=emission,
                       dephasing=dephasing,
                       pumping=pumping,
                       collective_pumping=collective_pumping)
        tau_calculated = [
            model.gamma3((3, 1, 1)),
            model.gamma2((2, 1, 1)),
            model.gamma4((1, 1, 1)),
            model.gamma5((3, 0, 0)),
            model.gamma1((2, 0, 0)),
            model.gamma6((1, 0, 0)),
            model.gamma7((3, -1, -1)),
            model.gamma8((2, -1, -1)),
            model.gamma9((1, -1, -1))
        ]
        tau_real = [2., 8., 0.333333, 1.5, -19.5, 0.666667, 2., 8., 0.333333]
        assert_array_almost_equal(tau_calculated, tau_real)