State Overlap

Base.filter!Method
filter!(filterfunc::Function, psum::PauliSum)

Filter a PauliSum in-place by removing all Pauli strings for which filterfunc(pstr, coeff) returns false.

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

Return a filtered PauliSum by removing all Pauli strings for which filterfunc(pstr, coeff) returns false.

source
PauliPropagation.overlapwithcomputationalMethod
overlapwithcomputational(psum::PauliSum, onebitinds::Vector{Integer})
overlapwithcomputational(pstr::PauliString, onebitinds::Vector{Integer})

Calculates the overlap of a Pauli sum or Pauli string with the computational basis state which has one-bits at all specified indices and zero-bits elsewhere. If |x><x| is a computational basis state, it we compute Tr[psum * |x><x|] = <x|psum|x> or Tr[pstr * |x><x|] = <x|pstr|x>. For example, overlapwithcomputational(psum, [1,2,4]) returns the overlap with |1101000...>.

source
PauliPropagation.overlapwithpaulisumMethod
overlapwithpaulisum(rho::PauliSum, psum::PauliSum)

Calculate the overlap of a Pauli sum psum and a quantum state rho represented in the Pauli basis via another PauliSum. This is equivalent to the trace Tr[rho * psum]. Calls scalarproduct(rho, psum) * (2^rho.nqubits) to calculate the overlap.

source
PauliPropagation.overlapwithplusMethod
overlapwithplus(psum::PauliSum) 
overlapwithplus(pstr::PauliString)

Calculates the overlap of a Pauli sum or Pauli string with the plus state |+><+|, i.e. Tr[psum * |+><+|] = <+|psum|+> or Tr[pstr * |+><+|] = <+|pstr|+>.

source
PauliPropagation.overlapwithzeroMethod
overlapwithzero(psum::PauliSum) 
overlapwithzero(pstr::PauliString)

Calculates the overlap of a Pauli sum with the zero state |0><0|, i.e., Tr[psum * |0><0|] = <0|psum|0> or Tr[pstr * |0><0|] = <0|pstr|0>.

source
PauliPropagation.scalarproductMethod
scalarproduct(pobj1::Union{PauliSum,PauliString}, pobj2::Union{PauliSum,PauliString})

Calculates the scalar product between any combination of PauliSum and PauliString. This calculates the sum of the products of their coefficients for all Pauli strings that are present . Important: This is not equivalent to the trace Tr[psum1 * psum2] but instead Tr[psum1 * psum2]/2^n, and equivalently for Pauli strings.

source