PauliStringSum
Base class: Object
Object that represents a sum of Pauli strings.
Represents a sum of Pauli strings and a complex coefficients where each term in the sum is a PauliString.
Constructors
PauliStringSum(const PauliStringSum other) -> PauliStringSum
Constructs a PauliStringSum by cloning an existing sum.
Parameters
- other: The PauliStringSum to copy.
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
- term: The initial PauliString.
Returns
A new PauliStringSum containing the supplied term.
Members
| Name | Description |
|---|---|
| adjoint | Adjoints a PauliStringSum in place. |
| adjointed | Returns the adjoint of a PauliStringSum. |
| append | Appends another PauliStringSum. |
| commutator | Calculates the commutator of two PauliStringSums. |
| display | Displays terms from a PauliStringSum. |
| expval | Calculates the expectation value of a PauliStringSum. |
| multiplied | Returns a PauliStringSum right-multiplied by a PauliString. |
| multiply | Right-multiplies a PauliStringSum by a PauliString in place. |
| num_spins | Returns the number of spins represented by a PauliStringSum. |
| pauli_rotate | Conjugates in place by , producing . |
| pauli_rotated | Returns for . |
| prune | Removes terms below a coefficient tolerance or above a maximum weight. |
| size | Returns the number of terms in a PauliStringSum. |
| transform_coefficients | Transforms every coefficient in a PauliStringSum. |
| weight_distribution | Returns the weight distribution of a PauliStringSum. |