A mathematical framework and compiler Intermediate Representation (IR) for viewing programs as geometric motion—and compiling software directly into dedicated digital and analog circuits.
Why represent computation solely as sequential text instructions on a general-purpose CPU when physical reality operates on vectors, fields, and oscillations?
Vector Phasor Language (VPL) models a program as a discrete-time Vector Evolution Machine (VEM):
- Program State is a single unified vector combining control flow and data variables in orthogonal subspaces.
-
Loops (
while/for) are phasors ($e^{j\phi}$ ) rotating through phase states rather than imperative jumps. - Conditionals & Neural Activations (e.g., ReLU) are geometric hyperplane guards clamping or redirecting trajectories in state space.
- Parallelism emerges naturally whenever the transition operator decomposes into block-diagonal submatrices—requiring no thread schedulers, locks, or operating system overhead.
Once lowered into VPL IR, high-level algorithms (such as Fast Fourier Transforms or neural network layers) can be synthesized directly into Digital RTL (Verilog/FPGA), Analog/Mixed-Signal Circuits (SPICE), or future Quantum Circuits.
Every VPL IR program is completely defined by the 5-tuple
Control flow
$C(t)$ and program variables/tensors$D(t)$ occupy orthogonal subspaces of a single state vector$X(t)$ . There is no external program counter or separate memory bus.
Execution advances in discrete steps via a coupled affine operator:
$M_{CC}$ drives control transitions,$M_{CD}$ handles data-dependent branching,$M_{DC}$ gates data writes,$M_{DD}$ performs intrinsic arithmetic/matrix multiplication, and$c$ injects constants/biases.
Hyperplane guards are represented by
Iterative loops are cyclic phase rotations (
$e^{j\phi_i}$ ), enabling spatial unrolling versus temporal folding (time-multiplexing). Non-linearities and branches act as hyperplane guards$\mathcal{G} = (C_p, c_p)$ .
Independent operations decompose into block-diagonal submatrices, synthesizing directly into concurrent physical hardware datapaths.
Computation terminates when
$C(t)$ enters an absorbing eigenstate$e_{\mathrm{halt}}$ ($\lambda = 1$ ), projecting the final result$Y_{\mathrm{out}}$ onto physical output pins.
VPL bridges high-level code (Python / C / C++) and formal mathematics into physical hardware through a 6-stage pipeline:
[ Python / C / Neural Graph ]
│
▼
1. Extractor & 2. Translator ──► Lowers AST / computation graph to VPL primitives
│
▼
3. Expander & 4. Phasor Pass ──► Builds block-sparse M, folds phasor cycles, permutes block-diagonals
│
▼
5. VEM Simulator ──► Verifies X(t+1) = M X(t) + c algebraically
│
▼
6. Physical Mapping ──► Emits Digital Verilog (.v) or Analog SPICE (.cir)
| VPL IR Primitive | Digital RTL (Verilog / FPGA) |
Analog / Mixed-Signal (NGSPICE) |
|---|---|---|
| State Vector |
Clocked D-Flip-Flop registers | Sample-and-hold capacitors / node voltages |
| Operator |
Combinational DSP multipliers & adder trees | Conductance crossbar ( |
| Phasor Control |
One-hot / phase-encoded Finite State Machine | Multi-phase non-overlapping clock generator |
| Hyperplane Guard |
Signed comparator + 2:1 multiplexer (ReLU) | Op-amp comparator / precision diode clamp |
| Block Diagonal |
Parallel independent hardware modules | Decoupled analog sub-circuits |
| Projection |
done status wire + output data bus |
Threshold detector + output buffer amplifier |
- Python 3.10+ with
numpy(for IR lowering and algebraic VEM simulation) - (Optional) Icarus Verilog (
iverilog) or Yosys for digital RTL simulation & FPGA synthesis - (Optional) NGSPICE (
ngspice) for analog circuit waveform verification
Lowers a 2-layer ReLU MLP into the 5-tuple VPLProgramIR, verifies the truth table in the algebraic VEM simulator, and emits both Verilog and SPICE netlists:
python examples/xor_vem.py- Simulate Digital RTL (Icarus Verilog):
iverilog -o build/xor_sim generated/vpl_xor_vem.v && vvp build/xor_sim - Simulate Analog Circuit (NGSPICE):
ngspice -b generated/vpl_xor_analog.cir
Demonstrates complex phasor twiddle rotations (
python examples/fft8_vem.pyVPL/
├── compiler/ # VPL IR dataclasses, AST/graph lowering, phasor optimizer, and Verilog/SPICE emitters
├── examples/ # Runnable PoC scripts (While loop, 8-point FFT, 2-layer XOR neural network)
├── paper/ # Mathematical formalism and proofs for the Vector Evolution Machine (VEM)
├── binnacle/ # Research logs, design notes, and architectural experiments
└── LICENSE.md # GNU General Public License v3.0
- Mathematical Foundation: Vector Evolution Machine (VEM) state space, phasor control, and block-diagonal parallelism (
paper/). - Demo 1 — While Loop: Basic iterative state evolution in VPL IR.
- Demo 2 — 2-Layer Neural Network (XOR): Lowering affine layers + ReLU hyperplane guards into Verilog RTL and NGSPICE netlists.
- Demo 3 — Fast Fourier Transform (FFT): 8-point Radix-2 Cooley-Tukey FFT lowered to FPGA fabric via
Yosys/nextpnr. - Demo 4 —
micrograd/ ONNX Frontend: Automated ingestion of small trained neural networks with phasor time-multiplexing. - Future — Quantum Backend: Mapping unitary phasor operators to OpenQASM circuits.
This project is actively evolving and open to mathematical and hardware engineering peer review. If you spot edge cases in the formalism, have suggestions for the IR schema, or want to test generated netlists on FPGA/SPICE toolchains, please open an Issue or submit a Merge Request / Pull Request.
- Author: Lucio Guerchi
- License: GPL-3.0 (see LICENSE.md)
- Transparency Note: Parts of the documentation, prototype code, and hardware emission scripts in this repository were drafted with AI assistance under the author's architectural direction.