Skip to content

blackeagle686/phx-ptc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

153 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHX-PTC ⚡

Photonic Computing Platform — A from-scratch C++17 engine that maps GPU architecture and deep learning concepts from binary/electronic logic into photonic (wave-based) logic.

Transistors process voltages. Photonic elements process waves.


Quantum Simulator: PHX-QUANTUM

Project Visualizations

Photonic Processing Engine

PHX-PTC Architecture

Optical Neural Network Layer (ONN)

ONN FFN Diagram

Wave Non-linearity (Tanh)

Tanh Representation

Phase 1: Photonic Activation Functions

Maps the 4 foundational neural network activations to their physical optical counterparts:

Electronic Photonic Physical Device
ReLU max(0,x) Saturable Absorber Intensity thresholding via bleaching
Sigmoid 1/(1+e⁻ˣ) MZI Modulation cos² interference S-curve
Tanh Optical Bistability Phase-flip non-linearity [-1,+1]
Softmax Cross-Gain Modulation Shared laser gain competition

Build

Requires: C++17 compiler (MSVC, GCC, Clang), CMake ≥ 3.20

cmake -S . -B build -G "Visual Studio 17 2022" -A x64
cmake --build build --config Release

Run

# Full demo with all activations + ASCII transfer curves
.\build\runtime\Release\phx-ptc.exe all

# Individual activation demos
.\build\runtime\Release\phx-ptc.exe relu
.\build\runtime\Release\phx-ptc.exe sigmoid
.\build\runtime\Release\phx-ptc.exe tanh
.\build\runtime\Release\phx-ptc.exe softmax

# Electronic vs Photonic comparison
.\build\runtime\Release\phx-ptc.exe compare

# Photonic neuron example
.\build\examples\Release\photonic_neuron.exe

# Interactive Optical Neural Network layer
.\build\examples\Release\onn_ffn.exe

Test

cd build && ctest --output-on-failure -C Release

Architecture

phx-ptc/
├── core/           # Wave types — replaces binary voltage signals
│   ├── types.h     # Complex, Intensity, Phase, constants
│   └── wave.h      # Wave (ψ), WaveChannel (WDM)
├── photonic/       # Optical processing elements
│   ├── element.h   # PhotonicElement / MultiChannelElement interfaces
│   ├── relu_sa     # Saturable Absorber (ReLU)
│   ├── sigmoid_mzi # Mach-Zehnder Interferometer (Sigmoid)
│   ├── tanh_bistable # Optical Bistability (Tanh)
│   └── softmax_xgm  # Cross-Gain Modulation (Softmax)
├── runtime/        # CLI with ASCII transfer curves
├── tests/          # 5 test suites (50+ test cases)
└── examples/       # Photonic neuron demo

Roadmap

  • Phase 1 — Photonic Activation Functions
  • Phase 2 — MZI Mesh Linear Transform (replaces nn.Linear)
  • Phase 3 — Photonic Processing Element (PPE)
  • Phase 4 — Photonic Core & Kernel Abstraction
  • Phase 5 — Hybrid integration with phx-quantum PHX-QUANTUM

Zero Dependencies

Built entirely from scratch in C++17. No Eigen, no Boost, no external libraries.

License

MIT Mohammed ALaa

About

PHX-PTC ⚡Photonic Computing Platform: from-scratch C++17 engine that maps GPU architecture and deep learning concepts from binary/electronic logic into photonic (wave-based) logic.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors