pytket.tableau

class pytket.tableau.UnitaryTableau

Stabilizer tableau for a unitary in the style of Aaronson&Gottesman “Improved Simulation of Stabilizer Circuits”: rows indicate the action at the output corresponding to either an X or a Z on a single input.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pytket.tableau.UnitaryTableau, nqb: int) -> None

Constructs a UnitaryTableau representing the identity operation over some number of qubits. Qubits will be indexed sequentially in the default register.

Parameters

nqb – The number of qubits in the unitary.

  1. __init__(self: pytket.tableau.UnitaryTableau, xx: numpy.ndarray[bool[m, n]], xz: numpy.ndarray[bool[m, n]], xph: numpy.ndarray[bool[m, 1]], zx: numpy.ndarray[bool[m, n]], zz: numpy.ndarray[bool[m, n]], zph: numpy.ndarray[bool[m, 1]]) -> None

Constructs a UnitaryTableau from the binary tables of its components.

Parameters
  • xx – The X component of the X rows.

  • xz – The Z component of the X rows.

  • xph – The phases of the X rows.

  • zx – The X component of the Z rows.

  • zz – The Z component of the Z rows.

  • zph – The phases of the Z rows.

apply_gate_at_end(self: pytket.tableau.UnitaryTableau, arg0: pytket.circuit.OpType, arg1: List[pytket.circuit.Qubit]) None

Update the tableau according to adding a Clifford gate after the current unitary, i.e. updates \(U\) to \(GU\) for a gate \(G\).

Parameters
  • type – The OpType of the gate to add. Must be an unparameterised Clifford gate type.

  • qbs – The qubits to apply the gate to. Length must match the arity of the given gate type.

apply_gate_at_front(self: pytket.tableau.UnitaryTableau, arg0: pytket.circuit.OpType, arg1: List[pytket.circuit.Qubit]) None

Update the tableau according to adding a Clifford gate before the current unitary, i.e. updates \(U\) to \(UG\) for a gate \(G\).

Parameters
  • type – The OpType of the gate to add. Must be an unparameterised Clifford gate type.

  • qbs – The qubits to apply the gate to. Length must match the arity of the given gate type.

get_row_product(self: pytket.tableau.UnitaryTableau, paulis: pytket.circuit.QubitPauliTensor) pytket.circuit.QubitPauliTensor

Combine rows to yield the effect of a given Pauli string.

Parameters

paulis – The Pauli string \(P\) to consider at the input.

Returns

The Pauli string \(Q\) such that \(QU=UP\).

get_xrow(self: pytket.tableau.UnitaryTableau, qb: pytket.circuit.Qubit) pytket.circuit.QubitPauliTensor

Read off an X row as a Pauli string.

Parameters

qb – The qubits whose X row to read off.

Returns

The Pauli string \(P\) such that \(PU=UX_{qb}\).

get_zrow(self: pytket.tableau.UnitaryTableau, qb: pytket.circuit.Qubit) pytket.circuit.QubitPauliTensor

Read off an Z row as a Pauli string.

Parameters

qb – The qubits whose Z row to read off.

Returns

The Pauli string \(P\) such that \(PU=UZ_{qb}\).

class pytket.tableau.UnitaryTableauBox

A Clifford unitary specified by its actions on Paulis.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pytket.tableau.UnitaryTableauBox, tab: pytket.tableau.UnitaryTableau) -> None

Construct from a given tableau.

Parameters

tab – The UnitaryTableau representing the desired unitary.

  1. __init__(self: pytket.tableau.UnitaryTableauBox, xx: numpy.ndarray[bool[m, n]], xz: numpy.ndarray[bool[m, n]], xph: numpy.ndarray[bool[m, 1]], zx: numpy.ndarray[bool[m, n]], zz: numpy.ndarray[bool[m, n]], zph: numpy.ndarray[bool[m, 1]]) -> None

Construct the tableau from the binary tables of its components.

Parameters
  • xx – The X component of the X rows.

  • xz – The Z component of the X rows.

  • xph – The phases of the X rows.

  • zx – The X component of the Z rows.

  • zz – The Z component of the Z rows.

  • zph – The phases of the Z rows.

get_circuit(self: pytket.tableau.UnitaryTableauBox) pytket.circuit.Circuit
Returns

The Circuit described by the box.

get_tableau(self: pytket.tableau.UnitaryTableauBox) pytket.tableau.UnitaryTableau
Returns

The tableau representing the unitary operation.