Skip to main content

Log-Quantum Fractal Tree: Pattern-Aware Deduplicating Data Structure

Project description

Log-Quantum Fractal Tree (LQFT) 🚀

Architect: Parjad Minooei Portfolio: parjadm.ca


📌 Executive Summary

The Log-Quantum Fractal Tree (LQFT) is a high-performance, scale-invariant data structure engine designed for massive data deduplication and persistent state management. By bridging a native C-Engine with a Python Foreign Function Interface (FFI), this project bypasses the Global Interpreter Lock (GIL) to achieve sub-microsecond search latencies and memory efficiency that scales with data entropy rather than data volume.


🧠 Formal Complexity Analysis

As a Systems Architect, I have engineered the LQFT to move beyond the linear limitations of standard Python structures.

1. Time Complexity: $O(1)$ (Scale-Invariant)

Unlike standard Trees ($O(\log N)$) or Lists ($O(N)$), the LQFT uses a fixed-depth 64-bit address space.

  • Search/Insertion: $O(1)$
  • Mechanism: The 64-bit hash is partitioned into 13 segments of 5-bits. This ensures that the path from the root to any leaf is physically capped at 13 hops, providing deterministic latency regardless of whether the database holds 1,000 or 1,000,000,000 items.

2. Space Complexity: $O(\Sigma)$ (Entropy-Based)

Standard structures scale linearly based on the number of items ($N$). The LQFT scales based on the Information Entropy ($\Sigma$) of the dataset.

  • Space: $O(\Sigma)$
  • Mechanism: Utilizing Merkle-DAG structural folding, the engine detects identical data branches and reuses them in physical memory. In highly redundant datasets (e.g., DNA sequences or Log files), this results in sub-linear memory growth.

📊 Performance Benchmarks

Tested in Scarborough Lab: Python 3.12 | MinGW-w64 GCC-O3 Optimization

Metric Standard Python ($O(N)$) LQFT C-Engine ($O(1)$) Delta
Search Latency (N=100k) ~3,564.84 μs 0.50 μs 7,129x Faster
Insertion Time (N=100k) 41.05s 1.07s 38x Faster
Memory (Versioning) $O(N \times V)$ $O(\Sigma + V)$ 99% Savings

🛠️ Architectural Pillars

  • Native C-Engine Core: Pushes memory allocation and bit-manipulation to the C-layer for hardware-level execution.
  • Structural Folding: A recursive structural hashing algorithm that collapses identical sub-trees into single pointers.
  • Adaptive Migration: A polymorphic wrapper (AdaptiveLQFT) that manages the transition from lightweight Python dictionaries to the heavy-duty C-Engine.
  • Zero-Knowledge Integrity: Fixed-depth pathing allows for 208-byte Merkle Proofs to verify data existence in microsecond time.

⚙️ Quick Start

Compilation

Ensure you have a C compiler (GCC/Clang) installed to build the FFI layer.

python setup.py build_ext --inplace

Usage

from lqft_engine import AdaptiveLQFT

Initialize engine with an auto-migration threshold

engine = AdaptiveLQFT(migration_threshold=50000)

Insert and Search

engine.insert("secret_key", "confidential_data") result = engine.search("secret_key")

