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