Skip to main content

PauliStringSum

Base class: Object

Object that represents a sum of Pauli strings.

Represents a sum ncnPn\sum_n c_n P_n of Pauli strings PnP_n and a complex coefficients cnc_n where each term in the sum is a PauliString.

Constructors

PauliStringSum(const PauliStringSum other) -> PauliStringSum

Constructs a PauliStringSum by cloning an existing sum.

Parameters

Returns

A new copy of the PauliStringSum.

PauliStringSum(integer num_spins) -> PauliStringSum

Constructs an empty PauliStringSum.

Parameters

  • num_spins: The number of spins in the system, from 1 through 256.

Returns

An empty PauliStringSum for the requested system size.

PauliStringSum(const PauliString term) -> PauliStringSum

Constructs a PauliStringSum from one PauliString.

Parameters

Returns

A new PauliStringSum containing the supplied term.

Members

NameDescription
adjointAdjoints a PauliStringSum in place.
adjointedReturns the adjoint of a PauliStringSum.
appendAppends another PauliStringSum.
commutatorCalculates the commutator of two PauliStringSums.
displayDisplays terms from a PauliStringSum.
expvalCalculates the expectation value of a PauliStringSum.
multipliedReturns a PauliStringSum right-multiplied by a PauliString.
multiplyRight-multiplies a PauliStringSum by a PauliString in place.
num_spinsReturns the number of spins represented by a PauliStringSum.
pauli_rotateConjugates SS in place by U=eiθQU=e^{i\theta Q}, producing USUU^\dagger S U.‌
pauli_rotatedReturns USUU^\dagger S U for U=eiθQU=e^{i\theta Q}.‌
pruneRemoves terms below a coefficient tolerance or above a maximum weight.
sizeReturns the number of terms in a PauliStringSum.
transform_coefficientsTransforms every coefficient in a PauliStringSum.
weight_distributionReturns the weight distribution of a PauliStringSum.