RPNG#
- class tqec.plaquette.RPNG(r, p, n, g)[source]#
Bases:
object
Represents a single
RPNG
string.## Format specification
The
RPNG
string is a standard format used intqec
to unambiguously describe the action(s) being performed on a single data qubit. It is a 4-character string. See each attribute docstring for more details on the possible values for each character.## Example
The following
-z1- rpng
represents a data-qubit with a
CZ
gate applied at timestep1
.- Parameters:
r (ExtendedBasis | None)
p (PauliBasis | None)
n (int | None)
g (ExtendedBasis | None)
- r#
reset basis (
x
,y
orz
),h
or-
.- Type:
tqec.plaquette.rpng.rpng.ExtendedBasis | None
- p#
controlled operation target basis (
x
meansCNOT
controlled on the ancilla and targeting the data qubit,y
meansCY
,z
meansCZ
).- Type:
tqec.plaquette.rpng.rpng.PauliBasis | None
- n#
time step at which the 2-qubit operation described by
p
should be applied. Should be a 1-digit positive integer, typically in[1, 5]
.- Type:
int | None
- g#
measure basis (
x
,y
orz
),h
or-
.- Type:
tqec.plaquette.rpng.rpng.ExtendedBasis | None
Methods
__init__
(r, p, n, g)from_string
(rpng_string)Initialize the RPNG object from a 4-character string
get_g_op
()Get the measurement operation or Hadamard
get_r_op
()Get the reset operation or Hadamard
Attributes
Detailed methods
- __init__(r, p, n, g)#
- Parameters:
r (ExtendedBasis | None)
p (PauliBasis | None)
n (int | None)
g (ExtendedBasis | None)
- Return type:
None