Propagation
Generics
PauliPropagation.PropagationBase.propagate — Function
propagate(circ, pstr::PauliString, thetas=nothing; min_abs_coeff=1e-10, max_weight=Inf, max_freq=Inf, max_sins=Inf, customtruncfunc=nothing, heisenberg=true, kwargs...)Propagate a PauliString through the circuit circ. By default this is done in the Heisenberg picture, as indicated by heisenberg=true. This means that the circuit is applied to the Pauli string in reverse order, and the action of each gate is its conjugate action. Parameters for the parametrized gates in circ are given by thetas, and need to be passed as if the circuit was applied as written in the Schrödinger picture. If thetas are not passed, the circuit must contain only non-parametrized StaticGates. Default truncations are min_abs_coeff, max_weight, max_freq, and max_sins. max_freq, and max_sins will lead to automatic conversion if the coefficients are not already wrapped in suitable PathProperties objects. A custom truncation function can be passed as customtruncfunc with the signature customtruncfunc(pstr::PauliStringType, coefficient)::Bool. Further kwargs are passed to the lower-level functions applymergetruncate!, applytoall!, and apply.
PauliPropagation.PropagationBase.propagate — Function
propagate(circuit, psum::AbstractPauliSum, thetas=nothing; min_abs_coeff=1e-10, max_weight=Inf, max_freq=Inf, max_sins=Inf, customtruncfunc=nothing, heisenberg=true, kwargs...)
propagate!(circuit, psum::AbstractPauliSum, thetas=nothing; min_abs_coeff=1e-10, max_weight=Inf, max_freq=Inf, max_sins=Inf, customtruncfunc=nothing, heisenberg=true, kwargs...)Propagate a Pauli sum psum through the circuit circ. By default this is done in the Heisenberg picture, as indicated by heisenberg=true. This means that the circuit is applied to the Pauli sum in reverse order, and the action of each gate is its conjugate action. In propagate() the Pauli sum psum is deepcopied and passed into the in-place propagation function propagate!(). Parameters for the parametrized gates in circ are given by thetas, and need to be passed as if the circuit was applied as written in the Schrödinger picture. If thetas are not passed, the circuit must contain only non-parametrized StaticGates. Default truncations are min_abs_coeff, max_weight, max_freq, and max_sins. max_freq, and max_sins will lead to automatic conversion if the coefficients are not already wrapped in suitable PathProperties objects. A custom truncation function can be passed as customtruncfunc with the signature customtruncfunc(pstr::PauliStringType, coefficient)::Bool. Further kwargs are passed to the lower-level functions applymergetruncate!, applytoall!, and apply.
PauliPropagation.PropagationBase.propagate! — Function
propagate!(circuit, prop_cache::AbstractPauliPropagationCache, thetas=nothing; min_abs_coeff=1e-10, max_weight=Inf, max_freq=Inf, max_sins=Inf, customtruncfunc=nothing, heisenberg=true, kwargs...)In-place propagation of an AbstractPauliPropagationCache through the circuit circ in the Heisenberg picture.
PauliPropagation.PropagationBase.truncate! — Method
truncate!(psum::AbstractPauliSum; minabscoeff=1e-10, maxweight=Inf, maxfreq=Inf, maxsins=Inf, customtruncfunc=nothing, kwargs...) truncate!(propcache::AbstractPauliPropagationCache; minabscoeff=1e-10, maxweight=Inf, maxfreq=Inf, max_sins=Inf, customtruncfunc=nothing, kwargs...)
Truncation function for AbstractPauliPropagationCaches that combines multiple truncation criteria. The default truncation criteria are:
min_abs_coeff: Truncates Pauli strings with absolute coefficient below this value.max_weight: Truncates Pauli strings with weight (number of non-identity Paulis) above this value.max_freq: Truncates Pauli strings with frequency (number of cosine factors in coefficient) above this value.max_sins: Truncates Pauli strings with number of sine factors in coefficient above this value.
A custom truncation function can be passed as customtruncfunc with the signature customtruncfunc(pstr, coeff)::Bool.
This function combines all truncation criteria into a single truncation function truncfunc() calls PropagationBase.truncate!(truncfunc, prop_cache).
Specializations
PauliPropagation.PropagationBase.apply — Method
apply(gate::TransferMapGate, pstr, coeff)Apply a TransferMapGate to an integer Pauli string and its coefficient. The outcomes are determined by the transfer_map of the gate.
PauliPropagation.PropagationBase.applymergetruncate! — Method
applymergetruncate!(gate::ImaginaryPauliRotation, prop_cache::AbstractPauliPropagationCache, tau; normalize_coeffs=true, kwargs...)Overload of applymergetruncate! for ImaginaryPauliRotation gates and a propagating PauliSum. Applies the gate, merges the resulting Pauli sum, and truncates it. If normalize_coeffs=true, the resulting Pauli sum is normalized by the coefficient of the identity Pauli string after merging. This is useful for numerical stability when evolving states in the Schrödinger picture.
PauliPropagation.PropagationBase.applytoall! — Method
applytoall!(gate::AmplitudeDampingNoise, prop_cache::PauliPropagationCache, gamma; kwargs...)Overload of applytoall! for AmplitudeDampingNoise gates and a propagating PauliSum.
PauliPropagation.PropagationBase.applytoall! — Method
applytoall!(gate::CliffordGate, prop_cache::AbstractPauliPropagationCache; kwargs...)Overload of applytoall! for CliffordGates with a propagating PauliSum. Provides the Clifford lookup map to the default applytoall!, and apply functions.
PauliPropagation.PropagationBase.applytoall! — Method
applytoall!(gate::FrozenGate, thetas, psum, aux_psum; kwargs...)Overload of applytoall! for FrozenGates. Re-directs to applytoall! for the wrapped FrozenGate.gate with the frozen parameter.
PauliPropagation.PropagationBase.applytoall! — Method
applytoall!(gate::PauliNoise, prop_cache::PauliPropagationCache, p; kwargs...)Overload of applytoall! for PauliNoise gates with noise strength p and a propagating PauliSum.
PauliPropagation.PropagationBase.applytoall! — Method
applytoall!(gate::PauliRotation, theta, psum, aux_psum; kwargs...)Overload of applytoall! for PauliRotation gates and a propagating PauliSum. It fixes the type-instability of the apply() function and reduces moving Pauli strings between psum and aux_psum. psum and aux_psum are merged later.
PauliPropagation.PropagationBase.applytoall! — Method
applytoall!(gate::TGate, prop_cache::AbstractPauliPropagationCache; kwargs...)Overload of applytoall!() for TGate(qind) and a propagating PauliSum. Redirects to a PauliRotation(:Z, qind) with angle π/4.
Vector Specializations
PauliPropagation.PropagationBase.applytoall! — Method
applytoall!(gate::CliffordGate, prop_cache::VectorPauliPropagationCache; kwargs...)Overload of applytoall! for CliffordGates and a propagating VectorPauliSum.
PauliPropagation.PropagationBase.applytoall! — Method
applytoall!(gate::ImaginaryPauliRotation, prop_cache::VectorPauliPropagationCache, tau; kwargs...)Overload of applytoall! for ImaginaryPauliRotation gates and a propagating VectorPauliSum.
PauliPropagation.PropagationBase.applytoall! — Method
applytoall!(gate::PauliNoise, prop_cache::VectorPauliPropagationCache, p; kwargs...)Overload of applytoall! for PauliNoise gates with noise strength p and a propagating VectorPauliSum.
PauliPropagation.PropagationBase.applytoall! — Method
applytoall!(gate::PauliRotation, prop_cache::VectorPauliPropagationCache, theta; kwargs...)Overload of applytoall! for PauliRotation gates and a propagating VectorPauliSum.