Manuscript En02-E@2 · En02-E-v2.tex · section · c2769986

Unexecuted reproducibility supplement

Unexecuted reproducibility supplement · lines 2019–2097

Back to manuscript

def binary_decoder(ops,dk): B = np.zeros((64,27),complex) for j,d in enumerate(dk): codeword = [0 if z==0 else z+1 for z in d] idx = 0 for z in codeword: idx = 4*idx+z B[idx,j] = 1 out = [[email protected]().T for A in ops] valid = set(np.where(np.sum(np.abs(B),axis=1)>0)[0]) for j in range(64): if j not in valid: for bit in range(2): out.append(I[:,bit:bit+1]@np.eye(64)[j:j+1,:]/np.sqrt(2)) return out,B

def apply_ops(ops,A): return sum(K@[email protected]().T for K in ops)

def ledger(programme,labels,outcomes,coin): """All label histories; quantum slots and physically separate events.""" live,peak,events = 0,0,[] failed,held = False,False def event(action,change=0,**detail): nonlocal live,peak live += change need(live>=0,"negative ledger occupancy") peak = max(peak,live) events.append("action":action,"live":live,**detail) def consume(action,**detail): event(action,-1,**detail) for j,label in enumerate(labels): event("atomic_arrival",2,packet=j) event("label_readout_and_consumption",-1,packet=j,label=label) if label==0: failed = True if failed: if held: consume("retained_rail_destructive_discard",outcomes="both") held = False consume("incoming_rail_or_dummy_destructive_discard",outcomes="both") continue if programme=="even_full" and j==0: held = True event("retain_first_rail") elif programme=="even_full" and j==1: event("early_joint_unitary",gates=["H2","CX1to2","Sdag1","H1"]) consume("early_rail_destructive_readout",rail=1,outcome=outcomes[0]) consume("early_rail_destructive_readout",rail=2,outcome=outcomes[1]) event("classical_outcome_retention",bits=list(outcomes[:2])) held = False elif j<2 or programme=="even_low": gates = [] if programme=="even_low" and j!=1 else \ ["H"] if programme=="even_low" or j==1 else ["Sdag","H"] event("rail_basis_rotation",packet=j,gates=gates) consume("early_destructive_rail_readout", packet=j,outcome=outcomes[j]) event("classical_outcome_retention",bit=outcomes[j]) else: event("final_basis_rotation",gates=["Sdag","H"]) event("final_classical_Pauli_correction", x=1-outcomes[0],z=1-outcomes[1]) event("final_direct_return",-1) if failed: event("allocate_random_bit_slot",1) event("random_bit_H") consume("random_bit_destructive_readout",outcome=coin) event("classical_random_bit_retention",bit=coin) event("reallocate_output_zero",1) event("conditional_X_for_I_over_2",bit=coin) event("failure_state_final_return",-1) elif programme=="even_low": sign = -(-1)**sum(outcomes) event("allocate_output_zero",1) event("conditional_X_for_logical_eigenstate",bit=int(sign<0)) event("output_H") event("pre

Nearby in this section