Optical computing harnesses the speed of light to perform vector-matrix operations efficiently. It leverages interference, a cornerstone of quantum computing algorithms, to enable parallel computations. In this work, we interweave quantum computing with classical structured light by formulating the process of photonic matrix multiplication using quantum mechanical principles such as state superposition and subsequently demonstrate a well-known algorithm, namely, Deutsch–Jozsa’s algorithm. This is accomplished by elucidating the inherent tensor product structure within the Cartesian transverse degrees of freedom of light, which is the main resource for optical vector-matrix multiplication. To this end, we establish a discrete basis using localized Gaussian modes arranged in a lattice formation and demonstrate the operation of a Hadamard gate. Leveraging the reprogrammable and digital capabilities of spatial light modulators, coupled with Fourier transforms by lenses, our approach proves adaptable to various algorithms. Therefore, our work advances the use of structured light for quantum information processing.

Controlling various degrees of freedom of light, i.e., time, frequency, space, and momentum, has become an emerging and promising tool for numerous information processing tasks in classical and quantum domains, ranging from novel imaging methods1–7 to communications8–13 to computations,14–17 all harnessing the high dimensional nature of structured light fields.18–22 This is because spatial modes enable information encoding in qudit spaces for dimensions d > 2 per particle as opposed to the d = 2 (qubits) encoding levels offered by traditional qubit encoding, such as with polarization states. Because qubits are easy to control, they are a reliable resource for numerous protocols.

In traditional quantum computing, encoding basis states are typically formed from multiple qubits, and the operations needed to construct arbitrary unitary gates in d > 2 dimensions often involve a mix of two-dimensional gate operations (such as the Hadamard gate and T-gate) along with multi-qubit operations (such as the Control-not gate).23 This allows for precise and efficient execution of arbitrary computations that are required to demonstrate quantum advantage.24 Given that each qubit is restricted to two dimensions, the only way to enhance encoding capacity is by increasing the number of qubits and ensuring optimal connectivity among them. An alternative is to utilize qudits, which are particles that occupy d > 2 dimensions because they offer larger encoding state spaces25 and promise robustness against noise.26 As a result, structured photon states emerge as a promising candidate for achieving this, as they occupy higher-dimensional Hilbert spaces. Furthermore, it has been demonstrated that vector-matrix multiplication, a fundamental operation in quantum mechanics, can be performed using transverse optical fields.27 

There have been numerous impressive proposals and implementations of quantum computing algorithms that utilize the higher dimensional nature of the internal degrees of freedom of photons.28–30 This field has developed tremendously, aided by the advent of multiplane light conversion technology,31 where digital holography and free-space diffraction are employed to realize arbitrary unitary gate operations.32 Inspired by these advances, diffraction-based deep neural network architectures have also been proposed.33 In addition, harnessing mode mixing in complex media such as multimodal optical fibers, as opposed to diffractive MPLCs, has emerged as a potential avenue (see review on this topic34) to achieve similar operations but with discrete pixel-like states.35 To realize the full potential of qudits for quantum computing, efficient single photon sources and the tools for entangling and controlling them are necessary.

On the other hand, harnessing classical optical fields for quantum computing has also been an active area of research.14,36–40 The drive in this field has been inspired by the observation that some of the essential resources of quantum computing can be found in classical coherent fields. Similar to quantum states, classical waves can be prepared in superpositions and can be interfered with, allowing for parallel information processing. Notably, Jozsa also argued that classical waves can provide an efficient simulation platform since not all quantum algorithms require entanglement as a resource.41,42 Recent advances have demonstrated that optical methods can implement unitary and nonunitary transformations efficiently, utilizing programmable holographic techniques and spatial phase modulation to enable high-dimensional operations.43 Similarly, parallel processing for computational tasks such as multiplication modulo, a crucial component of Shor’s algorithm, using phase modulation has been explored, offering promising avenues for structured light applications in computational tasks.44 This opens up new possibilities for studying or implementing quantum computational tasks without relying on complex quantum hardware by merely exploiting coherent fields and performing the required matrix-vector operations on them.

An intriguing and unexplored approach to utilizing coherent fields in quantum computing is Tamura’s optical matrix-vector multiplication from the 1970s,45 which was long forgotten but has recently resurfaced. This method harnesses point-wise multiplication (Hadamard product) of light and the Fourier transform capabilities of lenses. With this approach, operations have been applied in dimensions reaching up to d = 56 dimensions.27 Hidden in this method is the capability to encode information in Hilbert spaces formed from transverse modes of coherent laser fields.

In this work, we use optical matrix multiplication as a foundation for emulating quantum algorithms, therefore interacting quantum computing with structured light. We unveil the inherent tensor product structure of transverse spatial modes that is exploited in coherent optical matrix-vector multiplication and show that it can be harnessed as a tool to emulate quantum computing algorithms. Our logical basis is constructed from lattices of displaced Gaussian modes, eigenmodes of free space, that are locally modulated with digital holograms encoded on spatial light modulators. We treat the Cartesian location coordinates x and y of each mode as our degrees of freedom, forming the equivalent of two qudit registers. The x component is used to embed our state vectors, while the y-component acts as an ancilla that facilitates the unitary gate operator implementation. After a cylindrical lens integrates over the x-component, the final resulting state is measured in the y-coordinate. We test this using our basis and the Hadamard transform as example, and demonstrate the Deutsch–Jozsa algorithm with our encoding scheme, showing it can be used to query balanced and constant functions with average fidelity above 90%. In our scheme, we exploit the inherent parallelism offered by optical matrix-vector multiplication, allowing to prepare multiple identical spatial modes as a superposition and encode the oracle matrix as local phase transformations on each state.

Consider a matrix, M, with elements Mjk, and a vector u with elements uk. We can compute the matrix-vector product to produce the vector vMu, where the jth component can be computed from vj = kMjkuk. The goal is to perform such an operation using light fields. While this technique has already been introduced in classical optics,27 here it will be reformulated for quantum computing, where the vector v now encodes a normalized quantum state and M encodes a unitary gate operator. First, notice that the matrix-vector product can be rewritten as
(1)
representing the summation over the columns of the elementwise product (or Hadamard product46), denoted by the symbol ⊙, between our matrix M and another matrix U, which encodes or copies u into its rows. The matrix U can be obtained from the outer product, U = u1, with 1 = (1, 1, 1, 1, …).

