rydiqule.sensor_utils.convert_complex_to_dm¶
- rydiqule.sensor_utils.convert_complex_to_dm(complex_dm: ndarray) ndarray [source]¶
Converts a standard density matrices in the complex basis with ground state into rydiqule’s computational real basis with ground state removed.
rydiqule
’s built-in functions do not return complex density matrices, so this function is usedinternally and to undo the conversion of
convert_dm_to_complex()
.
- Parameters:
complex_dm (numpy.ndarray) – Stack of density matrices in the complex basis with ground state present. Has shape of
(..., b, b)
whereb
is the number of states in the basis.- Returns:
Density matrices in rydiqule’s computational basis (real with state 0 removed). Has shape
(..., b**2-1)
.- Return type:
- Raises:
RydiquleError – If the provided density matrices are not square.
RydiquleError – If the converted matrix is not real (implies non-hermitian)