deltakit.explorer.codes.UnrotatedPlanarCode#
- class deltakit.explorer.codes.UnrotatedPlanarCode(width: int, height: int, schedule_type: ScheduleType = ScheduleType.SIMULTANEOUS, schedule_order: ScheduleOrder = ScheduleOrder.STANDARD, use_ancilla_qubits: bool = True, horizontal_stabiliser_with_top_left_is_z: bool = True, shift: Coord2DDelta = (0, 0))#
Bases:
PlanarCodeClass representing the unrotated planar code. By default, Z logical is vertical (i.e. Z boundaries are horizontal) and X logical is horizontal (i.e. X boundaries are vertical). See the graph below for the default 3x3 unrotated code.
This class also contains methods that help set up circuits for memory experiments.
4├ ○ ---- Z ---- ○ ---- Z ---- ○ │ | | | | | 3├ X ---- ○ ---- X ---- ○ ---- X │ | | | | | 2├ ○ ---- Z ---- ○ ---- Z ---- ○ │ | | | | | 1├ X ---- ○ ---- X ---- ○ ---- X │ | | | | | 0├ ○ ---- Z ---- ○ ---- Z ---- ○ │ └----┴------┴------┴------┴------┴ 0 1 2 3 4- Parameters:
width (int) – The maximum number of data qubits in a single row.
height (int) – The maximum number of data qubits in a single column.
schedule_type (ScheduleType, optional) – The type of syndrome extraction schedule to use. By default, ScheduleType.SIMULTANEOUS.
schedule_order (ScheduleOrder, optional) – The order of the syndrome extraction rounds, i.e, in which order to perform the consecutive entangling gates to measure the stabilier of a plaquette. By default, ScheduleOrder.STANDARD.
use_ancilla_qubits (bool, optional) – Whether or not to use ancilla qubits for the stabilisers. By default, True.
horizontal_stabiliser_with_top_left_is_z (bool, optional) – Whether the leftmost stabiliser in the top row is a Z stabiliser. By default, True.
shift (Coord2DDelta, optional) – A vector by which to shift all of the qubit coordinates, by adding it to each qubit coordinate. By default, the 0 vector: Coord2DDelta(0, 0).
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. |
|
Given a boolean specifying whether to modify X or Z logicals, and a Coord2DDelta, modify the relevant logical(s) by adding the Coord2DDelta to the coordinates of each qubit making up the logical. |
|
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. |