Crate onq

Source
Expand description

onq: Operations for Next Generation Quantum Computating Simulation Library

This library provides Rust structures and functions for simulating computation based only on abstract principles.

§Core Idea

Unlike standard quantum simulators modeling quantum mechanics, onq explores computation emerging necessarily from a self-containing distinction. It models phenomena analogous to quantum computation (superposition, entanglement analogs, interference, stabilization) without assuming physics, relying solely on the structural and logical consequences defined by the framework

§Key Components

  • Core Types (onq::core): Defines fundamental concepts like QduId, PotentialityState (complex state vectors), and StableState.
  • Operations (onq::operations): Defines quantum operations (Operation, LockType) (analogs of H, X, Z, S, T, CNOT, CZ, CPhase, etc.).
  • Circuits (onq::circuits): Provides Circuit to represent ordered sequences of quantum operations and CircuitBuilder for easy construction.
  • Validation (onq::validation): Offers functions to check state validity (normalization, phase coherence interpretation).
  • ONQ Virtual Machine (onq::vm): An interpreter (OnqVm) that executes Programs containing mixed sequences of Instructions (quantum ops, classical ops, control flow based on stabilization results).
  • Simulation Engine (onq::simulation::engine - internal): Handles the underlying state vector evolution and stabilization logic.

§Interpretation & Differences from QM

Users should be aware that onq simulation relies heavily on interpretations of the abstract and sometimes mathematically ambiguous framework. Key differences from standard Quantum Mechanics include:

  • Stabilization vs Measurement: Stabilize is deterministic (seeded by state hash), uses scoring (interpreting Phase Coherence and Pattern Resonance), and resolves potentiality based on framework rules, not probabilistic collapse.
  • Locking: RelationalLock uses non-unitary projection to model state integration.
  • Operations: Gate availability and behavior are strictly based on derivations.

See the project README for detailed explanations of concepts, interpretations, and limitations.

Re-exports§

pub use core::QduId;
pub use core::PotentialityState;
pub use core::StableState;
pub use core::OnqError;
pub use operations::Operation;
pub use circuits::Circuit;
pub use circuits::CircuitBuilder;
pub use simulation::Simulator;
pub use simulation::SimulationResult;
pub use vm::Instruction;
pub use vm::program::LockType;
pub use vm::Program;
pub use vm::ProgramBuilder;
pub use validation::check_normalization;
pub use validation::check_phase_coherence;
pub use validation::calculate_global_phase_coherence;
pub use validation::validate_state;

Modules§

circuits
Defines structures for representing and building ordered sequences of operations (onq::operations::Operation).
core
Core data structures and types
operations
Defines operations derived from principles governing state transformation, interaction, and stabilization.
simulation
Simulates the execution of onq::circuits::Circuit based on framework principles. This module contains the Simulator entry point and the internal SimulationEngine responsible for managing and evolving the state according to derived rules.
validation
Provides functions to validate PotentialityState based on principles.
vm
Defines the structures and interpreter for the ONQ Virtual Machine (ONQ-VM).