mqt.qecc.circuit_synthesis.operations¶
Tableau operations used during elimination.
Classes¶
Represents an operation performed during tableau elimination. |
|
Class representing a transvection operation on a stabilizer tableau. |
|
Class representing a single-qubit Clifford operation on a stabilizer tableau. |
|
Class representing a Pauli operation on a stabilizer tableau. |
|
Class representing a CNOT operation on a stabilizer tableau. |
|
Class representing a SWAP operation on a stabilizer tableau. |
Module Contents¶
- class TableauOperation[source]¶
Bases:
abc.ABCRepresents an operation performed during tableau elimination.
- apply(tableau: mqt.qecc.circuit_synthesis.types.BinaryMatrix, inplace: bool = False) mqt.qecc.circuit_synthesis.types.BinaryMatrix[source]¶
Apply the operation to the given stabilizer tableau.
- Parameters:
tableau – The stabilizer tableau to apply the operation to.
inplace – If True, modifies the tableau in place. If False, returns a new tableau.
- abstractmethod append_to_circuit(circuit: stim.Circuit) None[source]¶
Append the operation to a Stim circuit.
- Parameters:
circuit – The Stim circuit to append the operation to.
- to_stim_circuit() stim.Circuit[source]¶
Convert the operation to a Stim circuit representation.
- Returns:
The Stim circuit representing the operation.
- Return type:
stim.Circuit
- abstractmethod apply_stabilizer_tableau(tableau: PauliTableau, inplace: bool = False) PauliTableau[source]¶
Apply the operation to a stabilizer tableau.
- Parameters:
tableau – The stabilizer tableau to apply the operation to.
inplace – If True, modifies the tableau in place. If False, returns a new tableau.
- Returns:
The resulting stabilizer tableau after applying the operation.
- Return type:
- abstractmethod apply_check_matrix(check_matrix: CheckMatrix, inplace: bool = False) CheckMatrix[source]¶
Apply the operation to a CSS check matrix.
- Parameters:
check_matrix – The CSS check matrix to apply the operation to.
inplace – If True, modifies the check matrix in place. If False, returns a new check matrix.
- Returns:
The resulting CSS check matrix after applying the operation.
- Return type:
- class Transvection(v: TV2, i: int, j: int)[source]¶
Bases:
TableauOperationClass representing a transvection operation on a stabilizer tableau.
- apply_stabilizer_tableau_inplace(tableau: PauliTableau) None[source]¶
Apply the transvection operation to a stabilizer tableau.
- apply_stabilizer_tableau(tableau: PauliTableau, inplace: bool = False) PauliTableau[source]¶
Apply the transvection operation to a stabilizer tableau.
- apply_check_matrix(check_matrix: CheckMatrix, inplace: bool = False) CheckMatrix[source]¶
Apply the transvection operation to a CSS check matrix.
- Parameters:
check_matrix – The CSS check matrix to apply the operation to.
inplace – If True, modifies the check matrix in place. If False, returns a new check matrix.
- Returns:
The resulting CSS check matrix after applying the operation.
- Return type:
- static all_two_qubit_transvections() list[TV2][source]¶
Get all 9 possible two-qubit transvections.
The 9 distinct 2-qubit transvections √(P_i P_j) (P∈{X,Y,Z} non-trivial) correspond to choosing (x,z) in {(1,0),(0,1),(1,1)} for each of the two qubits.
- Returns:
List of all 9 transvection vectors as tuples (xi, xj, zi, zj).
- class SingleQubitClifford(qubit: int, clifford: str)[source]¶
Bases:
TableauOperationClass representing a single-qubit Clifford operation on a stabilizer tableau.
- apply_stabilizer_tableau(tableau: PauliTableau, inplace: bool = False) PauliTableau[source]¶
Apply the single-qubit Clifford operation to a stabilizer tableau.
- Parameters:
tableau – The stabilizer tableau to apply the operation to.
inplace – If True, modifies the tableau in place. If False, returns a new tableau.
- Returns:
The resulting stabilizer tableau after applying the operation.
- Return type:
- apply_check_matrix(check_matrix: CheckMatrix, inplace: bool = False) CheckMatrix[source]¶
Apply the single-qubit Clifford operation to a CSS check matrix.
- Parameters:
check_matrix – The CSS check matrix to apply the operation to.
inplace – If True, modifies the check matrix in place. If False, returns a new check matrix.
- Returns:
The resulting CSS check matrix after applying the operation.
- Return type:
- apply_inverse(tableau: mqt.qecc.circuit_synthesis.types.BinaryMatrix, inplace: bool = False) mqt.qecc.circuit_synthesis.types.BinaryMatrix[source]¶
Apply the inverse of the single-qubit Clifford operation to the given stabilizer tableau.
- Parameters:
tableau – The stabilizer tableau to apply the operation to.
inplace – Whether to modify the tableau in place.
- Returns:
The resulting stabilizer tableau after applying the inverse operation.
- Return type:
BinaryMatrix
- inverse() SingleQubitClifford[source]¶
Get the inverse of the single-qubit Clifford operation.
- Returns:
The inverse single-qubit Clifford operation.
- Return type:
- static available_cliffords() list[str][source]¶
Get the list of available single-qubit Clifford operations.
- Returns:
H, S, SDAG, HS, SH, HSH, SDAGH, HSDAG, HSDAGH, I.
- Return type:
List of Clifford operation names
- append_to_circuit(circuit: stim.Circuit) None[source]¶
Append the operation to a Stim circuit.
- Parameters:
circuit – The Stim circuit to append the operation to.
- static from_symplectic_block(block: numpy.typing.NDArray[numpy.int8], qubit: int) SingleQubitClifford[source]¶
Create a SingleQubitClifford from a symplectic block.
- Parameters:
block – A 2x2 symplectic block representing the single-qubit Clifford operation.
qubit – The index of the qubit.
- Returns:
A single-qubit Clifford operation.
- class PauliOperation(qubit: int, pauli: str)[source]¶
Bases:
TableauOperationClass representing a Pauli operation on a stabilizer tableau.
- apply_check_matrix(check_matrix: CheckMatrix, inplace: bool = False) CheckMatrix[source]¶
Apply the Pauli operation to a CSS check matrix.
- Parameters:
check_matrix – The CSS check matrix to apply the operation to.
inplace – If True, modifies the check matrix in place. If False, returns a new check matrix.
- Returns:
The resulting CSS check matrix after applying the operation.
- Return type:
- apply_stabilizer_tableau(tableau: PauliTableau, inplace: bool = False) PauliTableau[source]¶
Apply the Pauli operation to a stabilizer tableau.
- Parameters:
tableau – The stabilizer tableau to apply the operation to.
inplace – If True, modifies the tableau in place. If False, returns a new tableau.
- Returns:
The resulting stabilizer tableau after applying the operation.
- Return type:
- class CNOT(control: int, target: int)[source]¶
Bases:
TableauOperationClass representing a CNOT operation on a stabilizer tableau.
- apply(tableau: mqt.qecc.circuit_synthesis.types.BinaryMatrix, inplace: bool = False) mqt.qecc.circuit_synthesis.types.BinaryMatrix[source]¶
Apply the CNOT operation to the given stabilizer tableau.
- Parameters:
tableau – The stabilizer tableau to apply the operation to.
inplace – If True, modifies the tablau in place. If False, returns a new tableau.
- apply_stabilizer_tableau(tableau: PauliTableau, inplace: bool = False) PauliTableau[source]¶
Apply the CNOT operation to a stabilizer tableau.
- Parameters:
tableau – The stabilizer tableau to apply the operation to.
inplace – If True, modifies the tableau in place. If False, returns a new tableau.
- Returns:
The resulting stabilizer tableau after applying the operation.
- Return type:
- apply_check_matrix(check_matrix: CheckMatrix, inplace: bool = False) CheckMatrix[source]¶
Apply the operation to a CSS check matrix.
- Parameters:
check_matrix – The CSS check matrix to apply the operation to.
inplace – If True, modifies the check matrix in place. If False, returns a new check matrix.
- Returns:
The resulting CSS check matrix after applying the operation.
- class Swap(qubit_a: int, qubit_b: int)[source]¶
Bases:
TableauOperationClass representing a SWAP operation on a stabilizer tableau.
- apply(tableau: mqt.qecc.circuit_synthesis.types.BinaryMatrix, inplace: bool = False) mqt.qecc.circuit_synthesis.types.BinaryMatrix[source]¶
Apply the SWAP operation to the given stabilizer tableau.
- Parameters:
tableau – The stabilizer tableau to apply the operation to.
inplace – If True, modifies the tableau in place. If False, returns a new tableau.
- apply_stabilizer_tableau(tableau: PauliTableau, inplace: bool = False) PauliTableau[source]¶
Apply the SWAP operation to a stabilizer tableau.
- Parameters:
tableau – The stabilizer tableau to apply the operation to.
inplace – If True, modifies the tableau in place. If False, returns a new tableau.
- Returns:
The resulting stabilizer tableau after applying the operation.
- Return type:
- apply_check_matrix(check_matrix: CheckMatrix, inplace: bool = False) CheckMatrix[source]¶
Apply the operation to a CSS check matrix.
- Parameters:
check_matrix – The CSS check matrix to apply the operation to.
inplace – If True, modifies the check matrix in place. If False, returns a new check matrix.