Skip to main content

qdb_rs/
lib.rs

1//! # qdb-rs - Quantum Database
2//!
3//! A hybrid quantum-classical database leveraging the QFT format for polynomial
4//! storage complexity and fault-tolerant error correction.
5//!
6//! ## Table of Contents
7//! 1. Core Types - QDB, Entry, Key, Value
8//! 2. Storage Backends - Memory, Disk, Hybrid
9//! 3. Query Engine - Grover-inspired search, tensor contractions
10//! 4. Error Correction - Golay-protected persistence
11//! 5. Transactions - Quantum-aware ACID semantics
12//!
13//! ## Architecture
14//!
15//! ```text
16//! ┌─────────────────────────────────────────────────────────────┐
17//! │                     QDB API Layer                           │
18//! ├─────────────────────────────────────────────────────────────┤
19//! │  Key-Value API  │  Document API  │  Relational API          │
20//! ├─────────────────────────────────────────────────────────────┤
21//! │                   Query Engine                              │
22//! │  - Grover search (O(√N))                                    │
23//! │  - Tensor contractions                                      │
24//! │  - Variational optimization                                 │
25//! ├─────────────────────────────────────────────────────────────┤
26//! │                   Storage Layer                             │
27//! │  - QFT serialization (MPS tensors)                          │
28//! │  - Golay error correction                                   │
29//! │  - Adaptive bond dimension                                  │
30//! ├─────────────────────────────────────────────────────────────┤
31//! │                   Backend Abstraction                       │
32//! │  Memory  │  Disk  │  Distributed  │  Quantum Hardware       │
33//! └─────────────────────────────────────────────────────────────┘
34//! ```
35
36#![cfg_attr(docsrs, feature(doc_cfg))]
37
38pub mod entry;
39pub mod error;
40pub mod index;
41pub mod query;
42pub mod storage;
43pub mod transaction;
44pub mod vector;
45
46pub use entry::{Entry, EntryType, Key, Value};
47pub use error::{QdbError, Result};
48pub use storage::{Backend, DiskBackend, MemoryBackend, QDB, QdbConfig, RadiationMode};
49pub use vector::{
50    cosine_distance_fast, euclidean_distance_squared,
51    DistanceMetric, Embedding, SearchResult, VectorEntry, VectorIndex, 
52    VectorIndexConfig, VectorStore, VectorStoreConfig, VectorStoreStats,
53};
54
55/// Prelude for convenient imports
56pub mod prelude {
57    pub use super::entry::{Entry, EntryType, Key, Value};
58    pub use super::error::{QdbError, Result};
59    pub use super::query::{Query, QueryResult};
60    pub use super::storage::{Backend, QDB};
61    pub use super::vector::{DistanceMetric, Embedding, SearchResult, VectorEntry, VectorStore};
62    pub use qft::prelude::*;
63}