fastdla.PauliProduct

class fastdla.PauliProduct(index, num_qubits=None)

A tensor product of Pauli operators.

A Pauli product can be specified in either of the following formats:

  • A Pauli string (arbitrary-length string of ‘I’, ‘X’, ‘Y’ and ‘Z’)

  • An array of Pauli indices (I=0, X=1, Y=2, or Z=3)

  • An compact index corresponding to sum(p * (4 ** n) for n, p in enumerate(paulis)).

Note that the rightmost character corresponds to qubit 0 in the string format. The index format requires a specification of the total number of qubits in addition.

Parameters:
  • index (str | int | Sequence[int]) – Input Pauli string in either of the above three formats.

  • num_qubits (Optional[int]) – Number of qubits required when index is given as an integer.

Methods

indices()

Return the list of Pauli indices.

matmul(index1, coeff1, index2, coeff2, ...)

Matrix product of two Pauli products.

seq_to_idx(arr)

Convert an index array to a compact index.

str_to_idx(pstr)

Convert a Pauli string to a compact index.

to_matrix(*[, sparse, npmod])

Compose a matrix represented by the Pauli product.

Attributes

shape

Shape of the Pauli tensor.

vlen

Length of the Pauli vector.