We see that the matrix-vector multiplication can be decomposed into the elementwise product MU and a subsequent summation of the columns. These operations can be achieved optically using spatial light modulators (SLMs) and a cylindrical lens (CL), as shown in Fig. 1(a), as demonstrated in Ref. 27. On one SLM, a uniform field can be modulated with a hologram that encodes (point-wise) the matrix U and is imaged onto a second SLM, which is encoded with the matrix M. The imaging system between the two SLMs enables the elementwise multiplication of the encoded matrices. The final operation is performed using a cylindrical lens that focuses the field in the direction that coincides with the columns of M, performing a column-wise summation—therefore completing the product to produce the elements vj.

FIG. 1.

(a) Analog of quantum computing using optical vector-matrix multiplication. SLM1 encodes the lattice state via an operation, U, by copying the vector components encoded in the x-direction into the y-direction following Ref. 27. The second SLM encodes the matrix operation M. After this, a cylindrical lens focuses the field in the x-direction to produce the final matrix-vector product at the output farfield plane. (b) The encodings performed by the spatial light modulators (SLMs) operate on the tensor product states |xk⟩ ⊗ |yj⟩ corresponding to the discrete position states that can be obtained by partitioning the Cartesian plane (R2) into non-overlapping segments. (c) A quantum circuit for performing matrix multiplication using our basis states |xk⟩ ⊗ |yj⟩, corresponding to the coordinates of the partitions. The operations are represented as operators that act on the x-coordinate and y-coordinate degrees of freedom. (d) An example of the Hadamard basis states, |uj⟩, encoded onto the lattice states for N = 4. Here, the lattice is formed from propagation invariant Gaussian modes, each encoded into the independent partitions. To demonstrate that they form a tensor product space, HNHN, we show the individual states for the x and y coordinates, where the final lattice is obtained from their tensor products. These states are orthogonal. (e) Example of one of the states being acted on by the Hadamard gate and then focused to perform the column-wise summation. The embedded state vector is modulated point-wise with an SLM encoding the Hadamard matrix/gate. This is then focused in the farfield with a cylindrical lens, where the zero order component of the pattern contains the result in the vertical direction. The outcomes are shown for other states in the Hadamard basis mapping from |uj⟩ to the |vj⟩.

FIG. 1.

(a) Analog of quantum computing using optical vector-matrix multiplication. SLM1 encodes the lattice state via an operation, U, by copying the vector components encoded in the x-direction into the y-direction following Ref. 27. The second SLM encodes the matrix operation M. After this, a cylindrical lens focuses the field in the x-direction to produce the final matrix-vector product at the output farfield plane. (b) The encodings performed by the spatial light modulators (SLMs) operate on the tensor product states |xk⟩ ⊗ |yj⟩ corresponding to the discrete position states that can be obtained by partitioning the Cartesian plane (R2) into non-overlapping segments. (c) A quantum circuit for performing matrix multiplication using our basis states |xk⟩ ⊗ |yj⟩, corresponding to the coordinates of the partitions. The operations are represented as operators that act on the x-coordinate and y-coordinate degrees of freedom. (d) An example of the Hadamard basis states, |uj⟩, encoded onto the lattice states for N = 4. Here, the lattice is formed from propagation invariant Gaussian modes, each encoded into the independent partitions. To demonstrate that they form a tensor product space, HNHN, we show the individual states for the x and y coordinates, where the final lattice is obtained from their tensor products. These states are orthogonal. (e) Example of one of the states being acted on by the Hadamard gate and then focused to perform the column-wise summation. The embedded state vector is modulated point-wise with an SLM encoding the Hadamard matrix/gate. This is then focused in the farfield with a cylindrical lens, where the zero order component of the pattern contains the result in the vertical direction. The outcomes are shown for other states in the Hadamard basis mapping from |uj⟩ to the |vj⟩.

Close modal

Remarkably, hidden in this approach is the fact that the transverse Cartesian coordinates are used as independent degrees of freedom that can be used to enact operations, analogous to non-interacting multi-particle systems in quantum computing. Next, we show how this idea can be used to emulate quantum computing with transverse fields.

