pauliz_expansion

pauliz_expansion(H)[source]

Computes a Pauli Z expansion of the diagonal hermitian matrix H.

Parameters:

H (complex128) – The (N, N) diagonal hermitian matrix to expand.

Returns:

The coefficients of a Pauli Z expansion for H, i.e., x dot Sigma = H where Sigma contains Pauli Z matrices of same size of H.

Return type:

float64

Note

This assumes the input is diagonal but of shape (N, N). No check is done for hermicity. The output is undefined on non-hermitian inputs.