Surrogate
Datatypes
PauliPropagation.NodePathProperties — Type
NodePathProperties(node::CircuitNode)
NodePathProperties(node::CircuitNode, nsins::Int, ncos::Int, freq::Int)Surrogate PathProperties type. Carries CircuitNodes instead of numerical coefficients. If nsins, ncos, and freq are not provided, they are initialized to 0.
PauliPropagation.tonumber — Method
tonumber(path::NodePathProperties)Get the cummulative coefficient of a NodePathProperties node. This assumes that the surrogate has already been evaluated.
PauliPropagation.wrapcoefficients — Method
wrapcoefficients(pstr::PauliString, ::Type{NodePathProperties})Wrap the coefficient of a PauliString into NodePathProperties.
PauliPropagation.wrapcoefficients — Method
wrapcoefficients(psum::PauliSum, ::Type{NodePathProperties})Wrap the coefficients of a PauliSum into NodePathProperties.
Evaluate
PauliPropagation.evaluate! — Method
evaluate!(psum::PauliSum{<:Integer,NodePathProperties}, thetas; reset=true)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(). If reset is false, the function will not reset the is_evaluated flags of the nodes. This should only be done if they are manually reset.
PauliPropagation.reset! — Method
reset!(circuit_node::CircuitNode)Reset a CircuitNode in a the Surrogate. Needs to be done in-between evaluations with different parameters.
PauliPropagation.reset! — Method
reset!(end_node::EvalEndNode)Reset a EvalEndNode in a the Surrogate. These sit on the coeff field of NodePathProperties and are the end of the evaluation chain. Needs to be done in-between evaluations with different parameters.
PauliPropagation.reset! — Method
reset!(paths::Vector{NodePathProperties})Reset a vector of NodePathProperties in a the Surrogate. Needs to be done in-between evaluations with different parameters.
PauliPropagation.reset! — Method
reset!(psum::PauliSum{<:Integer, NodePathProperties})Reset the nodes in a the Surrogate. Needs to be done in-between evaluations with different parameters.
Propagate
PauliPropagation.propagate! — Method
propagate!(circ, psum::PauliSum{<:Integer,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. Truncations based on any numerical coefficient value cannot be used. Everything else is the same as in propagate!() for the non-Surrogate code.
PauliPropagation.propagate — Method
propagate(circ, pstr::PauliString{<:Integer,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. Truncations based on any numerical coefficient value cannot be used. Everything else is the same as in propagate!() for the non-Surrogate code.
PauliPropagation.propagate — Method
propagate(circ, psum::PauliSum{<:Integer,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. Truncations based on any numerical coefficient value cannot be used. Everything else is the same as in propagate!() for the non-Surrogate code.