In our approach, we emulate quantum computing by formulating optical vector-matrix multiplication in the language of quantum mechanics by representing the optical fields that encode the vectors as states on Hilbert space and operations acting on the fields to represent the matrices that enact the equivalent of gate operations as shown in Figs. 1(b) and 1(c). First, the x–y coordinate system can be decomposed into a tensor-product space using the continuous degrees of freedom mapping the states |xH and |yH so that any field ψ(x, y) is described by the state |ψ⟩ = ∫ψ(x, y)|x⟩|ydxdy where the basis states satisfy ⟨x|x′⟩ = δ(xx′) and ⟨y|y′⟩ = δ(yy′). This means that each photon in a laser field is defined on a Hilbert space HH spanned by the Cartesian coordinate internal degrees of freedom (i.e., the coordinate states). By partitioning the transverse plane into N bounded and non-overlap intervals, |x⟩ → |xj⟩ and |y⟩ → |yk⟩, shown in Fig. 1(b), we can now define qudit states that form a high dimensional qudit space on the combined Hilbert space, i.e., HNHN that has dimensions N2. This has been discussed in recent work,47,48 showing that non-overlapping regions of transverse optical fields can be expressed using a basis formed from tensor product states, much like distinct particles that occupy their own Hilbert spaces. This ensures that the spatial modes corresponding to the x and y coordinates function as independent degrees of freedom. From these states, a uniform superposition can be prepared as
(2)
where each state in the partition has a non-zero coefficient. From this description, we see that the operations that can be applied to them can be enacted on each individual degree of freedom or on both simultaneously. Using our matrix vector product from Eq. (1), we can show that using such states and treating the x and y degrees of freedom as analogs of qudit registers, we can execute matrix vector (equivalently, operator and state) products. For instance, we can map the matrix U that was defined earlier onto an operator that encodes information into the lattice as
(3)
This is the analog for the matrix Û in Eq. (1)—assuming that the initial state is the superposition |Ψ⟩. This approach leverages multiple channels (Gaussian arrays) to carry independent streams of information simultaneously, reminiscent of multiplexing approaches.49 Here, the coefficients mark the x-components but copy all the elements, um, across the y-components—this still leaves the y-components independent of the x-components. Similarly, for matrix M, we have the operator,
(4)
which instead interacts with both components (registers), therefore encoding the matrix component’s Mnm into each state |xm⟩|yn⟩ of the lattice. The combined operation M̂Û produces the state,
(5)
which has the same components as Eq. (1) vj = kMjkuk from before. While the result of the multiplication is encoded into the lattice, which is N × N in dimensions, the result can be read out as a column in the y-direction once the summation k (in the x-component) is contracted. This can be done using the Fourier transforming (FT) lens in the x-direction—the analog of a quantum Fourier transform, therefore completing the circuit in Fig. 1(c). The result of this is an interference pattern, having a zero order component that corresponds to the amplitude, jkeifxlxkMjkvk for the frequency component fxl=0. Measuring the zeroth order interference pattern in the x-direction integrates the x-component, therefore leaving the y-components in the state
(6)
as expected. Next, measuring each y-component produces the probability amplitudes vj = kMjkuk, having the same outcome as v = Mu from Eq. (1). Because this scheme allows us to express operations of the x–y coordinates analogous to gate based computing platforms, we will exploit it for quantum computing, where the matrix mechanics that describe quantum computing can be formulated using the transverse spatial modes in Cartesian coordinates. Next, we introduce our basis of choice for doing this and illustrate the Hadamard gate.
Before we introduce the Hadamard gate, we first present our encoding basis. Instead of using arrays of square pixel-like states for each bounded interval on the x–y plane, we encode arrays of Gaussian modes, as shown in Fig. 1(c). The illustrations show that our Gaussian lattices/arrays are encoded as tensor products of arrays of one dimensional Gaussian modes, where (xj, yk) → |xj⟩|yk⟩ denote the centers of each Gaussian mode given by the states,
(7)
where each mode is centered at coordinates (xj, yk) within a closed boundary of Aj×AkR2 that is non-overlapping. In this way, uniform superpositions such as in Eq. (2) can also be prepared, i.e., resulting in the field in the first panel of Fig. 1(d). The rest of the fields in the figure represent instances of the Hadamard basis states, which include the uniform superposition. Next, we show how the Hadamard gate can be enacted on these fields.
The N-dimensional Hadamard gate, ĤN, is commonly used for quantum computing to map between the logical and the superposition basis (or vice versa). For example, for two-dimensional states (N = 2), we can describe the logical basis as |v0⟩ ≡|0⟩ = (1,0) and |v1⟩ ≡|1⟩ = (0,1). In this basis, the Hadamard gate is given by Ĥ2=121111. Applying the Hadamard gate maps the logical basis states onto the Hadamard basis states |u1,2=1/2(|0±|1), respectively. The states |u1,2⟩ are orthogonal and form a basis. The Hadamard gate performs a change of basis; however, when applied twice, it leaves the state unchanged, i.e., ĤĤ=I, true for all dimensions N. For qudits, N > 2, the Hadamard matrix can be computed for dimensions N = 2n (n power of 2) as ĤN=Ĥn using tensor products of n Hadamard gates. Thus, the kth Hadamard basis state can be obtained by applying the Hadamard gate to the kth state in the logical basis following:
(8)
where the states |m⟩ are the standard basis states with coefficients (−1)m·k with m · k corresponding to the dot product of the binary representation of the integers m and k. Accordingly, the Hadamard basis states can be mapped onto our lattice states as
(9)
Figure 1(d) shows examples of the lattice states that have been encoded with the Hadamard basis states in N = 4 dimensions. To encode these coefficients into the lattice, we use the operator Û in Eq. (3), but with the coefficients corresponding to our Hadamard basis states. Applying the Hadamard gate to each of the states in the lattice should map them back to the logical basis states, following ĤN|uk=|vk. Each basis state |uk⟩ that is embedded in the lattice [as in Fig. 1(d)] can be mapped onto a unique element vector with one non-zero entry, as shown in Fig. 1(e). To encode the Hadamard gate, we can map its matrix components onto the lattice using Eq. (4), where Mjk will represent the matrix elements of the Hadamard gate. Thereafter, we apply the Fourier transform and zero order component filtering to complete the operator-state (matrix-vector) multiplication.

Next, we show how this scheme can be used to perform a well-known quantum algorithm.

The Deutsch–Jozsa algorithm50 provides an efficient quantum solution for determining whether a Boolean function, f(⋅), that takes binary values as inputs, is balanced (half of the inputs map to 1 and the other half to 0) or constant (all inputs either map to 0 or 1). To illustrate this, consider a collection of 2-bit input strings chosen from the set B={00,01,10,11}; each element kB can be used as an input to the function, i.e., F(k). A balanced function would return 0 for half the entries, e.g., k ∈ {00, 11}, and 1 for the other half, k ∈ {01, 10}, as shown in the first left panel of Fig. 2(a). The second example [top right panel of Fig. 2(a)] shows an alternative combination that can also represent a balanced function. For the constant case, all binary values map to a single output, i.e., {00, 01, 10, 11} → 0 or {00, 01, 10, 11} → 1 as shown in the bottom panel of Fig. 2(b) for two instances of such a function.

FIG. 2.

(a) Conceptual illustration of the balanced and constant functions involved in the Deutsch–Jozsa algorithm for binary strings of length two, i.e., 00, 01, 10, and 11. The two top figures showcase a balanced function that maps half of its inputs to 0 and the other half to 1, and the two bottom figures showcase a constant function that maps all its inputs to either 0 or 1. (b) Illustration of our optical implementation of the Deutsch–Jozsa algorithm. A lattice of Gaussian beams representing the superposition of states is simultaneously prepared by Alice. The state is then queried by Bob in parallel with the action of the compound oracle and Hadamard operations, which impart function evaluations spatially on the state through phase transformations and map us back into the computational basis. A constant function returns the state mapping onto the binary string 00, indicated by the vector lighting up on the first elements. A balanced function returns a state orthogonal to 00, shown by light lobes at different positions.

FIG. 2.

(a) Conceptual illustration of the balanced and constant functions involved in the Deutsch–Jozsa algorithm for binary strings of length two, i.e., 00, 01, 10, and 11. The two top figures showcase a balanced function that maps half of its inputs to 0 and the other half to 1, and the two bottom figures showcase a constant function that maps all its inputs to either 0 or 1. (b) Illustration of our optical implementation of the Deutsch–Jozsa algorithm. A lattice of Gaussian beams representing the superposition of states is simultaneously prepared by Alice. The state is then queried by Bob in parallel with the action of the compound oracle and Hadamard operations, which impart function evaluations spatially on the state through phase transformations and map us back into the computational basis. A constant function returns the state mapping onto the binary string 00, indicated by the vector lighting up on the first elements. A balanced function returns a state orthogonal to 00, shown by light lobes at different positions.

