qc2.algorithms.qiskit.qpe

Module defining the QPE algorithm for qiskit

Classes

QC2PhaseEstimation

Run the Quantum Phase Estimation (QPE) algorithm.

QPE

Module Contents

class qc2.algorithms.qiskit.qpe.QC2PhaseEstimation(num_evaluation_qubits: int, sampler: qiskit.primitives.BaseSampler | None = None)[source]

Bases: qiskit_algorithms.PhaseEstimation

Run the 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 | None = None, name: str = 'QPE') qiskit.QuantumCircuit[source]

Return the circuit to be executed to estimate phases.

This circuit includes as sub-circuits the core phase estimation circuit, with the addition of the state-preparation circuit and possibly measurement instructions.

static _get_bitstring(length: int, number: int) str[source]
_add_measurement_if_required(pe_circuit)[source]
estimate_from_pe_circuit(pe_circuit: qiskit.QuantumCircuit) qiskit_algorithms.PhaseEstimationResult[source]

Run the phase estimation algorithm on a phase estimation circuit

Parameters:

pe_circuit – The phase estimation circuit.

Returns:

A phase estimation result.

Raises:

AlgorithmError – Primitive job failed.

class qc2.algorithms.qiskit.qpe.QPE(qc2data=None, num_evaluation_qubits=None, active_space=None, mapper=None, sampler=None, reference_state=None, verbose=0)[source]

Bases: qc2.algorithms.qiskit.pebase.PEBase

num_evaluation_qubits = 3[source]
solver[source]