RPNGDescription#
- class tqec.plaquette.RPNGDescription(corners, ancilla=RG(r=<PauliBasis.X: 'x'>, g=<PauliBasis.X: 'x'>))[source]#
Bases:
object
Organize the description of a plaquette in RPNG format
The corners of the square plaquette are listed following the order: top-left, top-right, bottom-left, bottom-right. This forms a Z-shaped path on the plaquette corners:
+------------+ | 1 -----> 2 | | / | | / | | ∟ | | 3 -----> 4 | +------------+
If the ancilla RG description is not specified, it is assumed ‘xx’
- corners#
one
RPNG
description for each of the four corners of the plaquette.
- ancilla#
RG
description of the syndrome qubit.
Methods
__init__
(corners[, ancilla])empty
()from_dict
(data)Return a RPNGDescription object from its dictionary representation.
from_extended_string
(...)Initialize the RPNGDescription object from a (16+3)-character string
from_string
(corners_rpng_string)Initialize the RPNGDescription object from a (16+3)-character string
get_g_op
(data_idx)Get the measurement operation or Hadamard for the specific data qubit
get_n
(data_idx)Get the time of the 2Q gate involving the specific data qubit
get_r_op
(data_idx)Get the reset operation or Hadamard for the specific data qubit
to_dict
()Return a dictionary representation of the RPNG description.
Attributes
Detailed methods
- __init__(corners, ancilla=RG(r=<PauliBasis.X: 'x'>, g=<PauliBasis.X: 'x'>))#
- static from_dict(data)[source]#
Return a RPNGDescription object from its dictionary representation.
- Parameters:
data (dict[str, Any]) – dictionary with the keys
corners
andancilla
.- Returns:
a new instance of
RPNGDescription
with the providedcorners
andancilla
.- Return type:
- classmethod from_extended_string(ancilla_and_corners_rpng_string)[source]#
Initialize the RPNGDescription object from a (16+3)-character string
- Parameters:
ancilla_and_corners_rpng_string (str)
- Return type:
- classmethod from_string(corners_rpng_string)[source]#
Initialize the RPNGDescription object from a (16+3)-character string
- Parameters:
corners_rpng_string (str)
- Return type:
- get_g_op(data_idx)[source]#
Get the measurement operation or Hadamard for the specific data qubit
- Parameters:
data_idx (int)
- Return type:
str | None
- get_n(data_idx)[source]#
Get the time of the 2Q gate involving the specific data qubit
- Parameters:
data_idx (int)
- Return type:
int | None