bqskit.utils.math

This module implements numerical functions.

Functions

canonical_unitary(unitary)

Computes a canonical form for the provided unitary.

compute_su_generators(n)

Computes the Lie algebra generators for SU(n).

dexpmv(M, dM)

Compute the Matrix exponential F = e^M and its derivative dF.

diagonal_distance(unitary)

Compute how diagonal a unitary is.

dot_product(alpha, sigma)

Computes the standard dot product of alpha with sigma.

pauli_expansion(H)

Computes a Pauli expansion of the hermitian matrix H.

pauliz_expansion(H)

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

softmax(x[, beta])

Computes the softmax of vector x.

unitary_log_no_i(U)

Solves for H in U = e^{iH}