- 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
axis
andaxis + 1
.- axisint
The axis along which the population is aligned in
rho
. The default isaxis = 1
, expectingrho
as 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, ...)
.