rydiqule.sensor_utils.get_rho_populations

rydiqule.sensor_utils.get_rho_populations(sols: ndarray | Solution) ndarray[source]

For a given density matrix solution, return the diagonal populations.

Note that rydiqule’s convention for removing the ground state forces population conservation, ie the sum of these populations will be 1.

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.

Returns:

Populations of the density matrices. Will have same shape as input solutions, with the last dimension reduced to the basis size.

Return type:

numpy.ndarray