State Overlap
Base.filter!
— Methodfilter!(filterfunc::Function, psum::PauliSum)
Filter a PauliSum
in-place by removing all Pauli strings for which filterfunc(pstr, coeff)
returns false
.
Base.filter
— Methodfilter(filterfunc::Function, psum::PauliSum)
Return a filtered PauliSum
by removing all Pauli strings for which filterfunc(pstr, coeff)
returns false
.
PauliPropagation.overlapwithcomputational
— Methodoverlapwithcomputational(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...>
.
PauliPropagation.overlapwithmaxmixed
— Methodoverlapwithmaxmixed(psum::PauliSum)
Calculates the overlap of a PauliSum
with the maximally mixed state I/2^n, i.e., Tr[psum * I/2^n].
PauliPropagation.overlapwithpaulisum
— Methodoverlapwithpaulisum(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.
PauliPropagation.overlapwithplus
— Methodoverlapwithplus(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|+>.
PauliPropagation.overlapwithzero
— Methodoverlapwithzero(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>.
PauliPropagation.plusfilter!
— Methodzerofilter!(psum)
Filter a Pauli sum in-place with only Pauli strings that are not orthogonal to the plus state |+><+|.
PauliPropagation.plusfilter
— Methodplusfilter(psum)
Return a filtered Pauli sum with only Pauli strings that are not orthogonal to the plus state |+><+|.
PauliPropagation.scalarproduct
— Methodscalarproduct(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.
PauliPropagation.zerofilter!
— Methodzerofilter!(psum)
Filter a Pauli sum in-place with only Pauli strings that are not orthogonal to the zero state |0><0|.
PauliPropagation.zerofilter
— Methodzerofilter(psum)
Return a filtered Pauli sum with only Pauli strings that are not orthogonal to the zero state |0><0|.