qc2.algorithms.qiskit.iqpe

Module defining the QPE algorithm for qiskit

Classes

QC2IterativePhaseEstimation

Run the Iterative quantum phase estimation (QPE) algorithm.

IQPE

Module Contents

class qc2.algorithms.qiskit.iqpe.QC2IterativePhaseEstimation(num_iterations: int, sampler: qiskit.primitives.BaseSampler | None = None)[source]

Bases: qiskit_algorithms.IterativePhaseEstimation

Run the Iterative quantum phase estimation (QPE) algorithm.

Rewrote here to control the qubit ordering and harmonize with pennlyane implementation

construct_circuit(unitary: qiskit.QuantumCircuit, state_preparation: qiskit.QuantumCircuit, k: int, omega: float = 0.0, measurement: bool = False) qiskit.QuantumCircuit[source]

Construct the kth iteration Quantum Phase Estimation circuit.

For details of parameters, see Fig. 2 in https://arxiv.org/pdf/quant-ph/0610214.pdf.

Parameters:
  • unitary – The circuit representing the unitary operator whose eigenvalue (via phase) will be measured.

  • state_preparation – The circuit that prepares the state whose eigenphase will be measured. If this parameter is omitted, no preparation circuit will be run and input state will be the all-zero state in the computational basis.

  • k – the iteration idx.

  • omega – the feedback angle.

  • measurement – Boolean flag to indicate if measurement should be included in the circuit.

Returns:

the quantum circuit per iteration

Return type:

QuantumCircuit

class qc2.algorithms.qiskit.iqpe.IQPE(qc2data=None, num_iterations=None, active_space=None, mapper=None, sampler=None, reference_state=None, verbose=0)[source]

Bases: qc2.algorithms.qiskit.pebase.PEBase

num_iterations = 3[source]
solver[source]