Close modal

To query the nature of such a function, the quantum computer prepares a superposition of all possible binary values in B, queries the function values simultaneously, and through interference it returns a result indicating whether the function is balanced or not. We adapt the algorithm to our encoding scheme using the lattice basis and our operator-state (matrix-vector) multiplication scheme.

We illustrate the concept using four-dimensional (N = 4) states as an example. We can map the binary values of the inputs to the function F(·) in the set B to the logical basis states,
(10)
Using this basis, we can prepare all the possible inputs as the un-normalized superposition state |0⟩ + |1⟩ + |2⟩ + |3⟩ where the binary values are mapped onto their integer representations. These correspond to the logical basis states |vk⟩ from the previous section. In the algorithm, we will see that the mappings of the gates convert between the Hadamard basis states (|uk⟩) and the logical basis states (|vk⟩). To prepare the uniform superposition (|0⟩ + |1⟩ + |2⟩ + |3⟩) using our lattice, we can use the first element of the Hadamard basis following Eq. (9),
(11)
This indeed encodes the uniform superposition into our lattice, as shown in Fig. 2(b). Next, the features of the function F(k) is encoded onto the unitary operator as UF so that the states in the superposition become k(−1)F(k)|k⟩, showing that UF is diagonal and has the form
(12)
where each state in the superposition is marked with a coefficient (−1)F(k). As such, we see that UF encodes a π phase depending on whether F(k) is 0 or 1. Motivated by this, we encode the unitary as ÛF=k(UF)kk|xkxk|I onto our lattice, where (UF)kk are the diagonal elements of UF, marking the x-components of the lattice with the desired phases. In this way, we do not need ancillary particles thanks to the higher dimensional nature of our degrees of freedom.
Accordingly, given the uniform superposition of the lattice, we obtain
(13)
(14)
As a result, we can express the state as a piece-wise function,
(15)
showing that the state remains unchanged if the function is constant, while it can be in an arbitrary superposition if it is balanced. Finally, encoding the Hadamard matrix, applying the cylindrical lens, and performing the filtering leave the y-coordinate in the state
(16)
illustrated graphically in Fig. 2(b), showing the expected output intensities mapped onto the vertical rows of the output field. For the constant case, we have that the algorithm returns the first element of the basis, |v0⟩ ≡ |y0⟩. In the N = 4 binary example, this is similar to obtaining the |v0⟩ ≡ |00⟩ state. The balanced case returns an arbitrary superposition of the logical basis states with coefficients given by uj=1Nm(1)mj+F(j), where m · j is the binary inner product using the binary representation of m and j. For example, a balanced function that maps as {00, 11} → 1 and {01, 10} → 0, corresponds to a unitary,
(17)
represented in the logical basis. The output for this example is −|v3⟩ ≡ − |11⟩. In general, the output state is one of the logical basis states that exclude |v0⟩ ≡ |00⟩ as shown in Fig. 2(b). In our setup, we execute the protocol by encoding |u0⟩ on the first SLM and then subsequently encode M̂=ĤNÛ onto the second SLM.

In Fig. 3, we illustrate the setup used for our demonstration. To ensure a uniform field intensity across the transverse plane, we overfilled the first spatial light modulator (SLM1) by magnifying a laser beam from a Helium Neon (HeNe) source with a wavelength of 633 nm using the telescope. On SLM1, the input vector for the lattice of Gaussian modes was encoded as an array of displaced Gaussian beams, producing the superposition state, |Ψ⟩ ≡ |u0⟩ from Eq. (2). To alter the coefficients of the lattice, each row of the matrix (U) mapping the vector was encoded using a digital hologram that encodes amplitudes and phases51 onto each of the Gaussian modes. Because the SLM encodes the vector state as a matrix, U, given any state |u⟩, the elements were copied into its rows following the procedure outlined in the theory.

FIG. 3.

A laser beam is expanded using a telescope to overfill the active area of the first Spatial Light Modulator (SLM 1). At this point, the beam is transformed to encode the input vector as repeated rows in a matrix of Gaussian beams. This output is then relayed to SLM 2 using the 4f system of lenses (L2 and L1), where the lattice undergoes an additional phase encoding. An aperture (AP) at the focal plane of lens L1 filters out the first-order diffraction pattern. Subsequently, the beam is propagated through a cylindrical lens (CL) and undergoes a one-dimensional Fourier transform in the x-coordinate. The final outcome is captured by a CCD camera, with the result of the multiplication found on the central fringe, which is filtered out (as shown in the inset). The filtered mode image on the CCD camera displays the result of the matrix-vector multiplication, where regions of no intensity correspond to zero elements and bright regions correspond to non-zero elements. The holograms encoded on each SLM are shown as grayscale images.

FIG. 3.

A laser beam is expanded using a telescope to overfill the active area of the first Spatial Light Modulator (SLM 1). At this point, the beam is transformed to encode the input vector as repeated rows in a matrix of Gaussian beams. This output is then relayed to SLM 2 using the 4f system of lenses (L2 and L1), where the lattice undergoes an additional phase encoding. An aperture (AP) at the focal plane of lens L1 filters out the first-order diffraction pattern. Subsequently, the beam is propagated through a cylindrical lens (CL) and undergoes a one-dimensional Fourier transform in the x-coordinate. The final outcome is captured by a CCD camera, with the result of the multiplication found on the central fringe, which is filtered out (as shown in the inset). The filtered mode image on the CCD camera displays the result of the matrix-vector multiplication, where regions of no intensity correspond to zero elements and bright regions correspond to non-zero elements. The holograms encoded on each SLM are shown as grayscale images.

Close modal

