hal.codes.generalized_toric_codes¶
GeneralizedToricCode ¶
GeneralizedToricCode(
orders, poly_a, poly_b, field=None, lattice_vectors=None
)
Bases: CSSCode
Generalized toric codes on twisted tori for quantum error correction.
Construct a generalized toric code on twisted torus.
_build_custom_matrices ¶
_build_custom_matrices(orders_seq, poly_a, poly_b, field)
Build custom parity check matrices for twisted torus.
_extract_term_info ¶
_extract_term_info(term, x, y)
Extract coefficient and exponents from a single term.
_find_independent_rows ¶
_find_independent_rows(matrix)
Find linearly independent rows using row reduction.
_get_qubit_index ¶
_get_qubit_index(
base_row,
base_col,
shift_x,
shift_y,
edge_type,
alpha,
beta,
gamma,
)
Get qubit index with twisted boundary conditions.
_qubit_index_twisted ¶
_qubit_index_twisted(
row, col, edge_type, alpha, beta, gamma
)
Get qubit index for edge at (row, col) on twisted torus.
_remove_redundant_from_matrices ¶
_remove_redundant_from_matrices(Hx, Hz, field)
Remove redundant stabilizers.
from_paper_parameters
classmethod
¶
from_paper_parameters(
a, b, c, d, lattice_vectors, field=None
)
Construct GeneralizedToricCode from paper's (a,b,c,d)-generalized toric code parameters.
Creates polynomials: f(x,y) = 1 + x + x^a * y^b g(x,y) = 1 + y + x^c * y^d
Args: a, b, c, d: Exponents for generalized toric code lattice_vectors: ((0, α), (β, γ)) defining the twisted torus field: Base field
has_redundant_stabilizers ¶
has_redundant_stabilizers()
Check if the code has any redundant stabilizers.
num_redundant_stabilizers ¶
num_redundant_stabilizers()
Get the number of redundant X and Z stabilizers.