Bernstein-Vazirani Algorithm
The Bernstein-Vazirani algorithm is a quantum algorithm that efficiently determines a hidden bit string s using only one query to a quantum oracle. It is a foundational example of quantum speedup over classical algorithms, demonstrating how quantum circuits can solve specific problems more efficiently than their classical counterparts.
This implementation builds the quantum circuit for the Bernstein-Vazirani algorithm and executes it on a specified quantum backend.
The algorithm uses a quantum oracle Uf that computes f(x) = s·x (mod 2), where s is the hidden string and x is the input bit string.
The algorithm requires only one query to the oracle to determine the hidden string s, while classical algorithms would require n queries for an n-bit string.
Bernstein-Vazirani Algorithm The Bernstein-Vazirani algorithm is a quantum algorithm that efficiently determines a hidden bit string s using only one query to a quantum oracle. It is a foundational example of quantum speedup over classical algorithms, demonstrating how quantum circuits can solve specific problems more efficiently than their classical counterparts. This implementation builds the quantum circuit for the Bernstein-Vazirani algorithm and executes it on a specified quantum backend. The algorithm uses a quantum oracle Uf that computes f(x) = s·x (mod 2), where s is the hidden string and x is the input bit string. The algorithm requires only one query to the oracle to determine the hidden string s, while classical algorithms would require n queries for an n-bit string.
Deutsch Algorithm
The Deutsch algorithm is a quantum algorithm that determines whether a given function f: {0,1} → {0,1} is constant (f(0) = f(1)) or balanced (f(0) ≠ f(1)) using only one quantum query, compared to 2 classical queries needed.
This implementation builds the quantum circuit for the Deutsch algorithm and executes it on a specified quantum backend.
Deutsch Algorithm The Deutsch algorithm is a quantum algorithm that determines whether a given function f: {0,1} → {0,1} is constant (f(0) = f(1)) or balanced (f(0) ≠ f(1)) using only one quantum query, compared to 2 classical queries needed. This implementation builds the quantum circuit for the Deutsch algorithm and executes it on a specified quantum backend.
Grover's Search Algorithm
Grover's algorithm provides a quadratic speedup for searching unsorted databases. For N items, classical search requires O(N) queries, while Grover's requires O(√N). The number of Grover iterations is approximately π√N/4, where N is the size of the search space.
This implementation builds the quantum circuit for Grover's algorithm and executes it on a specified quantum backend.
The algorithm consists of:
The oracle function should take a computational basis state index and return true for target states.
The diffusion operator applies inversion about the average amplitude.
Grover's Search Algorithm Grover's algorithm provides a quadratic speedup for searching unsorted databases. For N items, classical search requires O(N) queries, while Grover's requires O(√N). The number of Grover iterations is approximately π√N/4, where N is the size of the search space. This implementation builds the quantum circuit for Grover's algorithm and executes it on a specified quantum backend. The algorithm consists of: 1. Initializing a uniform superposition state |+⟩^⊗n 2. Repeating Grover iterations: a. Apply the oracle Uf to mark target states b. Apply the diffusion operator (inversion about average) 3. Measuring the final state to find the target item with high probability The oracle function should take a computational basis state index and return true for target states. The diffusion operator applies inversion about the average amplitude.
Implementation of quantum modular arithmetic operations needed for Shor's algorithm.
This namespace provides functions to create quantum circuits that implement modular addition, multiplication, and exponentiation operations.
Implementation of quantum modular arithmetic operations needed for Shor's algorithm. This namespace provides functions to create quantum circuits that implement modular addition, multiplication, and exponentiation operations.
Contains the quantum algorithm for period finding, e.g. for Shor's algorithm. This algorithm uses quantum phase estimation to find the period of a modular exponentiation function.
Contains the quantum algorithm for period finding, e.g. for Shor's algorithm. This algorithm uses quantum phase estimation to find the period of a modular exponentiation function.
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)
Simon's Algorithm
Simon's algorithm solves the hidden subgroup problem for the group (Z₂)ⁿ. Given a function f: {0,1}ⁿ → {0,1}ⁿ that is either one-to-one or two-to-one, and if two-to-one then f(x) = f(x ⊕ s) for some hidden string s ≠ 0ⁿ, the algorithm finds s with exponential speedup over classical methods.
The algorithm requires only O(n) quantum operations to find the hidden period, while classical algorithms would require O(2^(n/2)) queries to find s.
This implementation builds the quantum circuit for Simon's algorithm and executes it on a specified quantum backend.
The algorithm uses a quantum oracle Uf that computes f(x) = f(x ⊕ s), where s is the hidden period and x is the input bit string.
Simon's Algorithm Simon's algorithm solves the hidden subgroup problem for the group (Z₂)ⁿ. Given a function f: {0,1}ⁿ → {0,1}ⁿ that is either one-to-one or two-to-one, and if two-to-one then f(x) = f(x ⊕ s) for some hidden string s ≠ 0ⁿ, the algorithm finds s with exponential speedup over classical methods. The algorithm requires only O(n) quantum operations to find the hidden period, while classical algorithms would require O(2^(n/2)) queries to find s. This implementation builds the quantum circuit for Simon's algorithm and executes it on a specified quantum backend. The algorithm uses a quantum oracle Uf that computes f(x) = f(x ⊕ s), where s is the hidden period and x is the input bit string.
Implementation of fundamental quantum algorithms using the qclojure domain
Implementation of fundamental quantum algorithms using the qclojure domain
No vars found in this namespace.
Protocol and interface for quantum computing hardware backends.
This namespace defines the protocol for connecting to and executing quantum circuits on real quantum hardware or simulators. It provides a clean abstraction layer that allows the application to work with different quantum computing providers and simulators.
Protocol and interface for quantum computing hardware backends. This namespace defines the protocol for connecting to and executing quantum circuits on real quantum hardware or simulators. It provides a clean abstraction layer that allows the application to work with different quantum computing providers and simulators.
OpenQASM 3.0 conversion functions for quantum circuits.
This namespace provides conversion between quantum circuit data structures and OpenQASM 3.0 format strings. QASM 3.0 is the latest version of the OpenQASM quantum assembly language with improved syntax and features.
OpenQASM 3.0 conversion functions for quantum circuits. This namespace provides conversion between quantum circuit data structures and OpenQASM 3.0 format strings. QASM 3.0 is the latest version of the OpenQASM quantum assembly language with improved syntax and features.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close