Trace distance

The command below calculates the trace distance between the two matrices $ A$ and $ B$ read from respective files of fileA and fileB saved by the ``msave'' command (or ``RDOsave'' etc.).
trdist(fileA, fileB);
The trace distance between (N,N) density matrices $ A$ and $ B$ is defined by

\begin{displaymath}\begin{split}D(A,B)&=\frac{1}{2}\mathrm{Tr}\vert A-B\vert\\ &=\frac{1}{2}\mathrm{Tr}\sqrt{(A-B)^\dagger(A-B)}. \end{split}\end{displaymath}    



root
2004-11-07