Quantum operators can be expressed as combinations of Pauli operators I, X, Y, Z:
>>> operator = sZ(0)*sZ(1) + sX(2)*sY(3) >>> print(operator) (1+0j)*Z0*Z1 + (1+0j)*X2*Y3
||A function that returns the sigma_X operator on a particular qubit.|
||A function that returns the sigma_Y operator on a particular qubit.|
||A function that returns the sigma_Z operator on a particular qubit.|
||A function that returns the identity operator, optionally on a particular qubit.|
||The identity operator.|
||The zero operator.|
Working with operators¶
||Simplify the sum of Pauli operators according to Pauli algebra rules.|
||Check if commuting a PauliTerm commutes with a list of other terms by natural calculation.|
||Gather the Pauli terms of pauli_terms variable into commuting sets|
||Tests to see if a PauliTerm or PauliSum is a scalar multiple of identity|
||Tests to see if a PauliTerm or PauliSum is zero.|
||Creates a pyQuil program that simulates the unitary evolution exp(-1j * term)|
||Returns a function f(alpha) that constructs the Program corresponding to exp(-1j*alpha*term).|
||Returns a function that maps all substituent PauliTerms and sums them into a program.|
||Generate trotterization coefficients for a given number of Trotter steps.|
||Create a Quil program that approximates exp( (A + B)t) where A and B are PauliTerm operators.|
A sum of one or more PauliTerms.
Parameters: terms (Sequence) – A Sequence of PauliTerms.
The support of all the operators in the PauliSum object.
Simplifies the sum of Pauli operators according to Pauli algebra rules.
Get a Pyquil Program corresponding to each term in the PauliSum and a coefficient for each program
PauliTerm(op, index, coefficient=1.0)¶
A term is a product of Pauli operators operating on different qubits.
Create a new Pauli Term with a Pauli operator at a particular index and a leading coefficient.
Returns an identifier string for the PauliTerm (ignoring the coefficient).
Return a frozenset of operations in this term.
Properly creates a new PauliTerm, with a completely new dictionary of operators
Allocates a Pauli Term from a list of operators and indices.
Return a string representation of this PauliTerm without its coefficient and with implicit qubit indices.