The matrix generated on SLM1 was then transferred to SLM2 using an imaging system consisting of lenses L1 and L2. An aperture (AP) was placed between the two lenses to filter the modulated first order diffraction pattern from SLM1. On SLM2, we applied an additional phase encoding to the lattice/matrix elements, thereby completing the optical representation of the matrix-vector multiplication process. Following the encoding on SLM2, the beam was passed through a cylindrical lens (CL) to undergo a one-dimensional Fourier transform. This operation focused the outcome of the matrix-vector multiplication into the central fringe (shown as an inset in Fig. 3), specifically at the zeroth order Fourier component in coordinate space. To extract this outcome accurately, we employed digital filtering, enabling precise capture of the resultant vector as shown in the inset of Fig. 3.

To characterize our system, we exploit the orthogonality of the Hadamard basis. In order to do this, we prepared the Hadamard basis states |uj⟩ on SLM1 and encoded the Hadamard transform on SLM2. Thereafter, we propagated the field through the cylindrical lens and collected the resulting interference pattern on a CCD camera. The multiplication between the Hadamard basis states and the Hadamard gate enables us to clearly distinguish between different columns of the output vector state. Accordingly, we obtain orthogonal states (|vj⟩) with distinct positions marked by bright lobes. We show a measured example of this for N = 2 dimensions in Fig. 4(a), where the first basis state, |u0⟩, is encoded on the lattice and measured using the Hadamard gate. The outcome is a measured interference pattern, where the resulting filtered zero order produces a bright lobe in the first entry—for this specific example, the result corresponds to the state |v0⟩. Summing and normalizing the intensity for each region of the output vector corresponded to extracting the output vector elements.

FIG. 4.

Setup characterization: Intensity images collected by the CCD camera when encoding a Hadamard matrix on the second SLM and the vector built from one of the Hadamard matrix's columns on the first SLM. In (a), the extraction of the central lobe containing our solution vector from the multiplication of a 2 × 2 Hadamard matrix with the first column is highlighted. (b) We then stack these to form a diagonal matrix consisting of the light fringes as our elements. This diagonal matrix is then used to form a crosstalk matrix, from which the fidelity of the computation is computed. (c)–(e) Extension of this process to higher dimensional matrices, up to 16 dimensions.

FIG. 4.

Setup characterization: Intensity images collected by the CCD camera when encoding a Hadamard matrix on the second SLM and the vector built from one of the Hadamard matrix's columns on the first SLM. In (a), the extraction of the central lobe containing our solution vector from the multiplication of a 2 × 2 Hadamard matrix with the first column is highlighted. (b) We then stack these to form a diagonal matrix consisting of the light fringes as our elements. This diagonal matrix is then used to form a crosstalk matrix, from which the fidelity of the computation is computed. (c)–(e) Extension of this process to higher dimensional matrices, up to 16 dimensions.

Close modal

We repeated the process for all the basis states for a given dimension. In Fig. 4(b), we show the measured lobes for all the states in N = 2, confirming that the Hadamard basis states (|u0⟩ and |u1⟩) are mapped on to the basis states |v0⟩ and |v1⟩. From the measured lobes, we extracted the intensity from each component and produced a crosstalk matrix (CM). For N = 2, the crosstalk matrix resembles an identity matrix, showing that the measured basis modes are distinguishable and, therefore, confirms orthogonality between the measured vectors. To quantify this, we measured a fidelity of F = 0.99 ± 0.01, showing that the Hadamard matrix can map the basis elements |uj⟩ onto the basis states |vj⟩. This was calculated by normalizing each row and computing the average over the diagonal components.

Figures 4(c)4(e) show the extension of this process to higher-dimensional matrices. For dimensions N = 4, N = 8, and N = 16, we obtain average fidelities of 0.96 ± 0.01, 0.94 ± 0.05, and 0.81 ± 0.02 multiplication, respectively. However, as the dimensions increase, we note that the fidelity decreases. We attribute this to the diffraction of Gaussian beams. Increasing the dimension or number of Gaussian modes for the same physical size of the matrix means decreasing the beam waist w0 of each mode. As the beam waists get smaller, they expand at a faster rate during propagation, according to w(z)=w01+λzπw022. Given that the cylindrical lens focuses light in one direction while neglecting the other, we expect the unfocused direction to continue expanding more rapidly as w0 gets smaller, resulting in overlapping vector elements that are hard to distinguish. This diffraction effect impacts the fidelity of higher-dimensional computations.

Using our scheme, we demonstrate the Deutsch–Jozsa algorithm for a function that encodes information using N = 2, N = 4, and N = 8 basis elements, shown in Figs. 5(a)5(c), respectively. We initialized our system in the superposition state |u0⟩ by digitally displaying a hologram encoding the uniform lattice of Gaussian modes on SLM1. The action of the oracle phase transformation and the subsequent Hadamard gate are encoded as a compound unitary transformation HÛF on the second (SLM2). The light beam is then sent through a cylindrical lens, which acts as a summing operator. The resulting interference pattern that was measured with the CCD camera and filtered zero order vector components are shown as insets in each figure.

FIG. 5.

Deutsch–Jozsa algorithm results: Algorithm results for the Deutsch–Jozsa algorithm implementation. Panels (a)–(c) show the intensity distributions for single-qubit, two-qubit, and three-qubit systems, respectively, with the form of the oracle diagonal matrix UF. In each panel: (1) Unfiltered images representing the initial light distribution, and (2) filtered intensity images corresponding to the central fringe at k = 0. Subpanels (i) correspond to the constant function, and subpanels (ii) correspond to the balanced function. The bar graphs depict the normalized intensity against the row position, allowing the determination of the function type. The presence or absence of light in the first vector element’s spatial position indicates whether the function is balanced or constant.

FIG. 5.

Deutsch–Jozsa algorithm results: Algorithm results for the Deutsch–Jozsa algorithm implementation. Panels (a)–(c) show the intensity distributions for single-qubit, two-qubit, and three-qubit systems, respectively, with the form of the oracle diagonal matrix UF. In each panel: (1) Unfiltered images representing the initial light distribution, and (2) filtered intensity images corresponding to the central fringe at k = 0. Subpanels (i) correspond to the constant function, and subpanels (ii) correspond to the balanced function. The bar graphs depict the normalized intensity against the row position, allowing the determination of the function type. The presence or absence of light in the first vector element’s spatial position indicates whether the function is balanced or constant.

Close modal

From these images, we then plot the cross section of the normalized intensity against the vector element number. In this case, we can distinguish whether the function is balanced or constant by interrogating the presence or absence of light in the spatial position of the vector element. Using our basis vectors from the characterization, this means a constant function produces the vector |v0⟩ and if the function is balanced |vj≠0⟩. The instance of the oracle operator (ÛF) used for each type of function is shown in each figure; this is shown as an inset in the intensity plots representing the measured components.

