Quantum Phase Estimation (QPE) algorithm implementation.
The Quantum Phase Estimation algorithm is a fundamental quantum algorithm that estimates the eigenvalue of a unitary operator. Given a unitary operator U and one of its eigenstates |ψ⟩ such that U|ψ⟩ = e^(iφ)|ψ⟩, QPE estimates the phase φ.
Algorithm Overview:
The precision of the phase estimate depends on the number of precision qubits used. With n precision qubits, the phase can be estimated to within 2π/2^n.
Key Functions:
Example Usage: (def simulator (create-simulator)) (def result (quantum-phase-estimation simulator (/ Math/PI 4) 3 :plus)) (:estimated-phase (:result result)) ; => ~0.7854 (π/4)
Quantum Phase Estimation (QPE) algorithm implementation. The Quantum Phase Estimation algorithm is a fundamental quantum algorithm that estimates the eigenvalue of a unitary operator. Given a unitary operator U and one of its eigenstates |ψ⟩ such that U|ψ⟩ = e^(iφ)|ψ⟩, QPE estimates the phase φ. Algorithm Overview: 1. Initialize precision qubits in superposition (|+⟩ states) 2. Prepare eigenstate qubit in a known eigenstate of U 3. Apply controlled-U^(2^k) operations for k = 0 to n-1 4. Apply inverse Quantum Fourier Transform to precision qubits 5. Measure precision qubits to extract phase estimate The precision of the phase estimate depends on the number of precision qubits used. With n precision qubits, the phase can be estimated to within 2π/2^n. Key Functions: - quantum-phase-estimation-circuit: Build QPE circuit - quantum-phase-estimation: Execute complete QPE algorithm - parse-measurement-to-phase: Convert measurement results to phase estimates - analyze-qpe-results: Analyze QPE measurement statistics Example Usage: (def simulator (create-simulator)) (def result (quantum-phase-estimation simulator (/ Math/PI 4) 3 :plus)) (:estimated-phase (:result result)) ; => ~0.7854 (π/4)
(analyze-qpe-results measurements precision-qubits actual-phase)
Analyze QPE measurement results to extract phase estimate.
Parameters:
Returns: Map with analysis results
Analyze QPE measurement results to extract phase estimate. Parameters: - measurements: Map of measurement outcomes to counts - precision-qubits: Number of precision qubits used - actual-phase: Actual phase value (for comparison) Returns: Map with analysis results
(parse-measurement-to-phase measurement precision-qubits)
Convert measurement string to phase estimate.
Parameters:
Returns: Map with binary value and estimated phase
Convert measurement string to phase estimate. Parameters: - measurement: Binary measurement string (e.g., '001') - precision-qubits: Number of precision qubits Returns: Map with binary value and estimated phase
(quantum-phase-estimation backend phase precision-qubits)
(quantum-phase-estimation backend phase precision-qubits eigenstate-type)
(quantum-phase-estimation backend
phase
precision-qubits
eigenstate-type
options)
Execute quantum phase estimation to estimate the phase of a unitary operator.
The quantum phase estimation algorithm estimates the eigenvalue of a unitary operator U when given an eigenstate. For a unitary U with eigenvalue e^(iφ), QPE estimates the phase φ.
Algorithm steps:
Parameters:
Returns: Map with comprehensive phase estimation results
Execute quantum phase estimation to estimate the phase of a unitary operator. The quantum phase estimation algorithm estimates the eigenvalue of a unitary operator U when given an eigenstate. For a unitary U with eigenvalue e^(iφ), QPE estimates the phase φ. Algorithm steps: 1. Prepare eigenstate qubit (|+⟩, |1⟩, or |0⟩) 2. Initialize precision qubits in superposition with Hadamard gates 3. Apply controlled-U^(2^k) operations for k = 0 to precision-qubits-1 4. Apply inverse quantum Fourier transform to precision qubits 5. Measure precision qubits to extract phase estimate Parameters: - backend: Quantum backend to execute the circuit - phase: Phase to estimate (for simulation purposes) - precision-qubits: Number of qubits for phase precision (affects accuracy) - eigenstate-type: Type of eigenstate preparation (:default, :plus, :one) - options: Execution options (shots, etc.) Returns: Map with comprehensive phase estimation results
(quantum-phase-estimation-circuit precision-qubits eigenstate-type phase)
Build a quantum phase estimation circuit.
Parameters:
Returns: Quantum circuit implementing QPE
Build a quantum phase estimation circuit. Parameters: - precision-qubits: Number of qubits for phase precision - eigenstate-type: Type of eigenstate preparation (:default, :plus, :one) - phase: The phase to estimate (for simulation purposes) Returns: Quantum circuit implementing QPE
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close