print(f"Found: {result}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lqft_python_engine-0.1.7.tar.gz (10.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

lqft_python_engine-0.1.7-cp312-cp312-win_amd64.whl (15.9 kB view details)

Uploaded CPython 3.12Windows x86-64

lqft_python_engine-0.1.7-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

lqft_python_engine-0.1.7-cp312-cp312-macosx_11_0_arm64.whl (12.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

lqft_python_engine-0.1.7-cp312-cp312-macosx_10_9_x86_64.whl (12.1 kB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

lqft_python_engine-0.1.7-cp311-cp311-win_amd64.whl (15.9 kB view details)

Uploaded CPython 3.11Windows x86-64

lqft_python_engine-0.1.7-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

lqft_python_engine-0.1.7-cp311-cp311-macosx_11_0_arm64.whl (12.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

lqft_python_engine-0.1.7-cp311-cp311-macosx_10_9_x86_64.whl (12.1 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

lqft_python_engine-0.1.7-cp310-cp310-win_amd64.whl (15.9 kB view details)

Uploaded CPython 3.10Windows x86-64

lqft_python_engine-0.1.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

lqft_python_engine-0.1.7-cp310-cp310-macosx_11_0_arm64.whl (12.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

lqft_python_engine-0.1.7-cp310-cp310-macosx_10_9_x86_64.whl (12.1 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

lqft_python_engine-0.1.7-cp39-cp39-win_amd64.whl (15.9 kB view details)

Uploaded CPython 3.9Windows x86-64

lqft_python_engine-0.1.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

lqft_python_engine-0.1.7-cp39-cp39-macosx_11_0_arm64.whl (12.4 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

lqft_python_engine-0.1.7-cp39-cp39-macosx_10_9_x86_64.whl (12.1 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

lqft_python_engine-0.1.7-cp38-cp38-win_amd64.whl (15.9 kB view details)

Uploaded CPython 3.8Windows x86-64

lqft_python_engine-0.1.7-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (24.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

lqft_python_engine-0.1.7-cp38-cp38-macosx_11_0_arm64.whl (12.5 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

lqft_python_engine-0.1.7-cp38-cp38-macosx_10_9_x86_64.whl (12.3 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

File details

Details for the file lqft_python_engine-0.1.7.tar.gz.

File metadata

  • Download URL: lqft_python_engine-0.1.7.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lqft_python_engine-0.1.7.tar.gz
Algorithm Hash digest
SHA256 411b269a421a51ae9009842213fbb212f58dcf4751968b6bdb9caa56424d2748
MD5 3fc2fbafe7b71f0c47ffdbf7108ad781
BLAKE2b-256 ae31a6595a7869c47fcca926e01b5be0504f4d8750a7f20538f81b3fcf8aca9e

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 734131b1da35d27b5b362ad9d69cff2c7773f0dea9a3a4d0c5100f866a524ee8
MD5 81d0a1555819089a2ce42de98969a417
BLAKE2b-256 d20cb4ccecc6cd341b070063aaf5cfaad806d36b46ff4508ec146113bfa67544

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0d90d96143383c2e6e1a90e94e0f6fd0db38f68d4b43afd6a218e2326d2e00d5
MD5 3ab1a7c1bd5f41cd9ae763fc42276303
BLAKE2b-256 0f0e2aae560ffaec9dc7ff019dedd0658834236ebe92c2a782c39e3fe1193d99

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 270e7244047484e0ef4412d0e86c395f5300a8b662b648f854ee87d59b7b092e
MD5 73767003291cd09b3dcba6ab2b22936f
BLAKE2b-256 211aa3e19121043bda8a88dc80cde529a07b545d74b067a41747fd0eebc2112e

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7fa07e8a5eb49fc6915ceb5c1cebc568e9afad470836798127fd1eb7a9f3bda7
MD5 162191fe037b86f13428a9e419e3b5e4
BLAKE2b-256 d5d4a66e4213c3e120ee6efb6265e7c0807f4e90cb71cc1b930ab26605c94d09

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 aee1df812da8da012b7ba44302c8579c273560cecbb40d6261649e592a70193d
MD5 d786684ef3b5bcecb9e9b62889a77a56
BLAKE2b-256 b0bc7fc84a5c186a04c702bea5095f13215d84f82199d586dd76aae3d6591374

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2dd919c71879af1024ba98c526c9a71eb63790ec15229c244bdf9c22910b9742
MD5 367f50830c54cf46f7932faa687897eb
BLAKE2b-256 54e0bd745d0b2c97eb7fe9ce2b1d92dc8b2a6ec25967ebf051901120ffe9c713

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 894b82435a6c90c2e675717cbc1cb6982a2b700f36eb96755908fb6a8a89c7b2
MD5 ee474b29537b2ae505fd9dd4f46e5a4f
BLAKE2b-256 3617edd29a48c144f371b1fd884b721ba408f54500eabcd5d7eb9ff3825fb940

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cc78fb9adc730b3d3c8e40035e74be75e94fa42528ac86e3ef7694872dac60d8
MD5 4c21094c12fb6e2b1815849944a1268d
BLAKE2b-256 e04a94d0a7c1bb638965da5bc0fdaf04bff83f533096dc783d3d5b1abddbb110

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1acd535c0ef5bf641d1c2bd5946cba8dd758cd891a7391114373434b54306454
MD5 c6792a3c263f844472757b1b74ed3a2f
BLAKE2b-256 091faeb556b91d887db69b70dbee68594129bca8e522c3a649f2f4db4d1cf85c

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2b31e8e05d7cf62240c6206e799407fbfb9bfa00c54d61863df7e813d5ede8a9
MD5 104c64c65a577077b336c5b4906cc9bf
BLAKE2b-256 05f048b44b810bbb723bfca079d71b0db00c4b69931ff11a9fd1852f05412ccf

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 90af2e45e6ed15ab9dfcb13a8b68cbccc9c75e9a2ca34ea95b8f217fed710f17
MD5 aa2704111614adaab0ff9699444365f0
BLAKE2b-256 f4a18c358008a9697168542715ac61c169b8edbe060b7f24c683e1230ac365fa

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5f33147b20789b1b241146f4d446fadc17b1ecf9f5989f8943e288ef1a456f46
MD5 8e1af7f63fdb1d7b85354cad94158510
BLAKE2b-256 4442f2a92b1d0c793a0bccf49fc384fb4d766fd824bc3a1fd41ec6660e27a949

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 f22906ac94aa1ac9cce5fc439b2c82d424b4d2e6f5a91e79778cee293e504574
MD5 c86271ec6509efcb32e47f549d4fe603
BLAKE2b-256 e5176a786bd399a005227a5f7c01d4150a9b145346892f56744e0195458f3470

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5e377530cfdeab0ae759b3cde0c676e701b55bc3ecde7f0aaaa9569e344cb9d4
MD5 0ad64ce19ef7e471e3578c3f4317a3cb
BLAKE2b-256 73b78739b543a01fb11901796520fb2755602b2f22612c873f741f0e13e43700

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 61d6d261c8cb327ed7946bf103a60ac64ea41e5447aae0b541f1778d1d06f34b
MD5 46f32d6b0239eea4526bde6b5bec1860
BLAKE2b-256 b58547c1b19dce48a5279da478c5c25d112f1cc7d2fb97d6005f8b78b18de355

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2eb61e190f017a79a7fc0a76caac86c55ffb38a1804cb70edc02d8c0e676470a
MD5 1456397c2d3ab10a08a61720f274eccd
BLAKE2b-256 f2fd758782427c7edb6fc9f14868b0630e38902d7ef0ba9273510277ca3500ca

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ab0fafe8c43e02d2d886ee1abc8a85a06f7a54912eec3fd113da7efaa20b2d8d
MD5 786f22d856a060190b35fed44ff9b6d3
BLAKE2b-256 1ce7f9c3a595db271e70a470b6f0a3a9ca4628e28f2b4eea5d68d4c97020b45e

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 212e500a13193ad6f3099784317c29faca7baab1bd5c34cb9e6bf3980970b0f4
MD5 cb310cd58063c825801f65d886625867
BLAKE2b-256 91f92e54ded067bd5f4a0902daadc2b99911d445102499a04eaaf2e164e0674a

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f2b49d3a1f5e029f38010edde3e8dcebb70070b4496a54576a2b68d011416c47
MD5 5d9c65cf5f47585f0149bbd25c42d678
BLAKE2b-256 cd41561a2db4db15eca77aa6c5af12e2ca132c9795fb5dcbdb035a444ad1c737

See more details on using hashes here.

File details

Details for the file lqft_python_engine-0.1.7-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for lqft_python_engine-0.1.7-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c1113b40f0cd0522fff08a9c82f8304efac423ce4d2d72909832f7b3c18a93fe
MD5 5ea81a14517261612989d1214e2c617b
BLAKE2b-256 ca775bb15f0264768d392dc3e44a35c6f718ca0c246257b95b1359e04c7a43a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page