rydiqule.sensor_utils.get_rho_ij¶
- rydiqule.sensor_utils.get_rho_ij(sols: ndarray | Solution, i: int, j: int) complex | ndarray [source]¶
For a given density matrix solution, retrieve a specific element of the density matrix.
Assumes the ground state of the solution is eliminated (as per
remove_ground()
), and assumes Rydiqule’s nominal state ordering of the Density Vector (permake_real()
).- Parameters:
sols (numpy.ndarray or
Solution
) – Solutions to extract the matrix element for. Can be either the solution object returned by the solve or an N-D array representing density vectors, with ground state removed, and written in the totally real equations.i (int) – density matrix index i
j (int) – density matrix index j
- Returns:
Array of rho_ij values. Will be of type float when
i==j
. Will be of type complex128 wheni!=j
.- Return type:
Examples
>>> sols = np.arange(180).reshape((4,5,3,3)) >>> print(sols.shape) (4, 5, 3, 3) >>> rho_01 = rq.get_rho_ij(sols, 0,1) >>> print(rho_01.shape) (4, 5, 3) >>> print(rho_01[0,0]) [0.-1.j 3.-4.j 6.-7.j]