Data types
PauliString
PauliPropagation.PauliString — Type
PauliString(nqubits::Int, pauli::Symbol, qind::Integer, coeff=1.0)
PauliString(nqubits::Int, paulis::Vector{Symbol}, qinds::Vector{Integer}, coeff=1.0)Constructor for a PauliString on nqubits qubits from a Symbol (:I, :X, :Y, :Z) or Vector{Symbol}. Provide the index or indices for those symbols as qind or qinds. The coefficient of the Pauli string in the Pauli sum defaults to 1.0.
PauliPropagation.PauliString — Type
PauliString(nqubits::Int, term::TermType, coeff::CoeffType)PauliString is a struct that represents a Pauli string on nqubits qubits. Commonly term is an unsigned Integer. See the other PauliString constructors for higher-level usage.
PauliPropagation.PropagationBase.coefftype — Method
coefftype(pstr::PauliString)Get the coefficient type of a PauliString.
PauliPropagation.PropagationBase.numcoefftype — Method
numcoefftype(pstr::PauliString)Get the type of the numerical coefficient of a PauliString. Will return the type of the output of numcoefftype(coefftype(pstr)).
PauliPropagation.nqubits — Method
nqubits(pstr::PauliString)Get the number of qubits that the PauliString is defined on.
PauliPropagation.paulitype — Method
paulitype(pstr::PauliString)Get the Pauli integer type of a PauliString.
PauliSum
PauliPropagation.PauliSum — Type
PauliSum(nqubits::Int, terms::Dict) <: AbstractPauliSumPauliSum is a struct that represents a sum of Pauli strings acting on nqubits qubits. It is a wrapper around a dictionary Dict(Pauli string => coefficient}, where the Pauli strings are typically unsigned Integers for efficiency reasons.
PauliPropagation.PauliSum — Method
PauliSum(nqubits::Integer)Contructor for an empty PauliSum on nqubits qubits. Element type defaults for Float64.
PauliPropagation.PauliSum — Method
PauliSum(CoeffType, nq::Int)Contructor for an empty PauliSum on nqubits qubits. The type of the coefficients can be provided.
PauliPropagation.nqubits — Method
nqubits(psum::PauliSum)Get the number of qubits that the PauliSum is defined on.
VectorPauliSum
PauliPropagation.VectorPauliSum — Type
VectorPauliSum{TV,CV} <: AbstractPauliSumVectorPauliSum is a struct that represents a sum of Pauli strings acting on nqubits qubits. It is a wrapper around two vectors: one for the Pauli strings (as unsigned Integers for efficiency reasons), and one for the coefficients. Using it defaults to multi-threaded operations where possible.
PauliPropagation.VectorPauliSum — Method
VectorPauliSum(nqubits::Int)Constructor for an empty VectorPauliSum on nqubits qubits. Element type defaults for Float64.
PauliPropagation.VectorPauliSum — Method
VectorPauliSum(::Type{CT}, nqubits::Int)Contructor for an empty VectorPauliSum on nqubits qubits. The type of the coefficients can be provided.
PauliPropagation.nqubits — Method
nqubits(vpsum::VectorPauliSum)Get the number of qubits that the VectorPauliSum is defined on.
Conversions
PauliPropagation.PauliSum — Method
PauliSum(pstr::PauliString)Constructor for a PauliSum on nqubits qubits from a PauliString.
PauliPropagation.PauliSum — Method
PauliSum(pstrs::Vector{PauliString})Constructor for a PauliSum on nqubits qubits from a PauliString.
PauliPropagation.PauliSum — Method
PauliSum(vpsum::VectorPauliSum)Convert a VectorPauliSum to a PauliSum. Does not change vpsum.
PauliPropagation.PauliSum — Method
PauliSum(nq::Integer, pstr::PauliString)Constructor for a PauliSum on nqubits qubits from a PauliString.
PauliPropagation.VectorPauliSum — Method
VectorPauliSum(nq::Integer, pstr::PauliString)Constructor for a VectorPauliSum on nqubits qubits from a PauliString.
PauliPropagation.VectorPauliSum — Method
VectorPauliSum(pstr::PauliString)Constructor for a VectorPauliSum from a PauliString.
PauliPropagation.VectorPauliSum — Method
VectorPauliSum(psum::PauliSum)Convert a PauliSum to a VectorPauliSum.
PauliPropagation.VectorPauliSum — Method
VectorPauliSum(pstrs::Vector{PauliString})Constructor for a VectorPauliSum from a vector of PauliStrings.
PauliPropagation._checknumberofqubits — Method
Checks whether the number of qubits nqubits is the same between in some collection.
AbstractPauliSum
PauliPropagation.AbstractPauliSum — Type
AbstractPauliSum <: AbstractTermSumAbstract type for objects represented sums of Paulis with coefficients.
Base.filter — Method
filter!(filterfunc::Function, psum::AbstractPauliSum)Filter a AbstractPauliSum by copying and removing all Pauli strings for which filterfunc(pstr, coeff) returns false.
PauliPropagation.PropagationBase.add! — Function
add!(psum::AbstractPauliSum, pauli::Symbol, qind::Integer, coeff=1.0)
add!(psum::AbstractPauliSum, paulis::Vector{Symbol}, qinds::Vector{Integer}, coeff=1.0)Add a Pauli string to a AbstractPauliSum psum. Changes psum in-place. Provide the Pauli string as a Symbol (:I, :X, :Y, :Z) or Vector{Symbol}. Provide the index or indices for those symbols as qind or qinds. The coefficient of the Pauli string in the Pauli sum defaults to 1.0.
PauliPropagation.PropagationBase.add! — Method
add!(psum::AbstractPauliSum, pstr, coeff)Add a Pauli string pstr with coefficient coeff to a AbstractPauliSum psum. This changes psum in-place. pstr needs to have the same type as paulitype(psum), and coeff needs to have the same type as coefftype(psum).
PauliPropagation.PropagationBase.add! — Method
add!(psum1::AbstractPauliSum, psum2::AbstractPauliSum)Add two AbstractPauliSums psum1 and psum2. Changes psum1 in-place. psum1 and psum2 need to be defined on the same number of qubits and have the same coefficient type.
PauliPropagation.PropagationBase.add! — Method
add!(psum::AbstractPauliSum, pstr::PauliString)Add a PauliString pstr to a PauliSum psum. Changes psum in-place. psum and pstr need to be defined on the same number of qubits and have the same coefficient type.
PauliPropagation.PropagationBase.coefficients — Function
coefficients(psum::AbstractPauliSum)Returns an iterator over the coefficients of a PauliSum. Call topaulistrings to receive entries as PauliStrings.
PauliPropagation.PropagationBase.getcoeff — Method
getcoeff(psum::AbstractPauliSum, pstr::Vector{Symbol}, qinds::Vector{Int})Get the coefficient of a Pauli string in an AbstractPauliSum by providing the Pauli string pstr as a vector of Symbols acting on qubits qinds. This is consistent with how Pauli strings can be added to a PauliSum via add!(). Defaults to 0 if the Pauli string is not in the AbstractPauliSum.
PauliPropagation.PropagationBase.getcoeff — Method
getcoeff(psum::AbstractPauliSum, pstr::Integer)Get the coefficient of a PauliString in a PauliSum. Defaults to 0 if the Pauli string is not in the PauliSum. Requires that the integer Pauli string in pstr is the same type as the integer Pauli strings in psum.
PauliPropagation.PropagationBase.getcoeff — Method
getcoeff(psum::AbstractPauliSum, pauli::Symbol, qind::Integer)Get the coefficient of a Pauli string in an AbstractPauliSum by providing the Pauli string as a Symbol acting on qubit qind. This is consistent with how Pauli strings can be added to a PauliSum via add!(). Defaults to 0 if the Pauli string is not in the AbstractPauliSum.
PauliPropagation.PropagationBase.getcoeff — Method
getcoeff(psum::AbstractPauliSum, pstr::Vector{Symbol})Get the coefficient of a Pauli string in a AbstractPauliSum by providing the Pauli string pstr as a vector of Symbols acting on all qubits. This is consistent with how Pauli strings can be added to a PauliSum via add!(). Defaults to 0 if the Pauli string is not in the AbstractPauliSum.
PauliPropagation.PropagationBase.set! — Function
set!(psum::AbstractPauliSum, pstr, coeff)In-place setting the coefficient of a Pauli string in an AbstractPauliSum. The type of the Pauli string needs to be the typeof(pstr)==paulitype(psum) and typeof(coeff)==coefftype(psum).
PauliPropagation.filter! — Method
filter!(filterfunc::Function, psum::AbstractPauliSum)Filter a AbstractPauliSum in-place by removing all Pauli strings for which filterfunc(pstr, coeff) returns false.
PauliPropagation.paulis — Method
paulis(psum::AbstractPauliSum)Returns an iterator over the integer pauli strings of an AbstractPauliSum. Call topaulistrings to receive entries as PauliStrings.
PauliPropagation.paulitype — Method
paulitype(psum::AbstractPauliSum)Get the Pauli integer type of a AbstractPauliSum object.
PauliPropagation.topaulistrings — Method
topaulistrings(psum::AbstractPauliSum)Returns the Pauli strings in a, AbstractPauliSum and their coefficients as a list of PauliString.