Data types

PauliString

PauliPropagation.PauliStringType
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.

source
PauliPropagation.PauliStringType
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.

source

PauliSum

PauliPropagation.PauliSumType
PauliSum(nqubits::Int, terms::Dict) <: AbstractPauliSum

PauliSum 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.

source
PauliPropagation.PauliSumMethod
PauliSum(CoeffType, nq::Int)

Contructor for an empty PauliSum on nqubits qubits. The type of the coefficients can be provided.

source

VectorPauliSum

PauliPropagation.VectorPauliSumType
VectorPauliSum{TV,CV} <: AbstractPauliSum

VectorPauliSum 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.

source
PauliPropagation.VectorPauliSumMethod
VectorPauliSum(::Type{CT}, nqubits::Int)

Contructor for an empty VectorPauliSum on nqubits qubits. The type of the coefficients can be provided.

source

Conversions

AbstractPauliSum

Base.:+Method
+(pstr1::PauliString, pstr2::PauliString)

Addition of two PauliStrings. Returns a PauliSum.

source
Base.:+Method
+(pstr::PauliString, psum::AbstractPauliSum)
+(psum::AbstractPauliSum, pstr::PauliString)

Addition of a PauliString to a PauliSum. Returns a PauliSum.

source
Base.:-Method
-(pstr::PauliString, psum::AbstractPauliSum)
-(psum::AbstractPauliSum, pstr::PauliString)

Subtract a PauliString from a PauliSum or vice versa. Returns a PauliSum.

source
Base.:-Method
-(pstr1::PauliString, pstr2::PauliString)

Subtract two PauliStrings. Returns a PauliSum.

source
Base.filterMethod
filter!(filterfunc::Function, psum::AbstractPauliSum)

Filter a AbstractPauliSum by copying and removing all Pauli strings for which filterfunc(pstr, coeff) returns false.

source
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.

source
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).

source
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.

source
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.

source
PauliPropagation.PropagationBase.getcoeffMethod
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.

source
PauliPropagation.PropagationBase.getcoeffMethod
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.

source
PauliPropagation.PropagationBase.getcoeffMethod
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.

source
PauliPropagation.PropagationBase.getcoeffMethod
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.

source
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).

source
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.

source
PauliPropagation.paulisMethod
paulis(psum::AbstractPauliSum)

Returns an iterator over the integer pauli strings of an AbstractPauliSum. Call topaulistrings to receive entries as PauliStrings.

source