Skip to content

Commit

Permalink
maybe fix t_cor
Browse files Browse the repository at this point in the history
  • Loading branch information
perlinm committed Dec 21, 2024
1 parent 9e85b20 commit 4d54957
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions python/quantum-pecos/src/pecos/qeclib/steane/steane_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,30 +364,31 @@ def t_cor(
Applies active corrections of errors diagnozed by the measurement for gate teleportation.
"""
warn("Using experimental feature: t_cor", stacklevel=2)
flag = flag or self.scratch.elems[7]
return Block(
block = Block(
# gate teleportation without logical correction
aux.prep_t_plus_state(reject=reject, rus_limit=rus_limit),
self.cx(aux),
aux.mz(self.t_meas),
# active error correction
self.syn_z.set(aux.syn_meas),
If(self.syn_z != 0).Then(flag.set(1)),
self.last_raw_syn_z.set(0),
self.pf_x.set(0),
FlagLookupQASMActiveCorrectionZ(
self.d,
self.syn_z,
self.syndromes,
self.syn_z,
self.last_raw_syn_z,
self.pf_x,
flag,
self.syn_z,
self.syn_z,
self.scratch,
),
# logical correction
If(self.t_meas == 1).Then(self.sz()),
)
if flag is not None:
block.extend(If(self.syn_z != 0).Then(flag.set(1)))
return block

def tdg_cor(
self,
Expand All @@ -401,30 +402,31 @@ def tdg_cor(
Applies active corrections of errors diagnozed by the measurement for gate teleportation.
"""
warn("Using experimental feature: t_cor", stacklevel=2)
flag = flag or self.scratch.elems[7]
return Block(
block = Block(
# gate teleportation without logical correction
aux.prep_tdg_plus_state(reject=reject, rus_limit=rus_limit),
self.cx(aux),
aux.mz(self.tdg_meas),
# active error correction
self.syn_z.set(aux.syn_meas),
If(self.syn_z != 0).Then(flag.set(1)),
self.last_raw_syn_z.set(0),
self.pf_x.set(0),
FlagLookupQASMActiveCorrectionZ(
self.d,
self.syn_z,
self.syndromes,
self.syn_z,
self.last_raw_syn_z,
self.pf_x,
flag,
self.syn_z,
self.syn_z,
self.scratch,
),
# logical correction
If(self.tdg_meas == 1).Then(self.szdg()),
)
if flag is not None:
block.extend(If(self.syn_z != 0).Then(flag.set(1)))
return block

# End Experimental: ------------------------------------

Expand Down

0 comments on commit 4d54957

Please sign in to comment.