loom.eka.utilities.tableau

Copyright 2024 Entropica Labs Pte Ltd

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

loom.eka.utilities.tableau.is_tableau_valid(tableau)[source]

Checks if a tableau is valid. This is done by checking if it generates the pauli group and whether the correct commutation relations hold.

For the commutation relations, the tableau is split into two sets of stabilizers of equal size calling them S (stabilizers) and D (destabilizers). The following is then checked:

  • All stabilizers of S commute with each other and all stabilizers of D

    commute with each other.

  • Stabilizer i from list S has to anti-commute with stabilizer j from list

    D if i=j. If i != j, they have to commute.

Parameters:

tableau (np.ndarray) – The tableau to be checked.

Returns:

Whether the tableau is valid.

Return type:

bool

loom.eka.utilities.tableau.tableau_generates_pauli_group(tableau)[source]

Given a tableau, check if all of its operators, (stabilizers & destabilizers) can generate the pauli group. This is done by checking if the tableau is equivalent to the identity matrix after performing gaussian elimination.

Parameters:

tableau (np.ndarray) – The tableau to be checked.

Returns:

Whether the tableau generates the Pauli group.

Return type:

bool