Numerical Certificates

PauliPropagation._calculatesplitprobabilitiesMethod

Function that automatically calculates the vector of splitting probabilities of the gates in the circuit based on a vector of thetas. For Pauli gates, the theta value is interpreted as the limits of the integration [-theta, theta]. For AmplitudeDampingNoise, the splitting probability is the damping rate.

source
PauliPropagation._calculatesplitprobabilitiesMethod

Function that automatically calculates the splitting probability of the gates in the circuit based on a one number theta. This assumes that the circuit consists only of PauliRotation -CliffordGate.

source
PauliPropagation.estimatemseFunction
estimatemse(circ, pstr::PauliString, n_mcsamples::Integer, thetas=π; stateoverlapfunc=overlapwithzero, circuit_is_reversed=false, customtruncfunc=nothing)

Function to estimate the mean square error of a truncated circuit simulation using Monte Carlo sampling. Returns the mean squared error of the truncated Pauli propagation simulation averaged over the thetas∈ [theta, theta] of the angle theta of each PauliRotation. Currently, the function only supports circuits with PauliRotation and CliffordGate gates.

The length the thetas vector should be equal to the number of parametrized gates in the circuit. Alternatively, thetas can be a single real number applicable for all parametrized gates. The default thetas=π or any other non-array values assume that the circuit consists only of PauliRotation -CliffordGate. For PauliRotation, the value should be the integration range of the parameters around zero.

An initial state overlap function stateoverlapfunc can be provided to calculate the overlap of the backpropagated Pauli strings with the initial state. Importantly, the kwargs can be used to set the truncation parameters of the Pauli propagation. Currently supported are max_weight, max_freq, and max_sins. Note that min_abs_coeff is not supported here, as we consider errors integrated over the angles. max_freq effectively truncates small coefficients below (1/2)^max_freq on average over thetas ∈ [-π, π]. A custom truncation function can be passed as customtruncfunc with the signature customtruncfunc(pstr::PauliStringType, coefficient)::Bool.

source
PauliPropagation.estimatemse!Method
estimatemse!(circ, pstr::PauliString, error_array::AbstractVector, thetas, split_probabilities; stateoverlapfunc=overlapwithzero, circuit_is_reversed=false, kwargs...)

In-place version of estimatemse. This function takes an array error_array of length n_mcsamples as an argument and modifies it in-place. It further assumes that the thetas and split_probabilities are already correctly calculated and provided as arguments. In general they will be vectors, but they can also be real numbers. A custom truncation function can be passed as customtruncfunc with the signature customtruncfunc(pstr::PauliStringType, coefficient)::Bool.

source
PauliPropagation.mcapplyMethod
mcapply(gate::CliffordGate, pauli, coeff, theta, split_probability)

mcapply() function for a CliffordGate is just the apply() function because it does not split.

source
PauliPropagation.mcapplyMethod
mcapply(gate::MaskedPauliRotation, pauli, coeff, theta, split_prob)

MC apply function for a MaskedPauliRotation. This will error if a PauliRotation is not converted to a MaskedPauliRotation before calling this function. If the gate commutes with the pauli string, the pauli string is left unchanged. Else the pauli string is split off with a probability 1 - split_prob.

source
PauliPropagation.montecarlopropagationMethod
montecarlopropagation(circ, pstr::PauliString, thetas, split_probabilities; max_weight=Inf, max_freq=Inf, max_sins=Inf)

Perform a single Monte Carlo propagation of a Pauli string through an already reversed circuit. Returns the final Pauli string and a boolean indicating whether the path was truncated.

It further assumes that the thetas and split_probabilities are already correctly calculated and provided as arguments. In general they will be vectors, but they can also be real numbers.

source