For each case, we accurately determined whether the function encoded in the unitary operation is constant or balanced. The average fidelity of these measurements exceeded 90% across all cases. In particular, for N = 2, 4, and 8, we achieved fidelities of 0.99 ± 0.01, 0.97 ± 0.01, and 0.93 ± 0.05, respectively.

In this study, we utilized optical matrix-vector multiplication to emulate quantum computing by treating the xy components of a coherent field as a tensor product space, HNHN, derived from individual coordinates. The encoding basis was defined within this Hilbert space using a lattice of Gaussian modes, where the positions of the centers in the xy coordinates established localized states. Vector states were encoded along the x-coordinate, while both coordinates were employed to encode the matrix operator. The output vector was measured along the y-coordinate after filtering out the zero-order component of the output interference pattern. We demonstrated the use of Hadamard basis elements and the Hadamard gate, achieving encoding and decoding fidelities as high as 95% for N = 8 dimensions and above 80% for N = 16.

Furthermore, our implementation of the Deutsch–Jozsa algorithm using optical vector matrix multipliers leverages the representation of quantum states as vectors and quantum operators as matrices that can be imprinted on our lattice basis. Optically, we prepare multiple identical Gaussian modes in parallel, with each mode representing an element of the states that are input to the function F(k). The high-dimensional nature of our encoding scheme enables the oracle function in our demonstration to be encoded as a diagonal operator.

However, we note spatial resources required to perform computations using structured light in higher dimensions are fundamentally limited by the diffraction limit. The minimum separation between distinguishable spatial modes is constrained by the wavelength of light and the numerical aperture of the optical system, leading to crosstalk between modes when attempting to scale up to higher dimensions. In our current setup, we have explored up to 16 distinguishable spatial modes, equivalent to a 4-qubit system. Spall’s vector-matrix demonstration reached up to ≈50 dimensions of encoding—in principle, every pixel of the SLM can be utilized as an encoding channel but would require much effort. Moreover, as the number of spatial modes increases, the complexity of addressing and manipulating these modes grows significantly. In quantum systems, the number of operations required for a computation scales polynomially with the number of qubits, whereas in classical systems, the need to individually resolve and address each spatial mode results in a linear scaling with the number of available modes. This ultimately limits the scalability of classical systems in performing quantum-like operations.

In addition, the preparation of Gaussian lattices and their unitary transformation matrices on an SLM typically involves NxN operations to generate the necessary hologram for the spot array, which can be computationally expensive and inefficient when scaling to higher dimensions. An alternative approach is the use of fan-out operations to generate the lattice of Gaussian modes.52,53 Techniques such as cylindrical lenses54 or diffractive optical elements55 can directly produce the desired lattice by splitting or reshaping the input beam, reducing the need for pixel-by-pixel modulation on the SLM and significantly improving efficiency. Recent advances in trained diffractive optical elements provide another potential solution by allowing computationally designed optical masks to perform the necessary optical transformations.35 This approach leverages inverse design techniques to optimize optical circuits, embedding high-dimensional transformations in complex media without requiring precise control over individual elements. Such masks streamline the process by reducing the need for real-time computation and re-calibration, ensuring scalability, and maintaining the accuracy of the transformations.

We acknowledge the proposal by Perez-Garcia et al.,40 which employs classical light following Dragoman’s method. However, this approach necessitates multiple optical elements to prepare the superposition state. In contrast, our method efficiently prepares the state in a single step by projecting light onto a spatial light modulator (SLM) in a reprogrammable manner—the digital encoding allows for dynamic control and can, therefore, be adapted for any operation. Therefore, we anticipate that any transformation (operator/gate) can be encoded, including X-gate, Z-gate, etc., because the method allows any matrix operation to be encoded into the lattice.

The authors acknowledge Professor Andrew Forbes for his fruitful discussions and valuable advice. The authors also acknowledge the South African Quantum Initiative (SAQuti), the National Research Foundation (South Africa), and Optica for funding.

The authors have no conflicts to disclose.

Mwezi Koni: Conceptualization (equal); Formal analysis (equal); Investigation (equal); Writing – original draft (equal). Hadrian Bezuidenhout: Investigation (supporting); Methodology (supporting); Writing – review & editing (supporting). Isaac Nape: Conceptualization (equal); Formal analysis (equal); Supervision (equal); Writing – original draft (equal); Writing – review & editing (equal).

The data that support the findings of this study are available from the corresponding author upon reasonable request.

