surface_sim.detectors.get_new_stab_dict_from_layout#

get_new_stab_dict_from_layout(layout, log_gate)[source]#

Returns a dictionary that describes the stabilizer generator transformation due to the given logical gate.

For example, the output {"X1": ["X1", "Z1"]} is interpreted as that the logical gate has transformed X1 to X1*Z1.

Parameters:
layout

Layout that has information about the log_gate.

log_gate

Name of the logical gate.

Returns:
new_stab_gens

Dictionary that maps ancilla qubits (representing the new stabilizer generators) to a list of ancilla qubits (representing the old stabilizer generators). If the dictionary is missing ancillas, their stabilizer generators are assumed to not be transformed by the logical gate.

new_stab_gens_inv

Same as new_stab_gens but for the gate inverse.