pauli_expansion

pauli_expansion(H)[source]

Computes a Pauli expansion of the hermitian matrix H.

Parameters:

H (np.ndarray) – The hermitian matrix to expand.

Returns:

The coefficients of a Pauli expansion for H, i.e., X dot Sigma = H where Sigma is Pauli matrices of same size of H.

Return type:

np.ndarray

Note

This assumes the input is hermitian but does not check. The output is undefined on non-hermitian inputs.