# What is an OPU?¶

An Optical Processing Unit is an analog computation device that performs operations using light.

The light beam is generated by a source and shaped by the input device. Then, it follows a complex optical path. It finally reaches the output device, which acquires the incident light intensity.

Using optics, we are accelerating a multiplication by a dense random matrix followed by an element-wise non-linearity:

$\mathbf{Y} = \lvert \mathbf{x} \mathbf{R} \rvert^2 \mbox{ with } \mathbf{R} \mbox{ with complex i.i.d. gaussian entries.}$

In our notation:

• $$\mathbf{x}$$ is the input, a row vector of size $$(n)$$, containing the binary pattern sent to the input device

• $$\mathbf{y}$$ is the output, a row vector of size $$(m)$$, containing uint8 data

• $$\mathbf{R}$$ is the random matrix of size $$(n \times m)$$, containing i.i.d. Gaussian complex values

This operation can scale to very large dimensions, determined by the input and output device capabilities.

When we build OPUs, we carry out a series of tests to make sure that the coefficients are i.i.d.: independent and identically distributed.

## Linear random projection¶

With the release 1.4 of lightonml, it is possible to perform the operation

$\mathbf{Y} = \mathbf{x} \mathbf{R}$

where $$\mathbf{R}$$ is a random matrix with real Gaussian entries.

Technically this operation is a linear combination between real and imaginary part of the transform performed optically, however it is easier to model the operation as above. Note that performing the linear operation currently comes at a 5x speed penalty with respect to the nonlinear mode. Future releases will improve performance.