CostEvaluator#
Module: iqm.qubit_selector.qubit_selector
- class iqm.qubit_selector.qubit_selector.CostEvaluator(backend, quantum_circuit, cost_function=CostFunction.GATE_COST_CZ, readoutmode=ReadoutMode.NONE, remove_qubits=None, num_trials=2000, layouts=None)#
Bases:
objectEvaluates cost functions for quantum circuit layouts.
This class is responsible for computing the costs associated with different layouts of quantum circuits based on specified cost functions. It utilizes calibration data and backend information to assess the fidelity of quantum operations and idle times, allowing for the optimization of quantum circuit layouts.
- Parameters:
backend (IQMBackendBase) – The IQM backend instance.
quantum_circuit (QuantumCircuit) – The quantum circuit to be managed.
cost_function (CostFunction) – The cost function to be used for optimization.
readoutmode (ReadoutMode) – The readoutmode to use for including readout errors in the cost calculation.
weights – Weights for calibration types.
remove_qubits (list[int] | None) – List of qubit indices (in qiskit) to remove from consideration.
num_trials (int) – The number of trial instances for layout generation.
additional_qubits – Number of additional qubits to consider.
layouts (list[list[int]] | None) – Predefined layouts to evaluate.
- Raises:
Exception – If there is an error during the transpilation process.
Methods
Compute the costs associated with different circuit layouts based on the specified cost function.
- get_top_layouts(num_layouts=1)#
Compute the costs associated with different circuit layouts based on the specified cost function.
Inheritance
