Surrogate

Datatypes

PauliPropagation.NodePathPropertiesType
NodePathProperties(node::CircuitNode, nsins::Int, ncos::Int, freq::Int)

Surrogate PathProperties type. Carries CircuitNodes instead of numerical coefficients.

source
PauliPropagation.PauliRotationNodeType
PauliRotationNode(parents::Vector{Union{EvalEndNode,PauliRotationNode}}, trig_inds::Vector{Int}, signs::Vector{Int}, param_idx::Int)

Surrogate graph node for a Pauli rotation gate.

source
PauliPropagation.set!Method
set!(psum::Dict{TermType, NodePathProperties}, pstr::TermType, path::NodePathProperties)

In-place setting the coefficient of a Pauli string in a Pauli sum dictionary. The type of the Pauli string needs to be the keytype=TermType of the dictionary, and the coefficient coeff needs to be the valuetype=NodePathProperties. If the coefficient is 0, the Pauli string is removed from the dictionary.

source
PauliPropagation.tonumberMethod
tonumber(path::NodePathProperties)

Get the cummulative coefficient of a NodePathProperties node. This assumes that the surrogate has already been evaluated.

source

Evaluate

PauliPropagation._traceevalorderMethod
_traceevalorder(node::EvalEndNode, thetas; eval_list=nothing)

Evaluates the observable's coefficient. This function likely does not need to be called manually.

source
PauliPropagation._traceevalorderMethod
_traceevalorder(node::PauliRotationNode, thetas; eval_list=nothing)

Evaluate the coefficient of node on the Surrogate by recursively evaluating all parents. thetas are the parameters of the circuit. NOTE: This requires calling resetnodes in-between evaluations with different thetas. eval_list does not need to be passed when manually using this function.

source
PauliPropagation._traceevalorderMethod
_traceevalorder(nodes::Vector{<:CircuitNode}, thetas)

Evaluate the sum of coefficients of a vector of CircuitNode on the Surrogate. This will be evaluated in parallel with recursive evaluation of the parents. NOTE: This requires calling resetnodes in-between evaluations with different thetas.

source
PauliPropagation.evaluate!Method
evaluate!(psum::PauliSum{TermType,NodePathProperties}, thetas)

Evaluate the expectation value of a Surrogate by evaluating all involved circuit nodes in the correct order. eval_list can be attained as the output of gettraceevalorder()

source
PauliPropagation.expectationMethod
expectation(eval_list::Vector{<:CircuitNode}, thetas)

Evaluate the expectation value of a Surrogate by evaluating all involved circuit nodes in the correct order. eval_list can be attained as the output of gettraceevalorder()

source
PauliPropagation.gettraceevalorderMethod
gettraceevalorder(node::CircuitNode, thetas)

Return a vector of CircuitNodes in the order they should be evaluated to get the correct cummulative result on node. thetas numerically plays no role here but it needs to be the correct length given the number of parametrized gates.

source
PauliPropagation.reset!Method
reset!(circuit_node::CircuitNode)

Reset a CircuitNode in a the Surrogate. Needs to be done in-between evaluatios with different parameters.

source
PauliPropagation.reset!Method
reset!(end_node::EvalEndNode)

Reset a EvalEndNode in a the Surrogate. Needs to be done in-between evaluatios with different parameters.

source
PauliPropagation.reset!Method
reset!(psum::PauliSum{TermType, NodePathProperties})

Reset the nodes in a the Surrogate. Needs to be done in-between evaluatios with different parameters.

source

Propagate

PauliPropagation.applyMethod
apply(gate::CliffordGate, pstr::PauliStringType, coeff::NodePathProperties)

Apply a CliffordGate to an integer Pauli string and NodePathProperties coefficient.

source
PauliPropagation.propagate!Method
propagate!(circ, psum::PauliSum{PauliStringType,NodePathProperties}; max_weight=Inf, max_freq=Inf, max_sins=Inf, customtruncfunc=nothing, kwargs...)

Construct a Pauli propagation surrogate of the propagated PauliSum through the circuit circ in the Heisenberg picture. The PauliSum psum is modified in place. The circuit must only contain CliffordGates and PauliRotations. It is applied to the Pauli sum in reverse order, and the action of each gate is its conjugate action. The input psum will be modified. Default truncations are max_weight, max_freq, and max_sins. 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!, applyandadd!, and apply.

source
PauliPropagation.propagateMethod
propagate(circ, pstr::PauliString{PauliStringType,NodePathProperties}; max_weight=Inf, max_freq=Inf, max_sins=Inf, customtruncfunc=nothing, kwargs...)

Construct a Pauli propagation surrogate of the propagated PauliString through the circuit circ in the Heisenberg picture. The circuit must only contain CliffordGates and PauliRotations. It is applied to the Pauli string in reverse order, and the action of each gate is its conjugate action. Default truncations are max_weight, max_freq, and max_sins. 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!, applyandadd!, and apply.

source
PauliPropagation.propagateMethod
propagate(circ, psum::PauliSum{PauliStringType,NodePathProperties}; max_weight=Inf, max_freq=Inf, max_sins=Inf, customtruncfunc=nothing, kwargs...)

Construct a Pauli propagation surrogate of the propagated PauliSum through the circuit circ in the Heisenberg picture. The circuit must only contain CliffordGates and PauliRotations. It is applied to the Pauli sum in reverse order, and the action of each gate is its conjugate action. Default truncations are max_weight, max_freq, and max_sins. 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!, applyandadd!, and apply.

source