OptixLog Documentation
Welcome to the OptixLog documentation! OptixLog is an experiment tracking platform for photonic simulations and hardware testing.
What is OptixLog?
OptixLog helps you track, visualize, and compare your photonic simulations and hardware test results. Whether you’re running FDTD simulations, testing optical components, or automating hardware measurements, OptixLog provides the tools you need to stay organized and productive.
Quick Start
For Python Simulations
import optixlog
with optixlog.run("my_experiment", project="MyProject", config={"wavelength": 1.55}) as client:
for step in range(100):
result = simulate_step(step)
client.log(step=step, loss=result)
# Log plots with one line!
client.log_matplotlib("field_plot", fig)For Code Instrumentation
# Install CLI
npm install -g optixlog-cli
# Initialize
optixlog init --project "MyProject" --api-key "proj_xxx"
# Instrument your code
optixlog add-logging script.py --smart
# Run
python script.pySDK vs CLI
| Feature | SDK | CLI |
|---|---|---|
| Purpose | Runtime logging during execution | Code instrumentation before execution |
| When to use | When writing new code or modifying existing code | When adding logging to existing scripts |
| Language | Python | Node.js/TypeScript |
| Installation | pip install http://optixlog.com/optixlog-0.0.4-py3-none-any.whl | npm install -g optixlog-cli |
| Workflow | Import → Log → View | Transform → Run → View |
When to Use SDK
- Writing new simulation code
- Need fine-grained control over logging
- Want to use helper methods (
log_matplotlib(),log_plot(), etc.) - Need programmatic query access
- Working with MPI parallel simulations
When to Use CLI
- Adding logging to existing scripts
- Batch processing multiple files
- Team collaboration (shared configs)
- CI/CD automation
- Quick instrumentation without code changes
Documentation Structure
SDK Documentation
- Overview - Features, architecture, use cases
- Installation - Setup and prerequisites
- Quick Start - Get started in minutes
- API Reference - Complete function reference
- Examples - Real-world code samples
- MPI Support - Parallel simulation guide
- Advanced Usage - Best practices and patterns
- Troubleshooting - Common issues and solutions
CLI Documentation
- Overview - Features and use cases
- Installation - Binary and development setup
- Quick Start - First transformation
- Commands - Complete command reference
- Examples - Before/after transformations
- Advanced Usage - Batch processing, CI/CD
- Troubleshooting - Platform-specific issues
Additional Topics
- Hardware Testing - SCPI automation guide
Getting Started
1. Get Your API Key
Visit https://optixlog.com to get your API key.
2. Choose Your Workflow
Option A: Use SDK (Recommended for new code)
pip install http://optixlog.com/optixlog-0.0.4-py3-none-any.whl
export OPTIX_API_KEY="proj_your_key"Option B: Use CLI (Recommended for existing code)
npm install -g optixlog-cli
optixlog init --project "MyProject" --api-key "proj_your_key"3. Start Logging
With SDK:
import optixlog
with optixlog.run("my_experiment", project="MyProject") as client:
client.log(step=0, loss=0.5)With CLI:
optixlog add-logging script.py --smart
python script.py4. View Results
Visit https://optixlog.com to view your runs, or use the CLI:
optixlog runsUse Cases
Photonic Simulations
Track FDTD simulations with Meep, Tidy3D, or custom solvers:
with optixlog.run("waveguide_sim", project="MyProject", config={"wavelength": 1.55, "resolution": 30}) as client:
sim = mp.Simulation(...)
for step in range(100):
sim.run(until=1)
power = calculate_power(sim)
client.log(step=step, power=power)
# Log field snapshot with one line!
if step % 10 == 0:
field = sim.get_array(...)
client.log_array_as_image("field_snapshot", field, cmap='RdBu')Hardware Testing
Automate test equipment with SCPI and log results:
with optixlog.run("power_measurement", project="MyProject") as client:
for wavelength in wavelengths:
power = power_meter.query(':MEAS:POW?')
client.log(step=i, wavelength=wavelength, power=power)Parameter Sweeps
Systematically explore parameter spaces:
for wavelength in wavelengths:
with optixlog.run(f"sweep_{wavelength}", project="MyProject", config={"wavelength": wavelength}) as client:
result = simulate(wavelength)
client.log(step=0, transmission=result)Team Collaboration
Share experiments and results with your team:
# Team member 1: Create shared config
optixlog init --project "TeamProject" --local
# Team member 2: Use shared config
optixlog config set api_key "proj_their_key"
optixlog add-logging shared_code.pyNext Steps
- SDK Quick Start - Get started with the SDK
- CLI Quick Start - Get started with the CLI
- Hardware Testing - Automate test equipment
- Examples - See real-world examples
Support
- Documentation: Browse the sections in the sidebar
- API Reference: Complete SDK reference
- Examples: Real-world code samples
- Troubleshooting: Common issues and solutions
Ready to get started? Choose your path:
- SDK Quick Start - For Python developers
- CLI Quick Start - For quick instrumentation