1.
P.
Cameron
,
B.
Courme
,
C.
Vernière
,
R.
Pandya
,
D.
Faccio
, and
H.
Defienne
, “
Adaptive optical imaging with entangled photons
,”
Science
383
,
1142
1148
(
2024
).
2.
C.
Moodley
and
A.
Forbes
, “
Advances in quantum imaging with machine intelligence
,”
Laser Photonics Rev.
18
,
2300939
(
2024
).
3.
J.
Geng
, “
Structured-light 3D surface imaging: A tutorial
,”
Adv. Opt. Photonics
3
,
128
160
(
2011
).
4.
B. I.
Erkmen
and
J. H.
Shapiro
, “
Ghost imaging: From quantum to classical to computational
,”
Adv. Opt. Photonics
2
,
405
450
(
2010
).
5.
F.
Ferri
,
D.
Magatti
,
L.
Lugiato
, and
A.
Gatti
, “
Differential ghost imaging
,”
Phys. Rev. Lett.
104
,
253603
(
2010
).
6.
D.
Zia
,
N.
Dehghan
,
A.
D’Errico
,
F.
Sciarrino
, and
E.
Karimi
, “
Interferometric imaging of amplitude and phase of spatial biphoton states
,”
Nat. Photonics
17
,
1009
1016
(
2023
).
7.
G.
Kim
,
Y.
Kim
,
J.
Yun
,
S.-W.
Moon
,
S.
Kim
,
J.
Kim
,
J.
Park
,
T.
Badloe
,
I.
Kim
, and
J.
Rho
, “
Metasurface-driven full-space structured light for three-dimensional imaging
,”
Nat. Commun.
13
,
5920
(
2022
).
8.
M.
Mirhosseini
,
O. S.
Magaña-Loaiza
,
M. N.
O’Sullivan
,
B.
Rodenburg
,
M.
Malik
,
M. P.
Lavery
,
M. J.
Padgett
,
D. J.
Gauthier
, and
R. W.
Boyd
, “
High-dimensional quantum cryptography with twisted light
,”
New J. Phys.
17
,
033033
(
2015
).
9.
J.
Wang
,
J.-Y.
Yang
,
I. M.
Fazal
,
N.
Ahmed
,
Y.
Yan
,
H.
Huang
,
Y.
Ren
,
Y.
Yue
,
S.
Dolinar
,
M.
Tur
, and
A. E.
Willner
, “
Terabit free-space data transmission employing orbital angular momentum multiplexing
,”
Nat. Photonics
6
,
488
496
(
2012
).
10.
M.
Krenn
,
R.
Fickler
,
M.
Fink
,
J.
Handsteiner
,
M.
Malik
,
T.
Scheidl
,
R.
Ursin
, and
A.
Zeilinger
, “
Communication with spatially modulated light through turbulent air across vienna
,”
New J. Phys.
16
,
113028
(
2014
).
11.
J.
Wang
,
J.
Liu
,
S.
Li
,
Y.
Zhao
,
J.
Du
, and
L.
Zhu
, “
Orbital angular momentum and beyond in free-space optical communications
,”
Nanophotonics
11
,
645
680
(
2022
).
12.
A.
Forbes
,
M.
Youssef
,
S.
Singh
,
I.
Nape
, and
B.
Ung
, “
Quantum cryptography with structured photons
,”
Appl. Phys. Lett.
124
,
110501
(
2024
).
13.
M. P.
Lavery
,
C.
Peuntinger
,
K.
Günthner
,
P.
Banzer
,
D.
Elser
,
R. W.
Boyd
,
M. J.
Padgett
,
C.
Marquardt
, and
G.
Leuchs
, “
Free-space propagation of high-dimensional structured optical fields in an urban environment
,”
Sci. Adv.
3
,
e1700552
(
2017
).
14.
B.
Perez-Garcia
,
R. I.
Hernandez-Aranda
,
A.
Forbes
, and
T.
Konrad
, “
The first iteration of Grover’s algorithm using classical light with orbital angular momentum
,”
J. Mod. Opt.
65
,
1942
1948
(
2018
).
15.
A.
Peruzzo
,
J.
McClean
,
P.
Shadbolt
,
M.-H.
Yung
,
X.-Q.
Zhou
,
P. J.
Love
,
A.
Aspuru-Guzik
, and
J. L.
O’brien
, “
A variational eigenvalue solver on a photonic quantum processor
,”
Nat. Commun.
5
,
4213
(
2014
).
16.
S.
Konno
,
W.
Asavanant
,
F.
Hanamura
,
H.
Nagayoshi
,
K.
Fukui
,
A.
Sakaguchi
,
R.
Ide
,
F.
China
,
M.
Yabuno
,
S.
Miki
et al, “
Logical states for fault-tolerant quantum computation with propagating light
,”
Science
383
,
289
293
(
2024
).
17.
P. L.
McMahon
, “
The physics of optical computing
,”
Nat. Rev. Phys.
5
,
717
734
(
2023
).
18.
I.
Nape
,
B.
Sephton
,
P.
Ornelas
,
C.
Moodley
, and
A.
Forbes
, “
Quantum structured light in high dimensions
,”
APL Photonics
8
,
051101
(
2023
).
19.
A.
Forbes
,
M.
de Oliveira
, and
M. R.
Dennis
, “
Structured light
,”
Nat. Photonics
15
,
253
262
(
2021
).
20.
H.
Rubinsztein-Dunlop
,
A.
Forbes
,
M. V.
Berry
,
M. R.
Dennis
,
D. L.
Andrews
,
M.
Mansuripur
,
C.
Denz
,
C.
Alpmann
,
P.
Banzer
,
T.
Bauer
et al, “
Roadmap on structured light
,”
J. Opt.
19
,
013001
(
2016
).
21.
M.
Piccardo
,
V.
Ginis
,
A.
Forbes
,
S.
Mahler
,
A. A.
Friesem
,
N.
Davidson
,
H.
Ren
,
A. H.
Dorrah
,
F.
Capasso
,
F. T.
Dullo
et al, “
Roadmap on multimode light shaping
,”
J. Opt.
24
,
013001
(
2021
).
22.
K. Y.
Bliokh
,
E.
Karimi
,
M. J.
Padgett
,
M. A.
Alonso
,
M. R.
Dennis
,
A.
Dudley
,
A.
Forbes
,
S.
Zahedpour
,
S. W.
Hancock
,
H. M.
Milchberg
et al, “
Roadmap on structured waves
,”
J. Opt.
25
,
103001
(
2023
).
23.
P. O.
Boykin
,
T.
Mor
,
M.
Pulver
,
V.
Roychowdhury
, and
F.
Vatan
, “
A new universal and fault-tolerant quantum basis
,”
Inf. Process. Lett.
75
,
101
107
(
2000
).
24.
A. Y.
Kitaev
,
A.
Shen
, and
M. N.
Vyalyi
,
Classical and Quantum Computation
(
American Mathematical Society
,
2002
), Vol.
47
.
25.
Y.
Wang
,
Z.
Hu
,
B. C.
Sanders
, and
S.
Kais
, “
Qudits and high-dimensional quantum computing
,”
Front. Phys.
8
,
589504
(
2020
).
26.
S.
Ecker
,
F.
Bouchard
,
L.
Bulla
,
F.
Brandt
,
O.
Kohout
,
F.
Steinlechner
,
R.
Fickler
,
M.
Malik
,
Y.
Guryanova
,
R.
Ursin
, and
M.
Huber
, “
Overcoming noise in entanglement distribution
,”
Phys. Rev. X
9
,
041042
(
2019
).
27.
J.
Spall
,
X.
Guo
,
T. D.
Barrett
, and
A.
Lvovsky
, “
Fully reconfigurable coherent optical vector–matrix multiplication
,”
Opt. Lett.
45
,
5752
5755
(
2020
).
28.
J. C.
Garcia-Escartin
and
P.
Chamorro-Posada
, “
Quantum computer networks with the orbital angular momentum of light
,”
Phys. Rev. A
86
,
032334
(
2012
).
29.
J. L.
O’brien
, “
Optical quantum computing
,”
Science
318
,
1567
1570
(
2007
).
30.
X.
Gao
,
M.
Krenn
,
J.
Kysela
, and
A.
Zeilinger
, “
Arbitrary d-dimensional pauli X gates of a flying qudit
,”
Phys. Rev. A
99
,
023825
(
2019
).
31.
N. K.
Fontaine
,
J.
Carpenter
,
S.
Gross
,
S.
Leon-Saval
,
Y.
Jung
,
D. J.
Richardson
, and
R.
Amezcua-Correa
, “
Photonic lanterns, 3-D waveguides, multiplane light conversion, and other components that enable space-division multiplexing
,”
Proc. IEEE
110
,
1821
1834
(
2022
).
32.
F.
Brandt
,
M.
Hiekkamäki
,
F.
Bouchard
,
M.
Huber
, and
R.
Fickler
, “
High-dimensional quantum gates using full-field spatial modes of photons
,”
Optica
7
,
98
107
(
2020
).
33.
Q.
Wang
,
J.
Liu
,
D.
Lyu
, and
J.
Wang
, “
Ultrahigh-fidelity spatial mode quantum gates in high-dimensional space by diffractive deep neural networks
,”
Light: Sci. Appl.
13
,
10
(
2024
).
34.
O.
Lib
and
Y.
Bromberg
, “
Quantum light in complex media and its applications
,”
Nat. Phys.
18
,
986
993
(
2022
).
35.
S.
Goel
,
S.
Leedumrongwatthanakun
,
N. H.
Valencia
,
W.
McCutcheon
,
A.
Tavakoli
,
C.
Conti
,
P. W.
Pinkse
, and
M.
Malik
, “
Inverse design of high-dimensional quantum optical circuits in a complex medium
,”
Nat. Phys.
20
,
232
(
2024
).
36.
N. J.
Cerf
,
C.
Adami
, and
P. G.
Kwiat
, “
Optical simulation of quantum logic
,”
Phys. Rev. A
57
,
R1477
(
1998
).
37.
R. J.
Spreeuw
, “
Classical wave-optics analogy of quantum-information processing
,”
Phys. Rev. A
63
,
062302
(
2001
).
38.
P.
Londero
,
C.
Dorrer
,
M.
Anderson
,
S.
Wallentowitz
,
K.
Banaszek
, and
I.
Walmsley
, “
Efficient optical implementation of the Bernstein-Vazirani algorithm
,”
Phys. Rev. A
69
,
010302
(
2004
).
39.
Arvind
,
G.
Kaur
, and
G.
Narang
, “
Optical implementations, oracle equivalence, and the Bernstein-Vazirani algorithm
,”
J. Opt. Soc. Am. B
24
,
221
225
(
2007
).
40.
B.
Perez-Garcia
,
M.
McLaren
,
S. K.
Goyal
,
R. I.
Hernandez-Aranda
,
A.
Forbes
, and
T.
Konrad
, “
Quantum computation with classical light: Implementation of the Deutsch–Jozsa algorithm
,”
Phys. Lett. A
380
,
1925
1931
(
2016
).
41.
R.
Jozsa
, “
Entanglement and quantum computation
,” arXiv:quant-ph/9707034 (
1997
).
42.
R.
Jozsa
and
N.
Linden
, “
On the role of entanglement in quantum-computational speed-up
,”
Proc. R. Soc. London, Ser. A
459
,
2011
2032
(
2003
).
43.
Y.
Wang
,
V.
Potoček
,
S. M.
Barnett
, and
X.
Feng
, “
Programmable holographic technique for implementing unitary and nonunitary transformations
,”
Phys. Rev. A
95
,
033827
(
2017
).
44.
K.
Nitta
,
O.
Matoba
, and
T.
Yoshimura
, “
Parallel processing for multiplication modulo by means of phase modulation
,”
Appl. Opt.
47
,
611
616
(
2008
).
45.
P. N.
Tamura
and
J. C.
Wyant
, “
Two-dimensional matrix multiplication using coherent optical techniques
,”
Opt. Eng.
18
,
198
204
(
1979
).
46.
R. A.
Horn
, “
The Hadamard product
,”
Proc. Symp. Appl. Math.
40
,
87
169
(
1990
).
47.
Y.
Shen
and
C.
Rosales-Guzmán
, “
Nonseparable states of light: From quantum to classical
,”
Laser Photonics Rev.
16
,
2100533
(
2022
).
48.
A.
Aiello
,
F.
Töppel
,
C.
Marquardt
,
E.
Giacobino
, and
G.
Leuchs
, “
Quantum–like nonseparable structures in optical beams
,”
New J. Phys.
17
,
043024
(
2015
).
49.
C.
He
,
Y.
Shen
, and
A.
Forbes
, “
Towards higher-dimensional structured light
,”
Light: Sci. Appl.
11
,
205
(
2022
).
50.
D.
Deutsch
and
R.
Jozsa
, “
Rapid solution of problems by quantum computation
,”
Proc. R. Soc. London, Ser. A
439
,
553
558
(
1992
).
51.
V.
Arrizón
,
U.
Ruiz
,
R.
Carrada
, and
L. A.
González
, “
Pixelated phase computer holograms for the accurate encoding of scalar complex fields
,”
J. Opt. Soc. Am. A
24
,
3500
3507
(
2007
).
52.
A. G.
Kirk
,
H. T.
Imam
,
K.
Bird
, and
T. J.
Hall
, “
Design and fabrication of computer-generated holographic fan-out elements for a matrix/matrix interconnection scheme
,”
Proc. SPIE
1574
,
121
132
(
1991
).
53.
S.
Zhou
,
H. K.
Liu
,
S.
Campbell
, and
P.
Yeh
, “
Modified-signed-digit optical computing by using fan-out elements
,”
Opt. Lett.
17
,
1697
1699
(
1992
).
54.
D. E.
Tamir
,
N. T.
Shaked
,
P. J.
Wilson
, and
S.
Dolev
, “
High-speed and low-power electro-optical DSP coprocessor
,”
J. Opt. Soc. Am. A
26
,
1879
(
2009
).
55.
H.
Dammann
and
K.
Görtler
, “
High-efficiency in-line multiple imaging by means of multiple phase holograms
,”
Opt. Commun.
3
,
312
315
(
1971
).