diff options
| author | hachem <im@hachem.wtf> | 2026-09-18 19:41:34 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-18 19:41:34 +0200 |
| commit | e1f5c41c35fe26fddf5163ec06f78efd61ad35f4 (patch) | |
| tree | 0ec00d56cd7b78a7701649349c43a151fc0a4b94 | |
| parent | 17598056a69a14e0390a07251d383f413ded9eea (diff) | |
chore: update README
| -rw-r--r-- | README.md | 132 |
1 files changed, 66 insertions, 66 deletions
@@ -1,75 +1,75 @@ -# $\psi$: A Quantum Computational Toolkit +# $\psi$: a quantum computational toolkit $\psi$ is a powerful quantum computing toolkit designed for simulating quantum circuits and wavefunction dynamics on classical hardware. -## Features +## features -### Quantum Gates +### quantum gates -**Clifford Gates:** -- Single-qubit: H, X, Y, Z, S -- Two-qubit: CNOT, CZ, SWAP -- Three-qubit: CCNOT (Toffoli), CSWAP (Fredkin) +**clifford gates:** +- single-qubit: h, x, y, z, s +- two-qubit: cnot, cz, swap +- three-qubit: ccnot (toffoli), cswap (fredkin) -**Non-Clifford Gates:** -- Fixed: T, $S^\dagger$, $T^\dagger$, $\sqrt{X}$, $\sqrt{X}^\dagger$ -- Parametric rotations: $R_x(\theta)$, $R_y(\theta)$, $R_z(\theta)$, $P(\theta)$ -- General unitaries: $U_1(\lambda)$, $U_2(\phi, \lambda)$, $U_3(\theta, \phi, \lambda)$ -- Controlled parametric: $CR_x(\theta)$, $CR_y(\theta)$, $CR_z(\theta)$, $CP(\theta)$ +**non-clifford gates:** +- fixed: t, $S^\dagger$, $T^\dagger$, $\sqrt{X}$, $\sqrt{X}^\dagger$ +- parametric rotations: $R_x(\theta)$, $R_y(\theta)$, $R_z(\theta)$, $P(\theta)$ +- general unitaries: $U_1(\lambda)$, $U_2(\phi, \lambda)$, $U_3(\theta, \phi, \lambda)$ +- controlled parametric: $CR_x(\theta)$, $CR_y(\theta)$, $CR_z(\theta)$, $CP(\theta)$ -**Custom Gates:** -- Define gates from unitary matrices -- Build composite gates from sequences of operations +**custom gates:** +- define gates from unitary matrices +- build composite gates from sequences of operations -### Composable Runtime System +### composable runtime system -Build custom execution pipelines by combining optimisation features: +build custom execution pipelines by combining optimisation features: -| Feature | Description | +| feature | description | |---------|-------------| -| `.batched()` | Kernel batching with gate fusion | -| `.simd()` | SIMD acceleration (AVX-512/AVX2/NEON) | -| `.structure_aware()` | Commutation analysis and advanced fusion | -| `.parallel()` | Multi-threaded execution | -| `.with_threshold(n)` | Set parallel threshold (default: 8 qubits) | +| `.batched()` | kernel batching with gate fusion | +| `.simd()` | simd acceleration (avx-512/avx2/neon) | +| `.structure_aware()` | commutation analysis and advanced fusion | +| `.parallel()` | multi-threaded execution | +| `.with_threshold(n)` | set parallel threshold (default: 8 qubits) | -**Predefined Runtimes:** -- `Runtime::BasicRT` / `BasicRTMT` — Direct state vector simulation -- `Runtime::BatchedRT` / `BatchedRTMT` — Batched kernel execution -- `Runtime::SimdRT` / `SimdRTMT` — Batched + SIMD -- `Runtime::StructureAwareRT` / `StructureAwareMT` — Structure-aware + SIMD -- `Runtime::optimal()` — Structure-aware + SIMD + parallel +**predefined runtimes:** +- `Runtime::BasicRT` / `BasicRTMT` — direct state vector simulation +- `Runtime::BatchedRT` / `BatchedRTMT` — batched kernel execution +- `Runtime::SimdRT` / `SimdRTMT` — batched + simd +- `Runtime::StructureAwareRT` / `StructureAwareMT` — structure-aware + simd +- `Runtime::optimal()` — structure-aware + simd + parallel -### SIMD Acceleration +### simd acceleration -Automatic detection and use of platform-specific SIMD instructions: -- **AVX-512**: Modern Intel/AMD processors -- **AVX2+FMA**: Older x86_64 processors -- **NEON**: ARM processors (Apple Silicon, etc.) -- **Scalar fallback**: Universal compatibility +automatic detection and use of platform-specific simd instructions: +- **avx-512**: modern intel/amd processors +- **avx2+fma**: older x86_64 processors +- **neon**: arm processors (apple silicon, etc.) +- **scalar fallback**: universal compatibility -### Kernel Optimisations +### kernel optimisations -**Batching:** -- Groups consecutive single-qubit gates on the same qubit -- Fuses gate matrices to reduce operations -- Typically achieves 30–50% kernel reduction +**batching:** +- groups consecutive single-qubit gates on the same qubit +- fuses gate matrices to reduce operations +- typically achieves 30–50% kernel reduction -**Structure-Aware:** -- Gate type detection (diagonal, non-diagonal, controlled) -- Commutation analysis for reordering -- Multi-pass fusion until convergence -- Execution layer grouping for parallelism +**structure-aware:** +- gate type detection (diagonal, non-diagonal, controlled) +- commutation analysis for reordering +- multi-pass fusion until convergence +- execution layer grouping for parallelism -### Noise Channels (Density Matrix) +### noise channels (density matrix) -Realistic quantum noise simulation using Kraus operators: +realistic quantum noise simulation using kraus operators: -| Channel | Description | +| channel | description | |---------|-------------| -| `depolarising(p)` | Random Pauli error with probability $p$ | -| `amplitude_damping(γ)` | Energy decay ($T_1$ relaxation) | -| `phase_damping(γ)` | Phase decoherence ($T_2$ dephasing) | +| `depolarising(p)` | random pauli error with probability $p$ | +| `amplitude_damping(γ)` | energy decay ($T_1$ relaxation) | +| `phase_damping(γ)` | phase decoherence ($T_2$ dephasing) | | `bit_flip(p)` | $X$ error with probability $p$ | | `phase_flip(p)` | $Z$ error with probability $p$ | | `bit_phase_flip(p)` | $Y$ error with probability $p$ | @@ -89,17 +89,17 @@ println!("Purity: {}", dm.purity()); // 1.0 = pure, <1.0 = mixed println!("Fidelity: {}", dm.fidelity_with_pure_state(&ideal_state)); ``` -## Project Structure +## project structure -`psi` is a single crate. The library lives under `src/`: +`psi` is a single crate. the library lives under `src/`: -- **`core`**: Quantum gates, circuits, registers, and runtimes -- **`maths`**: Complex numbers, vectors, matrices, SIMD operations -- **`visualizer`**: Circuit visualisation (ASCII horizontal/vertical) +- **`core`**: quantum gates, circuits, registers, and runtimes +- **`maths`**: complex numbers, vectors, matrices, simd operations +- **`visualizer`**: circuit visualisation (ascii horizontal/vertical) -The comprehensive test suite and benchmarks live in **`examples/tester`**. +the comprehensive test suite and benchmarks live in **`examples/tester`**. -## Quick Start +## quick start ```rust use psi::{QuantumCircuit, Runtime}; @@ -117,7 +117,7 @@ fn main() { } ``` -### Composable Runtimes +### composable runtimes ```rust use psi::{QuantumCircuit, RuntimeConfig}; @@ -134,7 +134,7 @@ let config = RuntimeConfig::new() circuit.compute_with_config(config); ``` -### Parametric Gates +### parametric gates ```rust use std::f64::consts::PI; @@ -146,7 +146,7 @@ circuit .crz(0, 1, PI / 4.0); // Controlled-Rz ``` -### Custom Gates +### custom gates ```rust use psi::{CustomGateBuilder, CustomGate, complex, matrix}; @@ -165,7 +165,7 @@ let sqrt_x_matrix = matrix!( let sqrt_x = CustomGate::from_matrix("√X", sqrt_x_matrix); ``` -## Running Tests +## running tests ```bash cargo run --release --example tester # All tests @@ -177,10 +177,10 @@ cargo run --release --example tester -- bench cargo run --release --example tester -- help ``` -## Disclaimer +## disclaimer -This project is under active development. Features and APIs may change. +this project is under active development. features and apis may change. -## License +## license -This project is made available under the Apache License, Version 2.0, allowing free use, modification, and distribution with proper attribution. Community contributions, improvements, and research collaborations are encouraged. Full licensing terms can be found in [LICENSE](LICENSE). +this project is made available under the apache license, version 2.0, allowing free use, modification, and distribution with proper attribution. community contributions, improvements, and research collaborations are encouraged. full licensing terms can be found in [license](LICENSE). |
