deltakit.explorer.codes.BivariateBicycleCode#
- class deltakit.explorer.codes.BivariateBicycleCode(param_l: int, param_m: int, m_A_powers: list[int], m_B_powers: list[int], validate: bool = True, check_logical_operators_are_independent: bool = False)#
Bases:
CSSCodeClass to represent the IBM Bivariate Bicycle qLDPC codes, as specified in arXiv:2308.07915. If validate=True, will check a series of conditions as the code is constructed to validate that the produced code is a valid BB code.
- Parameters:
param_l (int) – The parameter l, used to construct a code of length n = 2lm.
param_m (int) – The parameter m, used to construct a code of length n = 2lm.
m_A_powers (List[int]) – The powers of the polynomial terms used to construct the matrix A. Each polynomial is of the form x^a + y^b + y^c so the sequence should specify [a, b, c].
m_B_powers (List[int]) – The powers of the polynomial terms used to construct the matrix B. Each polynomial is of the form y^a + x^b + x^c so the sequence should specify [a, b, c].
validate (bool, Optional) – If True, will perform a series of check on the code’s parameters to ensure the constructed code is a valid BB code. By default, True.
check_logical_operators_are_independent (bool, optional) – Whether to check if logical X-Z operator pairs are independent. If True, then the commuting relations [X_k, Z_l] = 0 (k != l) are checked for the logical operators, ensuring that the logical operators correspond to separate logical qubits. If False, this check is ignored, in which case the logical operators can be dependent, e.g. instead of only accepting X_1, X_2 and Z_1, Z_2, the input X_1, X_1*X_2 and Z_1, Z_1*Z_2 is also accepted. Note this is forced to False if validate is False. By default, False.
- n#
The parameter n as in the [[n,k,d]] specification of an error-correcting code. E.g, number of physical qubits.
- Type:
int
- k#
The parameter n as in the [[n,k,d]] specification of an error-correcting code. E.g, number of logical qubits.
- Type:
int
- m_x#
A binary matrix representing the matrix x in the paper. Used to construct matrices A and B for constructing the parity check matrices.
- Type:
npt.NDArray[np.int_]
- m_y#
A binary matrix representing the matrix y in the paper. Used to construct matrices A and B for constructing the parity check matrices.
- Type:
npt.NDArray[np.int_]
- m_A_submatrices#
A length-3 tuple containing the submatrices A1, A2 and A3 of A. Used to calculate stabilisers.
- Type:
Tuple[npt.NDArray[np.int_], npt.NDArray[np.int_], npt.NDArray[np.int_]]
- m_B_submatrices#
A length-3 tuple containing the submatrices B1, B2 and B3 of B. Used to calculate stabilisers.
- Type:
Tuple[npt.NDArray[np.int_], npt.NDArray[np.int_], npt.NDArray[np.int_]]
- m_Hx#
Parity check matrix for X checks.
- Type:
npt.NDArray[np.int_]
- m_Hz#
Parity check matrix for Z checks.
- Type:
npt.NDArray[np.int_]
Methods#
Calculate the maximum number of logical qubits that are encoded into the code by subtracting the rank of Hx and Hz parity matrices from the number of (data) qubits. |
|
|
Check that the logical operators are independent. |
Set up the CSSStage which represents the encoding of a logical \(\ket{+}\dots\ket{+}\) |
|
Set up the CSSStage which represents the encoding of a logical \(\ket{0}\dots\ket{0}\). |
|
Return a CSSCode object with stabilisers that have no ancilla qubits. |
|
Set up the CSSStage which represents measuring the stabilisers for num_rounds rounds. |
|
Set up the CSSStage which represents measuring all logical X operators simultaneously. |
|
Set up the CSSStage which represents measuring all logical Z operators simultaneously. |
|
Method to allow for updating both X and Z logicals simultaneously. |
|
Compute whether an X-type stabiliser commutes with a Z-type stabiliser. |