Tomography.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:Tomography 作者: afognini 项目源码 文件源码
def rho_phys(self, t):
        """Positive semidefinite matrix based on t values.

        :param numpy_array t: tvalues

        :return: A positive semidefinite matrix which is an estimation of the actual density matrix.
        :rtype: numpy matrix
        """
        T = np.complex_(np.matrix([
                        [t[0],              0,              0,              0],
                        [t[4]+1j*t[5],      t[1],           0,              0],
                        [t[10]+1j*t[11],    t[6]+1j*t[7],   t[2],           0],
                        [t[14]+1j*t[15],    t[12]+1j*t[13], t[8]+1j*t[9],   t[3]]
                        ]))

        TdagT = np.dot(T.conj().T , T)
        norm = np.trace(TdagT)

        return TdagT/norm
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号