Beyond the Transistor

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

ItemDetails
Version2.3.1
LicenceApache License 2.0
Open sourced23 September 2026
Core languageRust
Python packageA wheel, imported as qant_native_computing_toolkit
C and C++ packageA Debian .deb package with a shared library
SourceToolkit 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.

ModulePurposeMain functions
genericFind and manage devices.get_available_npus, init_npu, release_npu
nativeRun the operations the NPU computes directly.mul_elementwise, linear_fprop, calc_scaled_periodic_nl_fprop
aiRun 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
infoRead 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
utilsPrepare 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

  1. Install the toolkit. The CPU emulator path needs no hardware.
  2. Read Key concepts for the rules that every example relies on.
  3. Run the introduction notebook, which tests each operation against PyTorch.
  4. 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.

ExampleWhat it teachesRan on the emulator here
Introduction to the operationsCalls each of 15 operations and compares the result with PyTorch.Yes. 1 test passed.
Digit recognitionRuns a two-layer MNIST classifier from pretrained weights.Yes. 2 tests passed.
Fourier networkTrains on the host with PyTorch, then runs inference through the toolkit, including the KAN layer.Yes. 1 test passed.
Image recognitionBuilds ResNet-18 from toolkit layers and classifies photos.Yes. 1 test passed.
Image segmentationBuilds a UNet for brain MRI segmentation.No. The pretrained model download was blocked in our sandbox.
Parallel executionSpreads matrix-vector work across several NPUs with one process per device.Yes, with one emulated NPU. 1 test passed.

What’s next