(quantum-phase-estimation phase precision-qubits)
Implement quantum phase estimation algorithm.
The quantum phase estimation algorithm estimates the phase φ such that U|ψ⟩ = e^(2πiφ)|ψ⟩ where U is a unitary operator and |ψ⟩ is an eigenstate.
This is a fundamental subroutine used in many quantum algorithms including Shor's factoring algorithm and quantum simulation.
Algorithm steps:
Parameters:
Returns: Map containing phase estimation results
Example: (quantum-phase-estimation 0.25 4) ;=> Estimates phase φ = 1/4
Implement quantum phase estimation algorithm. The quantum phase estimation algorithm estimates the phase φ such that U|ψ⟩ = e^(2πiφ)|ψ⟩ where U is a unitary operator and |ψ⟩ is an eigenstate. This is a fundamental subroutine used in many quantum algorithms including Shor's factoring algorithm and quantum simulation. Algorithm steps: 1. Initialize n counting qubits in |0⟩ and eigenstate |ψ⟩ 2. Apply Hadamard to counting qubits 3. Apply controlled-U^(2^j) operations 4. Apply inverse QFT to counting qubits 5. Measure counting qubits to get phase estimate Parameters: - phase: The actual phase φ to estimate (for simulation) - precision-qubits: Number of qubits for phase precision Returns: Map containing phase estimation results Example: (quantum-phase-estimation 0.25 4) ;=> Estimates phase φ = 1/4
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close