Closed ytdHuang closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 93.36%. Comparing base (
3a68599
) to head (c22f230
). Report is 2 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Is this method equal to the current one in the case
rank =N
?
Not equal, as I mentioned in above. I think the current method is not random enough.
In the case rank = n
the Ginibre generates a square complex random matrix and then multiplies it by its adjoint. Like the previous implementation, except for the randn
instead of the rand
function. It is just to understand. The implementation is good, aside from the two comments made above.
This PR introduces
rand_ket
, and also modify the method for generating random density matrixrand_dm
.I think the current method for generating random density matrix is not random enough. Because the real value of off-diagonal elements are always positive.
Here, I implement the method to generate random density matrix from Ginibre ensemble, which is also the default method in
qutip
. I think this method is the more standard one in the literature.Furthermore, with this method, we can specify the
rank
of the density matrix, i.e., the number of eigenvalues which are positive. The other eigenvalues will be very close to zero (< 1e-15
).