Metadata-Version: 2.4
Name: axiom-lumis
Version: 0.1.3
Summary: LUMIS photonic mesh compiler: analytic Clements decomposition with Rev 1 power-envelope admission control. Pre-silicon, simulation backend.
Author-email: Axiom Photonics Ltd <developer@carecomply.ltd>
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://axiomprocessor.com
Project-URL: Licences, https://axiomprocessor.com/sdk
Keywords: photonics,clements,mzi,optical computing,compiler
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.24

# LUMIS SDK

Compile any unitary matrix into the exact rectangular MZI mesh of a LUMIS photonic node, and find out what Rev 1 silicon would need to run it.

The chip is pre-silicon. The compiler is not: it is the analytic Clements decomposition (Clements et al., *Optica* 3, 1460, 2016), deterministic, with reconstruction error at machine precision. Every figure the SDK reports for power and latency is a Rev 1 **design target**, and it says so.

```
pip install axiom-lumis
```

```python
import numpy as np
from axiom_lumis import Compiler, haar_unitary

prog = Compiler().compile(haar_unitary(16, seed=1))
print(prog.summary())
```

```
LUMIS program: 16x16 unitary
  MZI cells        : 120
  mesh depth       : 16 columns
  reconstruction   : 5.47e-16 max error
  static power     : 6.812 W (drivers+laser 6.8 W + mesh hold)
  total power      : 6.812 W of 8.00 W envelope
  rewrite headroom : up to 98 MHz full-mesh rewrite inside the envelope
  transit latency  : 80 fs (design figure, excludes I/O)
  backend          : simulation
```

The `total power` line is the whole claim: it is the steady-state hold of the
mesh *plus* any rewrite schedule, checked against the 8 W envelope at compile
time. A program only exists if that number fit.

Command line:

```
lumis compile -n 8                            # random 8x8 unitary
lumis compile weights.npy                     # your own matrix (.npy or .json)
lumis compile -n 16 --rate 1e6 --alpha 0.1    # with a weight-streaming schedule
lumis compile -n 64 --export mesh.json        # write phases + cells to a file
lumis batch a.npy b.npy c.npy -o meshes/      # compile several at once
lumis bench -n 16
```

## Run your own layer through it

A mesh computes a unitary; a trained layer is not one. Factor it with an SVD
(`W = U · diag(s) · Vh`): the two unitaries become meshes, the singular values
become per-channel attenuators. `examples/compile_layer.py` does this for any
matrix up to 64 on each side:

```
python examples/compile_layer.py weights.npy
```

```
layer            : 64x64, padded to 64x64
meshes           : 2 x 64-mode  (2016 + 2016 MZIs, depth 64 + 64)
attenuators      : 64 (singular values, dynamic range 219.8x)
reconstruction   : 7.41e-15 max error vs original
static power     : 7.00 W per mesh (design figure); a full 64-mode mesh holds at 7.00 W of one node's 8.00 W envelope
nodes needed     : 2 (one per mesh), or 2 passes through one node with a weight rewrite between them
transit latency  : 640 fs for both meshes (design figure, excludes I/O)
max full rewrite : 82,788,310 Hz inside the envelope
```

Two things that output tells you honestly: a general 64x64 layer needs two
nodes or two passes, and a layer bigger than 64 on a side has to be tiled.
If you want this done for a whole model, with the tiling, the attenuator
dynamic range and the pass scheduling worked out, that is the Feasibility
Study: https://axiomprocessor.com/services

## Feasibility study for a whole model

`lumis study` takes a model's dense layers and reports what Rev 1 would need to
run it: how each layer tiles onto 64-mode meshes, how many nodes or passes, and
the optical compute time. This is the engine behind an Axiom Feasibility Study.

```
lumis study                     # a sample MLP classifier
lumis study model.json -o study.md   # your own model, written to a file
```

`model.json` is `{"name": "...", "layers": [["fc1", 256, 784], ...]}` with each
layer `[name, out_features, in_features]`. The report labels every power and
latency figure as a design target and is reproducible by anyone with the SDK.

## What it enforces

- **Unitarity.** Non-unitary input is refused. For a general weight matrix, factor it first (SVD gives two unitaries and a diagonal).
- **The power envelope.** Admission is on *total* node power — the mesh's steady-state hold plus any rewrite schedule. Anything over the 8 W envelope raises `PowerEnvelopeViolation` with the arithmetic attached, and the number it checks is the same one `summary()` prints. There is no throttle path and no way to admit a program that reports itself over budget.
- **Reality.** `backend="hardware"` raises `HardwareNotFabricatedError` until silicon exists.

## Tiers

This is a dual licence, not a feature gate. Every tier runs the same complete
compiler — the full 64-mode node, the simulation backend, `batch` and
`--export` — because research and evaluation should have no friction. The paid
tiers grant the right to use the output commercially and add support.

| Tier | Price | What it grants |
|---|---|---|
| Free | £0 | The whole SDK, for research and evaluation |
| Pro | £490 / seat / year | Commercial-use licence and priority support. Set `LUMIS_LICENSE_KEY`. |
| Team | £1,950 / 5 seats / year | Pro for a whole team, plus onboarding |

Licences: https://axiomprocessor.com/sdk

## Figures and their status

| Figure | Source | Status |
|---|---|---|
| MZI count, depth, reconstruction error | computed | measured, exact |
| Node envelope 8 W, driver + laser floor 6.8 W, reprogram energy 12.1 nJ | whitepaper §09 thermal profile | design model |
| < 0.2 W full-mesh static hold, 320 fs mesh transit | Rev 1 physics model | design target |

The old 3.9 mW-per-MZI thermo-optic figure is gone: Rev 1 uses electro-optic (Pockels, TFLN/BTO) phase shifters that hold a voltage rather than draw a tuning current, so the mesh's static load is set by driver leakage (< 0.2 W across a full mesh), not per-MZI heating.

© Axiom Photonics Ltd. Proprietary; see licence terms at the link above.
