Table of Contents
Fetching ...

PhasorFlow: A Python Library for Unit Circle Based Computing

Dibakar Sigdel, Namuna Panday

Abstract

We present PhasorFlow, an open-source Python library introducing a computational paradigm operating on the $S^1$ unit circle. Inputs are encoded as complex phasors $z = e^{iθ}$ on the $N$-Torus ($\mathbb{T}^N$). As computation proceeds via unitary wave interference gates, global norm is preserved while individual components drift into $\mathbb{C}^N$, allowing algorithms to natively leverage continuous geometric gradients for predictive learning. PhasorFlow provides three core contributions. First, we formalize the Phasor Circuit model ($N$ unit circle threads, $M$ gates) and introduce a 22-gate library covering Standard Unitary, Non-Linear, Neuromorphic, and Encoding operations with full matrix algebra simulation. Second, we present the Variational Phasor Circuit (VPC), analogous to Variational Quantum Circuits (VQC), enabling optimization of continuous phase parameters for classical machine learning tasks. Third, we introduce the Phasor Transformer, replacing expensive $QK^TV$ attention with a parameter-free, DFT-based token mixing layer inspired by FNet. We validate PhasorFlow on non-linear spatial classification, time-series prediction, financial volatility detection, and neuromorphic tasks including neural binding and oscillatory associative memory. Our results establish unit circle computing as a deterministic, lightweight, and mathematically principled alternative to classical neural networks and quantum circuits. It operates on classical hardware while sharing quantum mechanics' unitary foundations. PhasorFlow is available at https://github.com/mindverse-computing/phasorflow.

PhasorFlow: A Python Library for Unit Circle Based Computing

Abstract

We present PhasorFlow, an open-source Python library introducing a computational paradigm operating on the unit circle. Inputs are encoded as complex phasors on the -Torus (). As computation proceeds via unitary wave interference gates, global norm is preserved while individual components drift into , allowing algorithms to natively leverage continuous geometric gradients for predictive learning. PhasorFlow provides three core contributions. First, we formalize the Phasor Circuit model ( unit circle threads, gates) and introduce a 22-gate library covering Standard Unitary, Non-Linear, Neuromorphic, and Encoding operations with full matrix algebra simulation. Second, we present the Variational Phasor Circuit (VPC), analogous to Variational Quantum Circuits (VQC), enabling optimization of continuous phase parameters for classical machine learning tasks. Third, we introduce the Phasor Transformer, replacing expensive attention with a parameter-free, DFT-based token mixing layer inspired by FNet. We validate PhasorFlow on non-linear spatial classification, time-series prediction, financial volatility detection, and neuromorphic tasks including neural binding and oscillatory associative memory. Our results establish unit circle computing as a deterministic, lightweight, and mathematically principled alternative to classical neural networks and quantum circuits. It operates on classical hardware while sharing quantum mechanics' unitary foundations. PhasorFlow is available at https://github.com/mindverse-computing/phasorflow.
Paper Structure (84 sections, 7 theorems, 61 equations, 13 figures, 6 tables)

This paper contains 84 sections, 7 theorems, 61 equations, 13 figures, 6 tables.

Key Result

Proposition 2.1

Let $D=\mathrm{diag}(e^{i\theta_1},\dots,e^{i\theta_N})\in U(1)^N$ be a diagonal phase-shift operator with gate parameters $\theta_k\in[0,2\pi)$, and let $\boldsymbol{z}\in\mathbb{T}^N$. Then $D\boldsymbol{z}\in\mathbb{T}^N$.

Figures (13)

  • Figure 1: The three paradigms of computation. PhasorFlow introduces the Unit Circle paradigm as a continuous, deterministic bridge between discrete classical bits and complex, non-deterministic quantum qubits.
  • Figure 2: The geometric evolution of the internal phase manifold strictly depends connecting dimension lines on boundaries. An $N$-thread state resolves mathematically onto the periodic coordinate map of an $N$-Torus ($T^N$).
  • Figure 3: An example of an $N=5$ continuous Phasor Circuit constructed from parameterized Shift ($S$) gates and fixed entangling Mix ($M$) gates, visually analogous to a parameterized quantum circuit cascade.
  • Figure 4: Circuit representation of the Shift gate acting on a single computation thread.
  • Figure 5: Circuit representation of the Mix gate, entangling two adjacent continuous phase threads.
  • ...and 8 more figures

Theorems & Definitions (13)

  • Definition 2.1: Phasor Circuit State
  • Proposition 2.1: Torus-Preserving Diagonal Action
  • proof
  • Theorem 2.1: Unitary Energy Conservation with Coordinate Drift
  • proof
  • Corollary 2.2: Ambient-Space Propagation
  • Remark 2.1: State Space vs. Operator Space
  • Definition 3.1: Single-Layer VPC Operator
  • Corollary 3.1: Deterministic VPC Readout
  • Proposition 3.1: Linear Parameter Footprint of VPC
  • ...and 3 more