iqm.benchmarks.utils.reduce_to_active_qubits

iqm.benchmarks.utils.reduce_to_active_qubits#

iqm.benchmarks.utils.reduce_to_active_qubits(circuit: IQMCircuit, backend_name: str | None = None) IQMCircuit#

Reduces a quantum circuit to only its active qubits.

Parameters:
  • backend_name (Optional[str]) – The backend name, if any, in which the circuits are defined.

  • circuit (QuantumCircuit) – The original quantum circuit.

Returns:

A new quantum circuit containing only active qubits.

Return type:

QuantumCircuit