A high-performance Rust framework for simulating 5-dimensional optical data storage. This software models how digital data can be encoded into photonic voxels using multiple physical properties of light: intensity, polarization, phase, and wavelength.
Research Context: This framework provides an open-source testbed for exploring encoding algorithms suitable for next-generation optical storage systems such as Microsoft Project Silica and 5D glass memory technologies.
- Quick Start
- Theoretical Background
- Mathematical Model
- System Architecture
- Encoding Scheme
- Error Correction
- Steganographic Properties
- Experimental Results
- Reproduction Guide
- API Reference
- Citation
- License
- Rust 1.75 or higher
- Cargo (included with Rust)
git clone https://github.com/iberi22/photon-core.git
cd photon-core
cargo build --releasecargo run --example demoExpected output:
=== 5D Optical Data Storage PoC ===
Original Data: "Hello, 5D World!"
[Encoding] Generated 16 voxels.
[Decoding] Authorized Read (with noise):
Result: "Hello, 5D World!"
>> SUCCESS: Data recovered correctly despite noise.
[Security] Attempting Unauthorized Read (Ignoring Polarization)...
>> SECURITY VERIFIED: Unauthorized read failed to retrieve data.
Traditional storage media (HDD, SSD, optical discs) encode data in 2D surfaces or 3D volumes. 5D optical storage extends this by exploiting additional physical dimensions of light:
| Dimension | Physical Property | Information Carrier |
|---|---|---|
| 1-3 | Spatial Position (X, Y, Z) | Voxel location in crystal lattice |
| 4 | Intensity / Retardance | Amplitude of birefringent nanostructure |
| 5 | Polarization Orientation | Slow-axis angle of nanostructure |
| + | Phase | Optical path difference |
| + | Wavelength | Spectral multiplexing |
When a femtosecond laser pulse is focused inside fused silica glass, it creates self-assembled nanogratings through a nonlinear optical process. These nanogratings exhibit:
-
Form Birefringence: The nanostructure acts as a uniaxial crystal with controllable:
- Slow-axis orientation (polarization angle)
- Retardance magnitude (intensity)
-
Spatial Selectivity: Laser focus can be steered in 3D, creating volumetric data storage.
-
Permanence: Modifications are stable for billions of years at room temperature.
We define a Photonic Voxel as the atomic unit of storage:
Where:
-
$I \in [0, 1]$ : Normalized intensity (retardance magnitude) -
$\theta \in [0, \pi)$ : Polarization angle (slow-axis orientation) -
$\phi \in [0, 2\pi)$ : Optical phase -
$\lambda \in \mathbb{R}^+$ : Wavelength in nanometers
The encoding function
Where
Intensity Mapping (bits 0-1):
| 00 | 0.25 |
| 01 | 0.50 |
| 10 | 0.75 |
| 11 | 1.00 |
Polarization Mapping (bits 2-3):
|
|
|
|
|---|---|---|
| 00 | 0 | 0Β° |
| 01 | Ο/4 | 45Β° |
| 10 | Ο/2 | 90Β° |
| 11 | 3Ο/4 | 135Β° |
Phase Mapping (bits 4-5):
|
|
|
|
|---|---|---|
| 00 | 0 | 0Β° |
| 01 | Ο/2 | 90Β° |
| 10 | Ο | 180Β° |
| 11 | 3Ο/2 | 270Β° |
Wavelength Mapping (bits 6-7):
|
|
Color | |
|---|---|---|
| 00 | 532 | Green |
| 01 | 650 | Red |
| 10 | 450 | Blue |
| 11 | 800 | Near-IR |
The decoding function
For each dimension, we find the closest discrete level:
Physical readout introduces Gaussian noise to each dimension:
Where:
-
$\sigma_I \approx 0.05$ (5% intensity noise) -
$\sigma_\theta \approx 0.08$ rad (β4.6Β° polarization jitter) -
$\sigma_\phi \approx 0.10$ rad (β5.7Β° phase noise) -
$\sigma_\lambda \approx 10$ nm (wavelength drift)
| Metric | Value |
|---|---|
| Bits per voxel | 8 (2 bits Γ 4 dimensions) |
| Bytes per voxel | 1 |
| Voxel memory footprint | 16 bytes (4 Γ f32) |
| Encoding overhead | 16:1 (simulation artifact) |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Interface β
β βββββββββββ βββββββββββ βββββββββββ βββββββββββββββββββ β
β β CLI β β Demo β β Tests β β Benchmarks β β
β ββββββ¬βββββ ββββββ¬βββββ ββββββ¬βββββ ββββββββββ¬βββββββββ β
βββββββββΌβββββββββββββΌβββββββββββββΌβββββββββββββββββΌβββββββββββ
β β β β
βββββββββΌβββββββββββββΌβββββββββββββΌβββββββββββββββββΌβββββββββββ
β photon_core β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β codec.rs β β
β β encode_data() ββββββββββββββββββββΊ decode_data() β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββββ ββββββββββββββ ββββββββββββββ β
β β structs.rs β β physics.rs β β security.rsβ β
β β PhotonicV. β β Crosstalk β β Stegano. β β
β ββββββββββββββ ββββββββββββββ ββββββββββββββ β
β ββββββββββββββ ββββββββββββββ β
β β ecc.rs β β analysis.rsβ β
β β Reed-Sol. β β BER Sim. β β
β ββββββββββββββ ββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Module | Purpose |
|---|---|
structs.rs |
Defines PhotonicVoxel struct (16-byte aligned) |
codec.rs |
Bidirectional encoding/decoding with noise simulation |
ecc.rs |
Reed-Solomon error correction (10 data + 4 parity shards) |
physics.rs |
3D crosstalk/ISI simulation |
security.rs |
Steganography demonstration |
analysis.rs |
Bit Error Rate (BER) simulation tools |
#[repr(C)]
pub struct PhotonicVoxel {
pub intensity: f32, // [0.25, 1.0] - 2 bits
pub polarization: f32, // [0, Ο) rad - 2 bits
pub phase: f32, // [0, 2Ο) rad - 2 bits
pub wavelength: f32, // nm - 2 bits
}
// Total: 16 bytes, cache-line friendlyByte: [b7 b6 | b5 b4 | b3 b2 | b1 b0]
ββββ¬βββ ββββ¬βββ ββββ¬βββ ββββ¬βββ
β β β β β β β βββ Intensity (2 bits)
β β β β β ββββββββββββ Polarization (2 bits)
β β β βββββββββββββββββββ Phase (2 bits)
β ββββββββββββββββββββββββββ Wavelength (2 bits)
| Parameter | Value |
|---|---|
| Data shards | 10 |
| Parity shards | 4 |
| Total shards | 14 |
| Overhead | 40% |
| Correction capability | Up to 4 erasures or 2 errors |
// Add ECC to data
let protected = add_error_correction(&data);
// Recover with potential errors
let recovered = recover_error_correction(&protected)?;The polarization dimension provides inherent data hiding:
- Authorized reader: Knows to read all 4 dimensions β correct data
- Unauthorized reader: Ignores polarization β corrupted data
// Authorized read
let correct = decode_data(&voxels, false); // β Original data
// Simulated unauthorized read (polarization = 0)
let stolen = read_ignoring_polarization(&voxels); // β GarbageWhen polarization is ignored:
- Bits 2-3 (polarization) are always read as
00 - Expected BER: 25% (2 bits wrong out of 8)
- Actual data becomes unrecoverable without the polarization key
| Operation | Time (1KB) | Throughput |
|---|---|---|
| Encoding | 2.1 Β΅s | 476 MB/s |
| Decoding (clean) | 9.6 Β΅s | 104 MB/s |
| Decoding (noisy) | 22.5 Β΅s | 44 MB/s |
Run BER experiment:
cargo run --release -- experiment --max-noise 0.3 --output ber_results.csvResults:
| Noise Amplitude | BER |
|---|---|
| 0.00 | 0.00000 |
| 0.05 | 0.00000 |
| 0.10 | 0.00012 |
| 0.15 | 0.00891 |
| 0.20 | 0.03254 |
| 0.25 | 0.05513 |
| 0.30 | 0.07166 |
Observation: The codec tolerates up to ~6% noise amplitude before significant degradation, thanks to the discrete quantization levels providing noise margins.
git clone https://github.com/iberi22/photon-core.git
cd photon-core
cargo build --releasecargo testExpected:
running 5 tests
test test_empty_input ... ok
test test_round_trip_noiseless ... ok
test test_round_trip_with_noise ... ok
test test_steganography_effectiveness ... ok
test test_codec_roundtrip_noiseless ... ok
test result: ok. 5 passed
cargo run --example demoEncode a file:
echo "Hello, 5D optical storage!" > test.txt
cargo run --release -- encode --input test.txt --output test.vox --eccDecode with noise simulation:
cargo run --release -- decode --input test.vox --output recovered.txt --noise
cat recovered.txtcargo benchcargo run --release -- experiment --max-noise 0.4 --output ber_data.csvuse photon_core::{encode_data, decode_data, PhotonicVoxel};
// Encode bytes to voxels
let voxels: Vec<PhotonicVoxel> = encode_data(&data);
// Decode voxels to bytes (with optional noise simulation)
let recovered: Vec<u8> = decode_data(&voxels, simulate_noise);use photon_core::{add_error_correction, recover_error_correction};
// Add Reed-Solomon parity
let protected = add_error_correction(&data);
// Recover and verify
let original = recover_error_correction(&protected)?;use photon_core::run_ber_simulation;
// Run BER experiment
let results = run_ber_simulation(
data_size, // bytes to test
steps, // noise level steps
max_noise // maximum noise amplitude
);If you use this software in your research, please cite:
@software{belalcazar2026photoncore,
author = {Belalcazar, Ivan},
title = {Photon-Core: A Rust-based Simulation Framework for
High-Density 5D Optical Data Encoding},
year = {2026},
publisher = {GitHub},
url = {https://github.com/iberi22/photon-core}
}Or use the CITATION.cff file in this repository.
- Wang, Y. et al. (2024). "5D optical data storage in silica glass." Nature Photonics.
- Zhang, Y. et al. (2025). "Multi-layer 5D Optical Data Storage: Mathematical Modeling and Deep Learning-Based Reconstruction." arXiv:2508.20106.
- Microsoft Research. "Project Silica." https://www.microsoft.com/en-us/research/project/project-silica/
MIT License - see LICENSE file.
Contributions are welcome! Please open an issue or submit a pull request.
# Run tests
cargo test
# Run clippy
cargo clippy
# Format code
cargo fmtAuthor: brahyan S. Belalcazar (@iberi22) Contact: [email protected]