mqt.bench.benchmarks.iqpe¶
IQPE benchmark definition.
Module Contents¶
- create_circuit(num_qubits: int, exact: bool = True, rotation_threshold: float = 1e-15, seed: int = 10) QuantumCircuit[source]¶
Returns a quantum circuit implementing the Iterative Quantum Phase Estimation algorithm.
In contrast to the regular QPE algorithm, the @p num_qubits argument does not influence the final number of qubits of the circuit. The circuit will always use exactly two qubits, but num_qubits-1 iterations of the phase estimation loop. This way, transforming the IQPE benchmark circuit to a straight-line circuit (by replacing reset operations with new qubits and applying the deferred measurement principle) results in the equivalent QPE benchmark circuit configured with the same value for num_qubits. The name num_qubits is kept for consistency with the other benchmark generation functions.
- Parameters:
num_qubits – Controls the precision of the phase estimation algorithm. Must be at least 2.
exact – Whether to use a target phase that is exactly representable with the chosen precision.
rotation_threshold – Threshold for adding rotation gates in the feedback step. Rotation gates with smaller angles will be omitted to reduce circuit complexity.
seed – Seed for the random number generator.
- Returns:
QuantumCircuit – A quantum circuit implementing the Iterative Quantum Phase Estimation algorithm.