- qspec.simulate.density_matrix_diagonal ( rho , axis = 1 )[source]
The diagonal of the density matrix $\operatorname{diag}(\rho)$.
- Parameters:
-
- rhoarray_like
The density matrix $\rho$. Must have the same size in
axisandaxis + 1.- axisint
The axis along which the population is aligned in
rho. The default isaxis = 1, expectingrhoas an array with shape(n, Atom.size, Atom.size, ... ).
- Returns:
-
- outndarray
the diagonal of the density matrix as an array with shape
(n, Atom.size, ...).