Tomography.py 文件源码

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

项目:Tomography 作者: afognini 项目源码 文件源码
def concurrence(self, rho):
        """Compute the concurrence of the density matrix.

        :param numpy_array rho: Density matrix

        :return: The concurrence, see https://en.wikipedia.org/wiki/Concurrence_(quantum_computing).
        :rtype: complex
        """

        rhoTilde = np.dot( np.dot(np.kron(self.PAULI[1], self.PAULI[1]) , rho.conj()) , np.kron(self.PAULI[1], self.PAULI[1]))

        rhoRoot = scipy.linalg.fractional_matrix_power(rho, 1/2.0)

        R = scipy.linalg.fractional_matrix_power(np.dot(np.dot(rhoRoot,rhoTilde),rhoRoot),1/2.0)

        eigValues, eigVecors = np.linalg.eig(R)
        sortedEigValues = np.sort(eigValues)

        con = sortedEigValues[3]-sortedEigValues[2]-sortedEigValues[1]-sortedEigValues[0]
        return np.max([con,0])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号