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])
评论列表
文章目录