Pauli Transfer Matrix
Matrices
PauliPropagation.calculateptm
— Methodfunction calculateptm(mat::AbstractMatrix; tol=1e-15, heisenberg=true)
function calculateptm(dtype<:Number, mat::AbstractMatrix; tol=1e-15, heisenberg=true)
Calculate the Pauli Transfer Matrix (PTM) of a matrix mat
. The PTM will be real-valued in the Pauli basis. However, it can be complex in a general basis. Pass an optional data type dtype
when entries are not floats. We truncate small complex components and abs values in the PTM using the tol
parameter. Note, by default the PTM is calculated in the Heisenberg picture, i.e., the PTM is that of the conjugate transpose of the matrix. This can be changed via the heisenberg::Bool
keyword argument.
Transfer maps
PauliPropagation.totransfermap
— Functiontotransfermap(nq::Integer, circuit::Vector{Gate}, thetas=nothing)
Computes the Pauli transfer map acting on nq
qubits from a circuit with parameters thetas
. thetas
defaults to nothing
but is required if the circuit contains parametrized gates. The returned lookup map is a vector of vectors like [(pstr1, coeff1), (pstr2, coeff2), ...], where the pstr
are partial Pauli strings on the affected qubits.
PauliPropagation.totransfermap
— Methodtotransfermap(ptm::AbstractMatrix)
Computes the Pauli transfer map acting on nq
qubits from a Pauli Transfer Matrix (PTM). The PTM should be the matrix representation of a gate in Pauli basis. The returned lookup map is a vector of vectors like [(pstr1, coeff1), (pstr2, coeff2), ...], where the pstr
are partial Pauli strings on the affected qubits.