pygsti.tools.matrixtools.is_valid_density_mx#
- is_valid_density_mx(mx, tol=1e-09)#
Test whether mx is a valid density matrix (hermitian, positive-definite, and unit trace).
- Parameters:
mx (numpy array) – Matrix to test.
tol (float, optional) – Tolerance on absolute magitude of elements.
- Returns:
True if mx is a valid density matrix, otherwise False.
- Return type:
bool