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 PauliString term) -> PauliStringSum​

Constructs a PauliStringSum from one PauliString.

Parameters​

Returns​

A new PauliStringSum containing the supplied term.

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 PauliStringSum other) -> PauliStringSum​

Constructs a PauliStringSum by cloning an existing sum.

Parameters​

Returns​

A new copy of the PauliStringSum.

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 the product of two PauliStringSums.
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 U†SUU^\dagger S U.‌
pauli_rotatedReturns U†SUU^\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.