qc2.algorithms.qiskit.qpe ========================= .. py:module:: qc2.algorithms.qiskit.qpe .. autoapi-nested-parse:: Module defining the QPE algorithm for qiskit Classes ------- .. autoapisummary:: qc2.algorithms.qiskit.qpe.QC2PhaseEstimation qc2.algorithms.qiskit.qpe.QPE Module Contents --------------- .. py:class:: QC2PhaseEstimation(num_evaluation_qubits: int, sampler: qiskit.primitives.BaseSampler | None = None) Bases: :py:obj:`qiskit_algorithms.PhaseEstimation` Run the Quantum Phase Estimation (QPE) algorithm. Rewrote here to control the qubit ordering and harmonize with pennlyane implementation .. py:method:: construct_circuit(unitary: qiskit.QuantumCircuit, state_preparation: qiskit.QuantumCircuit | None = None, name: str = 'QPE') -> qiskit.QuantumCircuit 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. .. py:method:: _get_bitstring(length: int, number: int) -> str :staticmethod: .. py:method:: _add_measurement_if_required(pe_circuit) .. py:method:: estimate_from_pe_circuit(pe_circuit: qiskit.QuantumCircuit) -> qiskit_algorithms.PhaseEstimationResult Run the phase estimation algorithm on a phase estimation circuit :param pe_circuit: The phase estimation circuit. :returns: A phase estimation result. :raises AlgorithmError: Primitive job failed. .. py:class:: QPE(qc2data=None, num_evaluation_qubits=None, active_space=None, mapper=None, sampler=None, reference_state=None, verbose=0) Bases: :py:obj:`qc2.algorithms.qiskit.pebase.PEBase` .. py:attribute:: num_evaluation_qubits :value: 3 .. py:attribute:: solver