qrmfold.logical_qubit_orderings module¶
Pre-defined 1-to-1 maps from logical qubit index to a subset of [m] of cardinality m/2.
Available orderings: - lexicographic - canonical
- qrmfold.logical_qubit_orderings.lexicographic(num_variables: int, start_index: int = 0)[source]¶
Return the lexicographic logical qubit ordering.
- Parameters:
num_variables – The number m of variables of the underlying classical Reed-Muller code; must be even.
start_index – Starting logical index.
- Returns ordering:
A map from logical qubit index to a unique subset of [m] of cardinality m/2.
- qrmfold.logical_qubit_orderings.canonical(num_variables: int, start_index: int = 0)[source]¶
Return the canonical logical qubit ordering.
The first half of the logical qubits indices is lexicographically ordered. The second half is the complement of the first half.
- Parameters:
num_variables – The number m of variables of the underlying classical Reed-Muller code; must be even.
start_index – Starting logical index.
- Returns ordering:
A map from logical qubit index to a unique subset of [m] of cardinality m/2.