tqec.circuit.qubit_map.get_qubit_map#

get_qubit_map(circuit: Circuit) QubitMap[source]#

Returns the existing qubits and their coordinates at the end of the provided circuit.

Warning

This function, just like [stim.Circuit.get_final_qubit_coordinates](quantumlib/Stim), returns the qubit coordinates at the end of the provided circuit.

Parameters:

circuit – instance to get qubit coordinates from.

Raises:

TQECException – if any of the final qubits is not defined with exactly 2 coordinates (we only consider qubits on a 2-dimensional grid).

Returns:

a mapping from qubit indices (keys) to qubit coordinates (values).