Quantum ansatz (parameterized circuit) construction for variational algorithms.
This namespace provides various ansatz types used in VQE and other variational quantum algorithms. Each ansatz is designed for specific problem types and hardware constraints.
Key Responsibilities:
Design Principles:
Quantum ansatz (parameterized circuit) construction for variational algorithms. This namespace provides various ansatz types used in VQE and other variational quantum algorithms. Each ansatz is designed for specific problem types and hardware constraints. Key Responsibilities: - Hardware-efficient ansatz for NISQ devices - Chemistry-inspired ansatz for molecular systems - UCCSD-inspired ansatz for quantum chemistry - Symmetry-preserving ansatz for fermionic systems - Parameter initialization strategies Design Principles: - Pure functions returning circuit constructors - Configurable parameters for flexibility - Hardware-aware circuit structures - Reusable across different algorithms
Quantum channel domain layer providing pure quantum mechanical channel operations.
This namespace contains the core quantum channel functionality separated from implementation details. It focuses on the mathematical representation and application of quantum channels through Kraus operators.
Quantum channels represent the most general form of quantum operations, describing how quantum states evolve under the influence of noise, decoherence, and other physical processes. Every quantum channel can be represented using the Kraus representation: Ε(ρ) = Σᵢ KᵢρKᵢ†
Key concepts implemented:
Quantum channel domain layer providing pure quantum mechanical channel operations. This namespace contains the core quantum channel functionality separated from implementation details. It focuses on the mathematical representation and application of quantum channels through Kraus operators. Quantum channels represent the most general form of quantum operations, describing how quantum states evolve under the influence of noise, decoherence, and other physical processes. Every quantum channel can be represented using the Kraus representation: Ε(ρ) = Σᵢ KᵢρKᵢ† Key concepts implemented: - Kraus operator generation for standard noise models - Quantum channel application to quantum states - Decoherence parameter calculations - Matrix operations for quantum channel mathematics
Quantum circuit representation and execution
Quantum circuit representation and execution
Circuit transformation utilities for quantum backends.
This namespace provides functionality for adapting quantum circuits to specific hardware backends by transforming operations not supported by the backend into equivalent sequences of supported operations.
Circuit transformation utilities for quantum backends. This namespace provides functionality for adapting quantum circuits to specific hardware backends by transforming operations not supported by the backend into equivalent sequences of supported operations.
Quantum gate operations for quantum state manipulation
Quantum gate operations for quantum state manipulation
Quantum gate decomposition and circuit transformation for quantum hardware compatibility.
This namespace provides functionality to decompose complex quantum gates into simpler, hardware-native operations. It enables quantum circuits to be transformed to match the specific gate sets supported by different quantum hardware platforms and simulators.
Gate Decomposition:
Circuit Transformation:
Gate Decomposition Examples
;; Decompose Toffoli gate for CNOT+T gate set
(decompose-operation
{:operation-type :toffoli
:operation-params {:control1 0 :control2 1 :target 2}}
:cnot-t)
;; Decompose rotation gate with specific angle
(decompose-operation
{:operation-type :ry :operation-params {:target 0 :angle (/ Math/PI 3)}}
#{:rz :x :cnot})
See also: org.soulspace.qclojure.domain.operation-registry
for gate definitions.
Quantum gate decomposition and circuit transformation for quantum hardware compatibility. This namespace provides functionality to decompose complex quantum gates into simpler, hardware-native operations. It enables quantum circuits to be transformed to match the specific gate sets supported by different quantum hardware platforms and simulators. Gate Decomposition: - Decomposes complex gates (Toffoli, Fredkin, etc.) into universal gate sets - Handles parametric gates (rotation gates with arbitrary angles) - Supports multiple decomposition strategies based on target hardware Circuit Transformation: - Transforms entire quantum circuits to use only supported operations - Preserves quantum circuit semantics while changing implementation - Provides iterative decomposition with cycle detection Gate Decomposition Examples ```clojure ;; Decompose Toffoli gate for CNOT+T gate set (decompose-operation {:operation-type :toffoli :operation-params {:control1 0 :control2 1 :target 2}} :cnot-t) ;; Decompose rotation gate with specific angle (decompose-operation {:operation-type :ry :operation-params {:target 0 :angle (/ Math/PI 3)}} #{:rz :x :cnot}) ``` See also: `org.soulspace.qclojure.domain.operation-registry` for gate definitions.
Gate optimization functions for quantum circuits
This namespace provides functions to optimize quantum circuits by removing redundant gates and simplifying gate sequences. The primary optimization implemented is cancellation of consecutive self-inverse gates.
Self-inverse gates include:
When two identical self-inverse gates are applied consecutively to the same qubit(s), they cancel out and can be removed from the circuit without changing the quantum computation.
Gate optimization functions for quantum circuits This namespace provides functions to optimize quantum circuits by removing redundant gates and simplifying gate sequences. The primary optimization implemented is cancellation of consecutive self-inverse gates. Self-inverse gates include: - Single-qubit gates: X, Y, Z, H (Pauli gates and Hadamard) - Two-qubit gates: CNOT (controlled-X gate), CX, CY, CZ, SWAP - Three-qubit gates: Toffoli (CCX), Fredkin (CSWAP) When two identical self-inverse gates are applied consecutively to the same qubit(s), they cancel out and can be removed from the circuit without changing the quantum computation.
Core Hamiltonian representation and manipulation for quantum systems.
This namespace provides the fundamental building blocks for working with quantum Hamiltonians in the VQE algorithm and other quantum algorithms.
Key Responsibilities:
Design Principles:
Core Hamiltonian representation and manipulation for quantum systems. This namespace provides the fundamental building blocks for working with quantum Hamiltonians in the VQE algorithm and other quantum algorithms. Key Responsibilities: - Pauli term creation and validation - Hamiltonian expectation value calculations - Measurement grouping for hardware efficiency - Commuting term analysis Design Principles: - Pure functions with no side effects - Hardware-agnostic mathematical operations - Composable building blocks for higher-level algorithms
Mathematical operations and utilities for quantum algorithms.
Mathematical operations and utilities for quantum algorithms.
Backend for Clojure complex numbers.
Backend for Clojure complex numbers.
Facade for linear algebra operations with pluggable backends.
Goals:
Default backend: :pure, implemented via org.soulspace.qclojure.domain.math.clojure-math.
Use set-backend!
to change the global backend, or with-backend
to override in a dynamic scope.
Facade for linear algebra operations with pluggable backends. Goals: - Provide a single, meaningful API for matrix and vector operations. - Allow swapping implementations (pure Clojure Math, Fastmath, Neanderthal) without changing call sites. - Keep data shapes simple: matrices as vectors of row vectors; vectors as vectors of numbers. - Handle conversions between FastMath Vec2 format and backend-specific representations. Default backend: :pure, implemented via org.soulspace.qclojure.domain.math.clojure-math. Use `set-backend!` to change the global backend, or `with-backend` to override in a dynamic scope.
Backend for fastmath complex numbers.
Backend for fastmath complex numbers.
Core mathematical protocols for matrix algebra, decompositions, and quantum state operations.
Provides a contract for implementing backends to support linear algebra operations over numeric fields (ℝ or ℂ) with a focus on immutability and pure functions.
Core mathematical protocols for matrix algebra, decompositions, and quantum state operations. Provides a contract for implementing backends to support linear algebra operations over numeric fields (ℝ or ℂ) with a focus on immutability and pure functions.
Domain for quantum observables - Hermitian operators representing measurable quantities.
Observables in quantum mechanics are represented by Hermitian matrices. This namespace provides functions for creating and manipulating observables, calculating expectation values, and working with composite observables.
Design Philosophy:
Domain for quantum observables - Hermitian operators representing measurable quantities. Observables in quantum mechanics are represented by Hermitian matrices. This namespace provides functions for creating and manipulating observables, calculating expectation values, and working with composite observables. Design Philosophy: - Observables are simple data (matrices) - no complex wrapping - Pure functions for all operations - Compose complex observables from simple primitives - Separate representation, computation, and measurement concerns
Operation registry and catalog for quantum backends.
This namespace provides a comprehensive catalog of operations, quantum gates and measurements, that can be supported by different quantum backends. Backends can reference this registry to declare their supported operation sets.
Operation registry and catalog for quantum backends. This namespace provides a comprehensive catalog of operations, quantum gates and measurements, that can be supported by different quantum backends. Backends can reference this registry to declare their supported operation sets.
Functions for analyzing and optimizing qubit usage in quantum circuits.
Functions for analyzing and optimizing qubit usage in quantum circuits.
Core quantum state representation and operations
Core quantum state representation and operations
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |