[KongchangAI]
· 4 min read· 2,222 words

QuantumLogics: A Complete Guide to Quantum-Inspired Computing on Classical Hardware

QuantumLogics: A Complete Guide to Quantum-Inspired Computing on Classical Hardware

QuantumLogics is an open-source stack that runs quantum-inspired algorithms on ordinary CPUs.

QuantumLogics is a runnable open-source research prototype that gathers quantum-inspired algorithms into a modular Python stack, exposed through eight typed FastAPI endpoints. Its strongest modules are a ballistic-simulated-bifurcation (bSB) Max-Cut/QUBO solver and a post-quantum crypto demo implementing a real LWE lattice construction; it also includes tensor-network AI, molecular VQE, DMRG many-body simulation, amplitude-estimation Monte Carlo, surface-code error correction, and meta-routing proof-of-concept modules. The author is honest about the boundaries: this is classical simulation rather than quantum hardware, the Rust acceleration layer is still a placeholder, most modules are teaching-grade implementations, and there are no published benchmarks against classical baselines yet. It's a good starting point for learning quantum-inspired algorithms or a workbench for combinatorial optimization prototyping.

TL;DR: QuantumLogics is an open-source quantum-inspired algorithm simulation stack that routes workloads like combinatorial optimization, post-quantum cryptography, tensor-network AI, and molecular simulation to ordinary CPUs via Python modules, and exposes a unified FastAPI eight-pillar API. It is a research prototype, not a quantum computer — and the repo is refreshingly honest about that boundary.

QuantumLogics project source screenshot

What problem does it solve

Real quantum hardware is scarce, expensive, and noisy. But a large class of "quantum" algorithms — simulated bifurcation for optimization, tensor-network methods for AI and chemistry, lattice-based cryptography — can be simulated or approximated on classical hardware today, and they solve real problems: logistics routing, portfolio optimization, molecular screening, post-quantum key generation.

QuantumLogics brings these techniques together into a modular stack where developers can call quantum-inspired optimizers or lattice-crypto primitives over HTTP, without building a quantum lab — or even needing a GPU cluster. Everything runs on CPU with PyTorch.

What the repo actually contains

I verified the directory tree on GitHub — 37 files total. Ten modules, each a focused Python file (plus one Rust crate and the FastAPI service layer):

quantumlogics/
├── vq-logics-ai/        # tensor_nn.py        — tensor neural network
├── vq-logics-api/       # main.py             — FastAPI eight-pillar service
├── vq-logics-chem/      # tensor_vqe.py       — molecular tensor-network VQE
├── vq-logics-crypto/    # lwe_crypto.py       — LWE post-quantum cryptography
├── vq-logics-engine/    # Rust core (Cargo.toml, src/lib.rs)
├── vq-logics-fin/       # qae_finance.py      — amplitude-estimation Monte Carlo
├── vq-logics-geo/       # geo_router.py       — meta routing
├── vq-logics-opt/       # bsb_solver.py, sb_solver.py, maxcut.py, benchmark.py
├── vq-logics-sim/       # dmrg_sim.py         — DMRG many-body simulation
├── vq-logics-sys/       # error_correction.py — surface-code QEC simulation
├── serve.py             # UQEOS API service entry point
└── docker-compose.yml   # full-stack deployment

Optimization: ballistic simulated bifurcation

The strongest module is vq-logics-opt/bsb_solver.py, which implements ballistic simulated bifurcation (bSB, Goto et al. 2021) — a classical algorithm inspired by quantum adiabatic evolution that outperforms standard greedy heuristics on Max-Cut and QUBO problems. The implementation is compact and real: it normalizes the coupling matrix via a spectral-radius estimate (max row sum), integrates the bSB differential equations (dy = -(a0 - a)·x + c0·interactions, with hard-wall clamping of x to [-1, 1] and momentum killing at the walls), runs a batch of 16 parallel trajectories on CPU, and returns the lowest-energy spin configuration. maxcut.py drives it end-to-end and even ships a result plot (maxcut_result.png); benchmark.py compares solvers.

Simulated Bifurcation (SB) is a family of combinatorial optimization heuristics introduced by Goto et al. at Toshiba in 2019, inspired by quantum adiabatic evolution. It maps each spin in an Ising problem to the position variable of a nonlinear oscillator, and by ramping up a bifurcation parameter a(t) from 0, lets the system naturally split into two stable extrema in phase space (corresponding to spins ±1), completing a discrete combinatorial search through continuous dynamics. SB has two main variants: discrete simulated bifurcation (dSB) performs gradient-style updates directly in the discrete spin space, suited to low-latency hardware; ballistic simulated bifurcation (bSB) retains continuous momentum and position, letting the "particles" fly near-ballistically in the potential wells, and flipping momentum when they hit a hard wall (the |x|=1 boundary). Because bSB preserves momentum, its ability to escape local minima is stronger, and it is frequently reported to outperform simulated annealing and greedy heuristics on instances like Max-Cut and QUBO. Its biggest advantage is that it is highly parallelizable — all spins can be updated synchronously, making it a natural fit for GPUs or batched parallelism on CPU.

Post-quantum cryptography: LWE

vq-logics-crypto/lwe_crypto.py implements Learning With Errors (LWE) — the lattice problem underlying NIST post-quantum standards — as a runnable key-generation/encryption demo: a public matrix A (m×n), secret vector S, small error vector E, public key B = (A·S + E) mod q with n=256, q=3329, and single-bit encryption via a random ephemeral vector. This is educational scale, not a standardized implementation, but the math is a genuine LWE construction.

Learning With Errors (LWE) was introduced by Oded Regev in 2005 and is a cornerstone problem of post-quantum cryptography. Its form is: given a random matrix A ∈ Z_q^{m×n} and a vector b = A·s + e mod q, where s is a secret vector and e is a small error vector drawn from a discrete Gaussian distribution, recovering s is considered computationally hard. The difficulty lies in the error e, which makes b statistically indistinguishable from a uniform random vector, thereby resisting lattice basis reduction attacks. LWE has been proven to be as hard as worst-case lattice problems (such as SVP and GapSVP), which provides a provable reduction for its security. CRYSTALS-Kyber (key encapsulation) and CRYSTALS-Dilithium (signatures), selected in NIST's post-quantum standardization, are both built on Module-LWE variants. The n=256, q=3329 in the article are exactly the parameter scale Kyber uses, at a teaching-grade simplified level; real Kyber has larger security parameters and includes ring/polynomial structure, compression, and NTT acceleration as engineering steps, but the core mathematical construction is the same as in the article.

Other pillars

  • vq-logics-ai/tensor_nn.py — tensor-network neural inference.
  • vq-logics-chem/tensor_vqe.py — variational quantum eigensolver–style molecular simulation via tensor networks.
  • vq-logics-sim/dmrg_sim.py — density matrix renormalization group for many-body physics.
  • vq-logics-fin/qae_finance.py — quantum amplitude estimation–style Monte Carlo.
  • vq-logics-sys/error_correction.py — surface-code error correction simulation.
  • vq-logics-geo/geo_router.py — meta-routing experiments.

These are compact proofs of concept (a few hundred bytes to about 2KB each) — real code with real math, not stubs, but research-grade rather than library-grade. The finance module is a good example of this style of work: qae_finance.py is only 423 bytes, the smallest amplitude-estimation loop, showing the shape of the technique rather than pricing real derivatives. Treat these modules as executable lecture notes — each one teaches its algorithm by running — and you'll get everything they offer.

One API to rule them all

vq-logics-api/main.py wraps each module in a FastAPI application (the "UQEOS 8-Pillar API", v3.0.0) with eight typed endpoints: /api/v1/opt/maxcut, /api/v1/crypto/generate_keys, /api/v1/ai/infer, /api/v1/chem/simulate, /api/v1/sim/dmrg, /api/v1/fin/montecarlo, /api/v1/geo/route, /api/v1/sys/emulate_qec. For example, the Max-Cut endpoint builds the coupling matrix from the requested edge list, runs the bSB solver with batch_size=16, and returns the best spins and energy as JSON. serve.py is the deployment entry point (uvicorn serve:app), and docker-compose.yml brings up the whole stack.

How to run it

pip install -r requirements.txt

# Run any module directly
python vq-logics-ai/tensor_nn.py
python vq-logics-opt/maxcut.py

# Or serve all 8 pillars over HTTP
uvicorn serve:app --host 0.0.0.0 --port 8000

# Docker (optional)
docker-compose up --build

Then POST an edge list to /api/v1/opt/maxcut and get back a solved cut — no quantum hardware, no GPU.

Honest status and roadmap

Status: research prototype, runnable. The Python modules really do implement the algorithms they're named for — I read the bSB solver and the LWE crypto end to end, and the FastAPI layer really does call them. For learning quantum-inspired algorithms or prototyping optimization workloads, this is a legitimate starting point.

Honest caveats verified in the directory tree:

  1. The Rust engine is a placeholder. vq-logics-engine/src/lib.rs is the default Cargo template (add(2, 2) and its example test) — the "Rust core" described by the README does not yet exist. All computation currently runs in the Python modules.
  2. Simulation, not quantum advantage. Nothing here runs on a QPU, and there's no claim of being faster than state-of-the-art classical solvers; the value is accessibility and education.
  3. Uneven module depth. The optimizer and crypto modules are substantial; several other pillars are thin wrappers waiting to be expanded.

