qat.core.Term

class qat.core.Term(coefficient, pauli_op, qbits, do_validity_check=True)

Class describing a term in the Pauli basis of an observable. It basically consists in a pair (coeffcient, pauli operator).

This class supports Thrift serialization and can be transmitted directly to the to_job method of a circuit object.

Term are constructed as follows:

from qat.core import Term

term = Term(1., # Coefficient of the term
            "XXY", # tensor of operators X, X, and Y
            [1, 4, 7]) # over qubits 1, 4, and 7
Parameters
  • coefficient (float) – the coefficient in front of the term

  • pauli_op (str) – the Pauli operator specified as a string containing I, X, Y, and Z characters.

  • qbits (list<int>) – the list of concerned qubits

  • check_validity (bool) – if True, checks that no qbit has more than one operator applied to it. default: True

coeff

the coefficient in front of the term

Type

float

op

the Pauli operator specified as a string containing I, X, Y, and Z characters.

Type

str

qbits

the list of concerned qubits

Type

list<int>