surface_sim.detectors.Detectors.update#

detectors.Detectors.update(new_stab_gens, new_stab_gens_inv)#

Update the current stabilizer generators with the dictionary descriving the effect of the logical gate. It allows to perform more than one logical gate between QEC rounds.

See module surface_sim.log_gates to see how to prepare the layout to run logical gates.

Note that it does not really update the stabilizer generators but it stores the change. They are only updated when calling build_from_anc and build_from_data functions due to the "post-gate" frame. This behavior is due to the "post-gate" frame.

Parameters:
new_stab_gens

Dictionary that maps ancilla qubits (representing the stabilizer generators) to a list of ancilla qubits (representing the decomposition of propagated stabilizer generators through the logical gate in terms of the stabilizer generators). If the dictionary is missing ancillas, their stabilizer generators are assumed to not be transformed by the logical gate. See get_new_stab_dict_from_layout for more information. For example, {"X1": ["X1", "Z1"]} is interpreted as that the logical gate has transformed X1 to X1*Z1.

new_stab_gens_inv:

Same as new_stab_gens for the logical gate inverse.

Notes

The new_stab_gens dictionary (or equivalently matrix) can be calculated by

\[S'_i = U_L^\dagger S_i U_L\]

with \(U_L\) the logical gate and \(S_i\) (\(S'_i\)) the stabilizer generator \(i\) before (after) the logical gate. From this reference.

The new_stab_gens_inv dictionary can be calculated by

\[S'_i = U_L S_i U_L^\dagger\]