qml.labs.estimator_beta.estimate_wires_from_circuit

estimate_wires_from_circuit(circuit_as_lst, gate_set=None, config=None, zeroed=0, any_state=0)[source]

Determine the number of auxiliary qubits needed to decompose the operators of a quantum circuit into a specific gate_set with a given config.

Parameters:
  • circuit_as_lst (Iterable[ResourceOperator | Operator | MeasurementProcess | MarkQubits]) – A quantum circuit represented by a list of circuit elements (operators, measurements, etc.).

  • gate_set (set[str] | None) – A set of names (strings) of the fundamental operators to count throughout the quantum workflow. If not provided, the default gate set will be used, i.e., {'Toffoli', 'T', 'CNOT', 'X', 'Y', 'Z', 'S', 'Hadamard'}.

  • config (LabsResourceConfig | None) – configurations for the resource estimation pipeline

  • zeroed (int) – The number of additional auxiliary wires, prepared in the zero state, that can be used as part of the decomposition.

  • any_state (int) – The number of additional auxiliary wires, prepared in any state, that can be used as part of the decomposition.

Returns:

The number of qubits used as part of the decomposition. The first integer represents the number of qubits required to define the circuit (before decomposition). The remaining two integers represent the number of auxiliary qubits required as we decompose the circuit. They are separated according to their quantum state at the end of the workflow (any_state, zeroed).

Return type:

tuple(int, int, int)

Raises:

ValueError – if more qubits were deallocated than initially allocated