Exemplo n.º 1
0
    def get_Lindbladian(self, dims):
        """
        Compute the Lindbladian, based on relaxation, dephasing constants and finite temperature.

        Returns
        -------
        tf.Tensor
            Hamiltonian
        """
        Ls = []
        if "t1" in self.params:
            t1 = self.params["t1"].get_value()
            gamma = (0.5 / t1) ** 0.5
            L = gamma * self.collapse_ops["t1"]
            Ls.append(L)
            if "temp" in self.params:
                if self.params["temp"].get_value().numpy():
                    if self.hilbert_dim > 2:
                        freq_diff = np.array(
                            [
                                (
                                    self.params["freq"].get_value()
                                    + n * self.params["anhar"].get_value()
                                )
                                for n in range(self.hilbert_dim)
                            ]
                        )
                    else:
                        freq_diff = np.array([self.params["freq"].get_value(), 0])
                    beta = 1 / (self.params["temp"].get_value() * kb)
                    det_bal = tf.exp(-hbar * tf.cast(freq_diff, tf.float64) * beta)
                    det_bal_mat = hskron(
                        tf.linalg.tensor_diag(det_bal), self.index, dims
                    )
                    L = gamma * tf.matmul(self.collapse_ops["temp"], det_bal_mat)
                    Ls.append(L)
        if "t2star" in self.params:
            gamma = (0.5 / self.params["t2star"].get_value()) ** 0.5
            L = gamma * self.collapse_ops["t2star"]
            Ls.append(L)
        if Ls == []:
            raise Exception("No T1 or T2 provided")
        return tf.cast(sum(Ls), tf.complex128)
Exemplo n.º 2
0
    def get_Lindbladian(self, dims):
        """
        Compute the Lindbladian, based on relaxation, dephasing constants and finite
        temperature.

        Returns
        -------
        tf.Tensor
            Hamiltonian

        """
        # Form of the operators from p. 71 in https://ocw.mit.edu/courses/
        # nuclear-engineering/22-51-quantum-theory-of-radiation-interactions-fall-2012/
        # lecture-notes/MIT22_51F12_Ch8.pdf
        Ls = []
        if "t1" in self.params:
            t1 = self.params["t1"].get_value()
            gamma = (0.5 / t1)**0.5
            L = gamma * self.collapse_ops["t1"]
            Ls.append(L)
            if "temp" in self.params:
                if self.hilbert_dim > 2:
                    freq = self.params["freq"].get_value()
                    anhar = self.params["anhar"].get_value()
                    freq_diff = np.array(
                        [freq + n * anhar for n in range(self.hilbert_dim)])
                else:
                    freq_diff = np.array([self.params["freq"].get_value(), 0])
                beta = 1 / (self.params["temp"].get_value() * kb)
                det_bal = tf.exp(-hbar * tf.cast(freq_diff, tf.float64) * beta)
                det_bal_mat = hskron(tf.linalg.tensor_diag(det_bal),
                                     self.index, dims)
                L = gamma * tf.matmul(self.collapse_ops["temp"], det_bal_mat)
                Ls.append(L)
        if "t2star" in self.params:
            gamma = (0.5 / self.params["t2star"].get_value())**0.5
            L = gamma * self.collapse_ops["t2star"]
            Ls.append(L)
        if Ls == []:
            raise Exception("No T1 or T2 provided")
        return tf.cast(sum(Ls), tf.complex128)