Q.ANT toolkit guide
Learn what the Q.ANT Native Computing Toolkit does, how its Python API is organised, and which of the official examples to run first.
The Q.ANT Native Computing Toolkit is the official API for running workloads on Q.ANT Native Processing Units (NPUs). An NPU is a photonic processor on a PCIe card. It computes multiplications and a cosine-like function with light, and the toolkit gives you a NumPy interface to those operations.
This guide is independent and unofficial. It walks through the toolkit and its official examples, and it states which steps we ran ourselves and on what. For the authoritative reference, see the official documentation.
About the toolkit
| Item | Details |
|---|---|
| Version | 2.3.1 |
| Licence | Apache License 2.0 |
| Open sourced | 23 September 2026 |
| Core language | Rust |
| Python package | A wheel, imported as qant_native_computing_toolkit |
| C and C++ package | A Debian .deb package with a shared library |
| Source | Toolkit repository and examples repository |
The toolkit comes in two builds:
- default links against the Q.ANT driver and runs on a physical card.
- cpu-backend is a standalone CPU emulator for development without hardware.
Every result in this guide comes from the cpu-backend build, version 2.3.1, unless a page says otherwise.
Who this guide is for
This guide is for developers who know Python and NumPy and want to try photonic inference before they have access to hardware. You don’t need a background in optics. If you have trained a small network in PyTorch, you have enough context for every example.
The Python modules
The Python API is grouped into five submodules.
| Module | Purpose | Main functions |
|---|---|---|
generic | Find and manage devices. | get_available_npus, init_npu, release_npu |
native | Run the operations the NPU computes directly. | mul_elementwise, linear_fprop, calc_scaled_periodic_nl_fprop |
ai | Run neural network layers. | linear_fprop, conv_fprop, conv_transpose_fprop, add_bias_fprop, relu_fprop, sigmoid_fprop, softmax_fprop, calc_kan_layer_fprop, batchnorm2d_fprop, the four pooling functions |
info | Read driver, sensor, version and performance information, and set up logging. | get_driver_info, get_sensor_info, get_version_info, get_perf_counter, reset_perf_counter, setup_logging |
utils | Prepare memory for the device. | align_ndarray_page_boundary |
A first call looks like this:
import numpy as np
from ml_dtypes import bfloat16
import qant_native_computing_toolkit as q
x = np.random.rand(100, 10).astype(bfloat16)
y = np.random.rand(100, 10).astype(bfloat16)
r = q.native.mul_elementwise(x, y)
Start here
- Install the toolkit. The CPU emulator path needs no hardware.
- Read Key concepts for the rules that every example relies on.
- Run the introduction notebook, which tests each operation against PyTorch.
- Pick an example from the table below.
The official examples
The examples repository has six Python examples. We ran them on the toolkit 2.3.1 CPU emulator on 8 October 2026, using commit 2b6cf9a of the examples repository.
| Example | What it teaches | Ran on the emulator here |
|---|---|---|
| Introduction to the operations | Calls each of 15 operations and compares the result with PyTorch. | Yes. 1 test passed. |
| Digit recognition | Runs a two-layer MNIST classifier from pretrained weights. | Yes. 2 tests passed. |
| Fourier network | Trains on the host with PyTorch, then runs inference through the toolkit, including the KAN layer. | Yes. 1 test passed. |
| Image recognition | Builds ResNet-18 from toolkit layers and classifies photos. | Yes. 1 test passed. |
| Image segmentation | Builds a UNet for brain MRI segmentation. | No. The pretrained model download was blocked in our sandbox. |
| Parallel execution | Spreads matrix-vector work across several NPUs with one process per device. | Yes, with one emulated NPU. 1 test passed. |
What’s next
- Install the toolkit and verify it with one command.
- Try the cosine layer in your browser with the live example.
- Look up an error message in Troubleshooting.