A roadmap that would make it serious: a real Rust kernel behind the Python API (replacing the stub engine), published benchmarks of the bSB solver against classical baselines (OR-Tools, simulated annealing) on standard Max-Cut instances, packaging the modules as an installable library, and hardware validation when a QPU is available (the author's D-Wave LaunchPad application is a natural next step).

Inside the solver zoo

The vq-logics-opt directory is worth a close look, because that's where the repo's engineering is densest. Next to the ballistic solver is sb_solver.py — the discrete simulated bifurcation variant — so the two can be compared head-to-head on the same instances. benchmark.py (~2.5KB) is the harness that runs that comparison, and maxcut.py is the end-to-end driver: generate or load a graph, solve it, write out the result plot shipped with the repo as maxcut_result.png.

This matters because simulated bifurcation is one of the few quantum-inspired algorithms with credible claims of beating classical heuristics on some combinatorial problems. Having both variants plus a benchmark harness in the same directory turns the repo from a collection of scripts into an experimental bench: you can actually measure whether the ballistic variant's hard-wall dynamics beat the discrete variant on your graph family, on your CPU, today.

What "simulation" actually means here

The word "simulation" deserves precision, because the quantum space is full of inflated claims. Nothing in QuantumLogics runs on a quantum processing unit. What it does is implement algorithms whose design comes from quantum thinking — adiabatic evolution (simulated bifurcation), tensor-network contraction (VQE, DMRG, tensor neural networks), lattice problems (LWE) — as classical programs.

That's less flashy than a "quantum computer in Python", but far more useful. A logistics team could call /api/v1/opt/maxcut this afternoon and get a better vehicle-routing partition than a greedy heuristic. A student can read 60 lines of LWE code and understand the actual construction behind post-quantum cryptography standards. A researcher can prototype tensor-network ideas without learning a quantum SDK. The repo's README never claims quantum advantage, and the code never pretends to need a QPU — that restraint is a feature.

Tensor networks are a class of mathematical tools for classically simulating quantum many-body systems. The core idea is to decompose a high-dimensional tensor into a contraction diagram of several lower-dimensional tensors according to the system's structure, thereby compressing an exponential state space down to polynomial scale. Common representations include MPS (matrix product states), PEPS, MERA, and others. DMRG (density matrix renormalization group) iteratively optimizes the ground state via MPS and is one of the most successful classical algorithms for 1D strongly correlated electron systems; VQE (variational quantum eigensolver) was originally a quantum-classical hybrid algorithm, but on small molecules its variational state can be simulated directly with tensor networks. A tensor neural network represents the network weights as a tensor network, so that inference can exploit low-rank structure to reduce the parameter count. Understanding this makes it clear: the AI, chemistry, and physics modules in this repo share the same mathematical skeleton — structured factorization of high-dimensional states — just dressed in different application-specific clothing.

The service layer as a product decision

Wrapping eight research modules in a single FastAPI app is a deliberate product decision, not just a convenience. Each endpoint is a typed contract: edge list in, spins and energy out; prompt in, inference result out. That turns "interesting script" into something a frontend, a pipeline, or another service can call. serve.py plus docker-compose.yml means the whole thing deploys as one unit, with the Dockerfile pinning the environment so the PyTorch version the solver was written against is the one that runs.

If you're evaluating this as infrastructure rather than education, the right question is the benchmark: on your problem instances, does the bSB solver beat your current optimizer by enough to justify the HTTP hop? The repo gives you the tool to answer that — benchmark.py is the most commercially relevant file in the project.

FAQ

Is this a real quantum computer?

No — and it doesn't claim to be. It's a classical simulation stack: quantum-inspired algorithms (simulated bifurcation, tensor networks, lattice cryptography) running on ordinary CPUs via PyTorch. The focus is accessibility, not quantum advantage.

What can I do with it today?

Solve Max-Cut/QUBO optimization problems over HTTP, generate LWE lattice key pairs, and experiment with tensor-network AI, VQE chemistry, DMRG physics, and surface-code error correction — all from one FastAPI service or by running modules directly.

What's the catch?

The Rust acceleration layer is currently a stub, several modules are thin prototypes, and there are no published benchmarks against classical baselines yet. Treat it as a research codebase to build on, not a finished library.

The bottom line

QuantumLogics is a genuinely implemented tour of quantum-inspired computing on classical hardware, with its best work in the bSB optimizer and the LWE crypto module, served through a clean 8-endpoint API. The repo is public at github.com/Shivay00001/quantumlogics — start with python vq-logics-opt/maxcut.py and watch classical hardware do quantum-style solving.

One-line Summary

QuantumLogics is an open-source quantum-inspired algorithm simulation stack that runs combinatorial optimization, post-quantum crypto, and tensor-network AI on ordinary CPUs via Python and FastAPI.

Paragraph Summary

QuantumLogics is a runnable open-source research prototype that gathers quantum-inspired algorithms into a modular Python stack, exposed through eight typed FastAPI endpoints. Its strongest modules are a ballistic-simulated-bifurcation (bSB) Max-Cut/QUBO solver and a post-quantum crypto demo implementing a real LWE lattice construction; it also includes tensor-network AI, molecular VQE, DMRG many-body simulation, amplitude-estimation Monte Carlo, surface-code error correction, and meta-routing proof-of-concept modules. The author is honest about the boundaries: this is classical simulation rather than quantum hardware, the Rust acceleration layer is still a placeholder, most modules are teaching-grade implementations, and there are no published benchmarks against classical baselines yet. It's a good starting point for learning quantum-inspired algorithms or a workbench for combinatorial optimization prototyping.

#QuantumLogics#quantum-inspired computing#simulated bifurcation#post-quantum cryptography#LWE#tensor networks#FastAPI#combinatorial optimization#Max-Cut#QUBO#DMRG#VQE
Share:

Related articles