tqec.circuit.qubit.count_qubit_accesses#
- count_qubit_accesses(circuit: Circuit) dict[int, int] [source]#
Count the number of times a given qubit is used by an instruction that is not an annotation.
Note
If a REPEAT instruction is found, each qubit access within the repeated block will be multiplied by the number of time the block is repeated.
- Parameters:
circuit – circuit containing the gates.
- Returns:
a mapping from qubit indices (as keys) to the number of non-annotation instructions that have this qubit index as target (as values).