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
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 |
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# 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.execd build && ctest --output-on-failure -C Releasephx-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
- 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
Built entirely from scratch in C++17. No Eigen, no Boost, no external libraries.
MIT Mohammed ALaa


