# Binary amplitude holograms for shaping complex light fields with digital micromirror devices

R Gutiérrez-Cuevas, Sébastien M. Popoff

► To cite this version:

R Gutiérrez-Cuevas, Sébastien M. Popoff. Binary amplitude holograms for shaping complex light fields with digital micromirror devices. Journal of Physics: Photonics, 2024, 6 (4), pp.045022. 10.1088/2515-7647/ad8617. hal-04813276

HAL Id: hal-04813276

https://hal.science/hal-04813276v1

Submitted on 1 Dec 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
PAPER • OPEN ACCESS

# Binary amplitude holograms for shaping complex light fields with digital micromirror devices

To cite this article: R Gutiérrez-Cuevas and S M Popoff 2024 *J. Phys. Photonics* **6** 045022

View the [article online](#) for updates and enhancements.

## You may also like

- Optical wavefront shaping in deep tissue using photoacoustic feedback
Fei Xia, Ivo Leite, Robert Prevedel et al.

- A review of label-free photonics-based techniques for cancer detection in the digestive and urinary systems
G Castro-Olvera, E Baria, D Stoliarov et al.

- A practical guide to digital micro-mirror devices (DMDs) for wavefront shaping
Sébastien M Popoff, Rodrigo Gutiérrez-Cuevas, Yaron Bromberg et al.
<figure><img src="image_2.png" /></figure>

CrossMark

OPEN ACCESS

RECEIVED

28 November 2023

REVISED

6 October 2024

ACCEPTED FOR PUBLICATION

11 October 2024

PUBLISHED

24 October 2024

Original Content from
this work may be used
under the terms of the
Creative Commons
Attribution 4.0 licence.

Any further distribution
of this work must
maintain attribution to
the author(s) and the title
of the work, journal
citation and DOI.

<figure><img src="image_3.png" /></figure>

PAPER

# Binary amplitude holograms for shaping complex light fields with digital micromirror devices

R Gutiérrez-Cuevas¹,²,* ID and S M Popoff¹ ID

¹ Institut Langevin, ESPCI Paris, Université PSL, CNRS, 75005 Paris, France

² Université Paris-Saclay, CNRS, ENS Paris-Saclay, CentraleSupélec, LuMIn, 91405 Orsay, France

* Author to whom any correspondence should be addressed.

E-mail: rodrigo.gutierrez@ens-paris-saclay.fr and sebastien.popoff@espci.fr

**Keywords:** structured light, digital micromirror devices, holograms, Spatial light modulators, wavefront shaping

## Abstract

Digital micromirror devices are a popular type of spatial light modulators for wavefront shaping applications. While they offer several advantages when compared to liquid crystal modulators, such as polarization insensitivity and rapid-switching, they only provide a binary amplitude modulation. Despite this restriction, it is possible to use binary holograms to modulate both the amplitude and phase of the incoming light, thus allowing the creation of complex light fields. Here, a didactic exploration of various types of binary holograms is presented. A particular emphasis is placed on the fact that the finite number of pixels coupled with the binary modulation limits the number of complex values that can be encoded into the holograms. This entails an inevitable trade-off between the number of complex values that can be modulated with the hologram and the number of independent degrees of freedom available to shape light, both of which impact the quality of the shaped field. Nonetheless, it is shown that by appropriately choosing the type of hologram and its parameters, it is possible to find a suitable compromise that allows shaping a wide range of complex fields with high accuracy. In particular, it is shown that choosing the appropriate alignment between the hologram and the micromirror array allows for maximizing the number of complex values. Likewise, the implications of the type of hologram and its parameters on the diffraction efficiency are also considered.

## 1. Introduction

The ability to control light's various degrees of freedom has enabled many new applications as well as improved existing ones across many fields [1–5]. For instance, it allowed shaping the intensity distribution of optical fields for imagining samples with nanometric resolution [6–9], and creating optical tweezers for manipulating small particles [10–14]. Likewise, this control enabled the creation of fields with non-trivial phase structures such as optical vortices which have been used for quantum information applications [15–17], among many others [18, 19]. A more recent use of wavefront shaping is for studying and controlling light's propagation through complex media [5, 20]. In particular, it allows measuring parts of their scattering matrix which establishes a linear relationship between a set of inputs and output modes, and provides a high-level of control over the wave propagation [21–23]. The knowledge of this matrix can then be used for focusing or imaging through highly-scattering media [24–26], creating highly-precise sensing devices [27, 28], and even avoiding undesirable effects [29–31]. The huge success of structured light has also led to many works seeking to understand the limits within which light can be shaped. This endeavor has resulted in the creation of various nontrivial topological structures with optical fields, such as knots [32–34], Möbius strips [35–37], and skyrmions [38–40].

Over the years, there have been several key technological advances that have allowed the creation and use of structured light fields. Holograms were initially used to encode the spatial distribution of a target field into a photographic film [41–43]. However, the printing process relied on exposing the film to the interference pattern created by the superposition of a reference field with the desired target. Therefore, these off-axis
holograms required the existence of the target field before it could be encoded into the hologram. With the inception of computer generated holograms, this restriction was lifted [44–50]. Any target field could now be encoded into a phase or amplitude hologram and subsequently generated by illuminating the hologram thus opening the door for shaping complex light fields. More recently, spatial light modulators (SLMs) were developed as reconfigurable devices in which one could encode any hologram with a computer. Two popular types of SLMs are: liquid crystal SLMs which provide a continuous modulation of the phase [51–54] and digital micro-mirror devices (DMDs) which provide a binary (0 or 1) modulation of the amplitude [55–58]. Despite their own limitations, they can both be used to shape the amplitude and phase of optical fields using the same computer generated holograms that were proposed more than half a century ago [50].

DMDs present several advantages over liquid-crystal SLMs, they are more affordable, allow for faster switching (on the order of tens of kHz), and are polarization insensitive [59, 60]. In particular, the faster switching of DMDs allows measuring the scattering matrix (or part of it) in a fraction of the time needed using liquid crystal SLMs [31] and following the evolution of dynamical systems [61]. Despite their binary amplitude modulation, there are binary holograms that allow achieving a complex (amplitude and phase) modulation but at the expense of reducing the number of degrees of freedom and lowering the transmittance. There have been other works that have reviewed various aspects of DMDs and their light shaping capabilities. However, they have been written to provide an overview of their technical aspects, how to use them to shape light, and their main applications [56–58, 62, 63]. Here, a different approach is taken by focusing solely on how to best encode a complex valued optical field onto a binary hologram created on a DMDs (for a more technical tutorial on DMDs see [63]). Therefore, special care is taken to consider the implications of the discrete, and often Cartesian, layout of micro-mirrors on the complex values that can be encoded in the hologram. In particular, it is explicitly shown how this leads to a discretization of the attainable complex values and how their number can be drastically increased by appropriately choosing the angle between the hologram structure and the axes of the micro-mirror array. It is also shown how there is a compromise between the number of complex values that can be used to shape light, the diffraction efficiency, and the final resolution of the shaped field which is equivalent to the number of degrees of freedom in the SLM. All the code used to generate the results presented here along with examples of use can be accessed at the dedicated GitHub repository [64].

## 2. Gray-scale amplitude modulated holograms

### 2.1. Interference-generated holograms

Amplitude modulated holograms find their roots in the interferograms that were originally recorded on photographic film by interfering two fields [41–43, 50]. In these holograms, the spatial structure of a given target (or object) field, $E_t(\mathbf{r})$, is recorded by making it interfere with a tilted reference plane wave, $E_r(\mathbf{r}) = R \exp(i2\pi \mathbf{v} \cdot \mathbf{r})$, whose direction is determined by the carrier frequency vector $\mathbf{v}$. After the recording process, the transmittance function of the photographic plate follows the same spatial dependence as that of the intensity distribution produced by the interference between the two waves. By expressing the target field in terms of its amplitude $A(\mathbf{r})$ and phase $\phi(\mathbf{r})$, so that $E_t(\mathbf{r}) = A(\mathbf{r}) \exp[i\phi(\mathbf{r})]$, the transmittance function of the hologram can be written as

$$T(\mathbf{r}) = |E_r(\mathbf{r}) + E_t(\mathbf{r})|^2 = R^2 + A^2(\mathbf{r}) + 2RA(\mathbf{r}) \cos[2\pi \mathbf{v} \cdot \mathbf{r} - \phi(\mathbf{r})]. \quad (1)$$

As shown in figure 1, the resulting hologram takes the form of a spatially varying grating where $\mathbf{v}$ defines the orientation of the fringes. In principle, this transmittance function can take any value between 0 and 1 and is thus referred to as a grayscale hologram. Moreover, from the transmittance function, it can be seen that the phase information of the target field is encoded into the position of the fringes while the amplitude information is encoded on the peak-to-valley value of fringes.

In order to understand how to retrieve the target field from the hologram, it is useful to rewrite the transmittance function in terms of a Fourier series. Assuming that the spatial variations of the target field are slower than the amplitude modulations controlled by $\mathbf{v}$, then the hologram is locally a two-dimensional periodic structure thus forming a Bravais lattice, just like the ones found in crystals [65]. This two-dimensional lattice is fully determined by the two primitive vectors, $\mathbf{a}_1$ and $\mathbf{a}_2$, which need not be orthogonal. These two vectors define the unit cell which is the smallest pattern that is periodically repeated across the structure. Given this periodic structure, it is then possible to rewrite the transmittance function as a Fourier series,

$$T(\mathbf{r}) = \sum_{m_1=-\infty}^{\infty} \sum_{m_2=-\infty}^{\infty} T_{m_1 m_2} e^{2\pi i m_1 \mathbf{b}_1 \cdot \mathbf{r}} e^{2\pi i m_2 \mathbf{b}_2 \cdot \mathbf{r}} \quad (2)$$
<figure><img src="image_4.png" /></figure>

where the spatial dependence of the target field is encoded into the Fourier coefficients $T_{m_1 m_2}$. Here, $b_1$ and $b_2$ are the reciprocal lattice vectors which are defined via $a_j \cdot b_j = \delta_{ij}$ with $\delta_{ij}$ being the Kronecker delta. Given that the spatial variation of the target field are assumed to be much slower than those controlled by $\nu$, the spatial dependence of the field will be omitted in the remainder of this work. In many cases, holograms are invariant along one direction thus defining a one-dimensional lattice with a single primitive vector pointing in the same direction as the reciprocal vector and a single sum in equation (2).

When the hologram is subsequently illuminated by a plane wave, assumed to be propagating along the optical axis for simplicity, the transmitted field is proportional to the hologram’s transmittance function and is thus composed of many waves traveling along different directions defined by each term in the Fourier series with a nonzero Fourier coefficient. These nonvanishing terms correspond to the diffraction orders of the grating structure encoded into the hologram [50, 66]. Each diffraction order carries a fraction of the power incident on the grating. This fraction defines the diffraction efficiency of a given order which is determined by the corresponding Fourier coefficient via

$$ \eta_d^{(m_1, m_2)} = |T_{m_1 m_2}|^2. \qquad (3) $$

For the particular case of the interference-generated hologram given in equation (1), the Fourier series takes the following simple form,

$$ T(\mathbf{r}) = R^2 + A^2 + R A e^{-i\phi} e^{2\pi i \mathbf{v} \cdot \mathbf{r}} + R A e^{i\phi} e^{-2\pi i \mathbf{v} \cdot \mathbf{r}}, \qquad (4) $$

where only three Fourier components are nonzero, and there is only one primitive vector. The corresponding reciprocal vector is equal to the carrier frequency vector, that is $b = \nu$. Each diffraction order has a particular structure encoded into the corresponding Fourier coefficients. In particular, the Fourier coefficient for the diffraction order $m = -1$ is proportional to the target field that was encoded. Therefore, in order to be able to shape the input light into the target field, it is necessary to separate this diffraction order from the others. This is done via the 4f system shown in figure 1. First, the field produced by illuminating the hologram is propagated through a 2f system in order to obtain the Fourier transform of the transmittance function. In the Fourier plane, all the diffraction orders are separated spatially so that the one containing the target field information can be filtered by placing a small aperture. Then, the filtered diffraction order is propagated through another 2-f system in order to perform a second Fourier transform and thus obtain a shaped field which ideally should be equal to the target up to a uniform scaling.

When encoding a complex field into a hologram, one needs to fix a value for the carrier frequency vector $\nu$. The norm of $\nu$ needs to be large enough to be able to sample the target field correctly and to avoid overlapping information between neighboring diffraction orders. Both are ensured by taking $||\nu||$ at least larger than twice the bandwidth of the target field in accordance to the Nyquist sampling theorem [66]. Or,
vice versa, if $\nu$ is fixed then only fields with a bandwidth smaller than $||\nu||/2$ can be shaped appropriately. Once $\nu$ has been fixed, the location of the desired diffraction order and thus of the aperture is given by $\mathbf{r}_a = -\lambda f_1 \nu$ with $\lambda$ being the wavelength of the incident light and $f_1$ the focal length of the first lens in the 4f system. The size of the aperture, $d$, needs to satisfy two conditions. It needs to be large enough so that the full bandwidth of the target field can propagate through but small enough so that no light from the surrounding diffraction orders can pass. The optimal choice of these parameters depend on the type of target fields one wishes to produce and the medium in which the hologram is encoded as will be seen in the following sections. Lastly, given that the shaped field is the desired output, it makes sense to align the optical axis of the 4f system with respect to its propagation direction as depicted in figure 1. By doing this, the filtered diffraction order lies on the optical axis and is centered with respect to the second lens, thus removing the phase tilt from the shaped field. Otherwise, the output shaped field will come at an angle which needs to be taken into account.

## 2.2. Computer-generated holograms

With the advent of computer generated holograms [44–50], it was soon realized that there was no need to restrict oneself to holograms of the form given by equation (1). The interference-generated hologram could then be adapted to the following transmittance function [49, 50],

$$T(\mathbf{r}) = \frac{1}{2} + \frac{A}{2} \cos(2\pi \nu \cdot \mathbf{r} - \phi) = \frac{1}{2} + \frac{A}{4} (e^{-i\phi} e^{2\pi i \nu \cdot \mathbf{r}} + e^{i\phi} e^{-2\pi i \nu \cdot \mathbf{r}}), \quad (5)$$

where it is assumed that the amplitude $A$ lies between zero and one. This assumption will be made in the remainder of this work. It can be easily verified that this off-axis hologram shapes light in the same way as the interference-generated hologram presented in the previous section, that is, by producing three diffraction orders with the $m_1 = -1$ one containing the desired target field which is produced with a diffraction efficiency of 6.25%. It is worth to emphasize that, for shaping a complex field, the gratings that form the hologram are spatially dependent on the amplitude $A(\mathbf{r})$ and the phase $\phi(\mathbf{r})$. Therefore, the diffraction efficiency is also spatially dependent. Nonetheless, the maximum diffraction efficiency obtained when $A = 1$ and given by equation (3) is used as a reference.

There are, however, other less obvious alternatives. For example, the transmittance function based on the grayscale Lee sampling hologram [50, 67],

$$T(\mathbf{r}) = \frac{A}{2} [\cos(2\pi \nu \cdot \mathbf{r} - \phi) + |\cos(2\pi \nu \cdot \mathbf{r} - \phi)|], \quad (6)$$

also generates the desired object field. In order to verify that this is indeed the case, the transmittance function is expanded into a Fourier series,

$$T(\mathbf{r}) = \frac{A}{4} \left[ e^{-i\phi} e^{i2\pi \nu \cdot \mathbf{r}} + e^{i\phi} e^{-i2\pi \nu \cdot \mathbf{r}} + \sum_{n=-\infty}^{\infty} c_n e^{-2in\phi} e^{i4n\pi \nu \cdot \mathbf{r}} \right], \quad (7)$$

where

$$c_n = \frac{(-1)^{n+1}}{\pi} \frac{4}{4n^2 - 1}, \quad (8)$$

and $m = 2n$ with $m$ being the index of the Fourier series as in equation (2). In this case the hologram produces an infinity of diffraction orders, with the same primitive vector as before. Here, again the target field is encoded into the $m = -1$ order, which has the same diffraction efficiency as the off-axis hologram. Note that from the diffraction orders shown in figure 2 it is not immediately evident that they indeed have the same diffraction efficiency since the Lee sampling hologram has many more orders. Nonetheless, the energy in these order comes from removing some of it for the zeroth order as can be appreciated by comparing equations (5) and (7).

The diffraction order containing the target field information for both holograms can be filtered out using the same setup shown in figure 1. Figure 2 demonstrates the shaping of a Laguerre–Gauss (LG) beam with a topological charge equal to two [68–70] using these two holograms. Both the off-axis and Lee sampling holograms encode the information about the target field similarly. The phase information is encoded into the position of the fringes that make the grating, and the amplitude into the peak-to-valley value of the fringes. However, a clear difference between the two can be appreciated, particularly at the Fourier plane where we can appreciate the various diffraction orders. Nonetheless, both holograms produce a satisfactory shaped field which is indistinguishable from the target.
<figure><img src="image_5.png" /><figcaption>Figure 2. Comparison between the amplitude grayscale (first column) off-axis and (second column) sampling Lee holograms, and the binary (third column) parallel and (fourth column) orthogonal Lee holograms for shaping light into a Laguerre-Gauss (LG) beam with a phase vortex of order two. (first row) The transmittance function of the hologram where the inset provides a closer view at the underlying amplitude modulation. (second row) The amplitude of the Fourier transform of the corresponding hologram in log scale where the various diffraction orders are clearly visible. (third row) The resulting shaped field, which for all cases is indistinguishable from the target shown in the inset of the first shaped field.</figcaption></figure>

### 3. Binary amplitude modulated holograms

In the previous section, it was assumed that the transmittance function can take any value between 0 and 1. However, as was mentioned in the introduction, this is not the case for DMDs which only provide a binary amplitude modulation. Even thought the use of DMDs to shape light is relatively recent, the encoding of binary amplitude modulated holograms for shaping light was thoroughly addressed more than half a century ago [44, 46–48, 50]. This was due to the fact that nonlinearities in the printing process made the printing of binary holograms more accurate than grayscale ones [47, 50]. The first attempts at encoding a target field into a binary amplitude hologram were directly based on trying to adapt the off-axis gray-scale hologram in equation (5) by simply setting all values above the mean to be one and the rest to be zero [71]. This leads to a transmittance function of the form

$$T(\mathbf{r}) = \frac{1}{2} + \frac{1}{2} \operatorname{sgn}[\cos(2\pi\nu \cdot \mathbf{r} - \phi)], \quad (9)$$

where

$$\operatorname{sgn}(x) = \begin{cases} 1, & x > 0 \\ -1, & \text{otherwise} \end{cases} \quad (10)$$

is the sign function. Here, the phase information is still encoded into the position of the fringes that form the hologram. However, the information about the amplitude distribution of the target field is lost. Nevertheless, it is possible to modify this first approximation in order to regain the amplitude encoding. There are two main types of holograms that accomplish this, which unfortunately go by the same name of Lee holograms [44, 47, 48, 50]. In order to distinguish them, an adjective will be added to their name based on how the amplitude is encoded into them.
### 3.1. Parallel Lee hologram

The first one is the parallel Lee hologram which is obtained when one tries to fix the hologram in equation (9) by encoding the amplitude using a different threshold than the mean value [44, 47, 48, 50]. This leads to the following transmittance function

$$T(\mathbf{r}) = \frac{1}{2} + \frac{1}{2}\operatorname{sgn}[\cos(2\pi\nu \cdot \mathbf{r}) - \phi) - \cos(\pi q)], \quad (11)$$

where $q$ controls the threshold. To better understand the effect of $q$ and its relation to $A$, it is worth rewriting the transmittance function in the following manner,

$$T(\mathbf{r}) = \sum_{n=-\infty}^{\infty} \operatorname{rect}\left(\frac{\nu \cdot \mathbf{r} - \phi/2\pi - n}{q}\right), \quad (12)$$

where

$$\operatorname{rect}(x) = \begin{cases} 1, & |x| < 1/2 \\ 0, & \text{otherwise} \end{cases}. \quad (13)$$

Here, it can be seen that the hologram is composed of binary fringes whose duty cycle, or width, is controlled by $q$. This change in width can be exploited to encode the amplitude variations of the target field $A$. This can be seen by rewriting the transmittance function as a Fourier series given by

$$T(\mathbf{r}) = \sum_{m=-\infty}^{\infty} \frac{\sin(\pi mq)}{\pi m} e^{-im\phi} e^{2\pi im\nu \cdot \mathbf{r}}. \quad (14)$$

Here again, there is a single primitive vector whose reciprocal is equal to $\nu$, and there are an infinite number of diffraction orders which are uniformly spaced. The target field is encoded into the Fourier coefficient for the $m = -1$ order which is given by

$$T_{-1} = \frac{A}{\pi} e^{i\phi}, \quad \text{with} \quad A = \sin \pi q. \quad (15)$$

Thus establishing a nonlinear relation between $q$ and $A$. As can be appreciated in the example shown in figure 2, the larger the duty cycle is, the larger the amplitude, and vice versa. Under appropriate conditions, and neglecting any effects due to the discretization of the pixels, the resulting shaped field is indistinguishable from the target, just like for the gray-scaled holograms. From equation (15), it can also be seen that the diffraction efficiency is equal to 10.1% which is larger than that of the gray scale holograms.

### 3.2. Orthogonal Lee hologram

Thus far, all the holograms that have been presented encode both the amplitude and phase information along the same direction determined by the carrier frequency $\nu$. In contrast, the orthogonal Lee hologram decouples these two encodings by using the orthogonal direction to encode the amplitude distribution of the target field [44, 47, 48, 50]. This is achieved by considering the following transmittance function

$$T = \left( \frac{1}{2} + \frac{1}{2} \operatorname{sgn}[\cos(2\pi \nu \cdot \mathbf{r} - \phi)] \right) \left( \frac{1}{2} + \frac{1}{2} \operatorname{sgn}[\cos(2\pi \nu_{\perp} \cdot \mathbf{r}) - \cos(\pi A)] \right), \quad (16)$$

where $\nu_{\perp}$ is the carrier frequency for the amplitude modulation, which satisfies $\nu \cdot \nu_{\perp} = 0$. Once more, in order to get a better sense of how this hologram encodes the target field's information, the transmittance function can be rewritten in the following manner

$$T(\mathbf{r}) = \sum_{n_1=-\infty}^{\infty} \sum_{n_2=-\infty}^{\infty} \operatorname{rect}\left(\frac{\nu \cdot \mathbf{r} - \phi/2\pi - n_2}{1/2}\right) \operatorname{rect}\left(\frac{\nu_{\perp} \cdot \mathbf{r} - n_1}{A}\right). \quad (17)$$

Just like for the parallel Lee hologram, the phase is encoded in the position of the binary fringes along the $\nu$ direction, but their widths are now held constant. The amplitude encoding is done in the $\nu_{\perp}$ direction in which parts of the fringes are set to zero in order to create an array of rectangles of fixed width but whose height is adjusted to the desired amplitude of the target field following a linear relationship. To verify that this hologram indeed produces the desired shaped field, we can again decompose it in terms of its Fourier series

$$T = \sum_{m_1=-\infty}^{\infty} \sum_{m_2=-\infty}^{\infty} \frac{\sin(\pi m_1/2)}{\pi m_1} \frac{\sin(\pi m_2 A)}{\pi m_2} e^{-im_1 \phi} e^{i2\pi(m_1\nu + m_2\nu_{\perp})\cdot\mathbf{r}}. \quad (18)$$
In this case, due to the encoding along both axes, there are two primitive vectors and whose reciprocal vectors are $\mathbf{b}_1 = \mathbf{v}$ and $\mathbf{b}_2 = \mathbf{v}_\perp$ which define a two-dimensional lattice for the diffraction orders. In particular, the target field information is encoded into the Fourier coefficient of the order ($m_1 = -1, m_2 = 0$) which is given by

$$T_{-1,0} = \frac{A}{\pi} e^{i\phi}, \qquad (19)$$

where the linear relation between the height of the rectangles and A can be appreciated. This linear dependence is achieved by creating a grating along the $\mathbf{v}_\perp$ direction which diverts energy from the filtered order into the transverse orders with $m_2 \neq 0$. This hologram offers the same diffraction efficiency as the parallel Lee hologram since they are the same when modulating the maximum amplitude value, i.e. when $A = 1$. Figure 2 also shows the shaping of the same LG mode using this hologram. Here again, under appropriate conditions, the resulting shaped field is indistinguishable from the target, just like for the other holograms. Likewise, we see how the amplitude encoding is achieved by sending energy into orders in the orthogonal direction which are not present for the corresponding parallel Lee hologram.

It is worth noticing that for this hologram there are two carrier frequency vectors that need to be chosen. Nonetheless, similar rules apply to the choice of $\mathbf{v}_\perp$ as those that were mentioned earlier for $\mathbf{v}$. Here, $\|\mathbf{v}_\perp\|$ controls the separation of the diffraction order along the $\mathbf{v}_\perp$ direction and so its norm should be larger that the bandwidth of the target field in order to sample it correctly and avoid overlap with the neighboring diffraction orders. Because of this, it is generally good practice to set $\|\mathbf{v}_\perp\| = \|\mathbf{v}\|$, which is what will be assumed in the remainder of this work. Nonetheless, for some particular fields for which the variations of amplitude and phase differ significantly, it is certainly possible to adapt these values.

# 4. Discretization of the holograms

## 4.1. Lee holograms

Up until now, we have been assuming that there are no restrictions in the resolution a given hologram can have. But in reality, DMDs have a limited resolution dictated by the number of micro-mirrors which are assumed to be arranged on a Cartesian grid as shown in figure 3. Given this Cartesian layout, one can argue that the most natural choice is to align the hologram with the pixel array with the carrier frequency pointing along the $x$ axis. Taking into account the discretization induced by the micro-mirrors, in order to end up with a periodic grating, the carrier frequency values must be limited to the form $\mathbf{v} = (1/p, 0)$ where $p$ is an integer larger than one defining the periodicity of the grating in pixel units. For simplicity, in everything that follows, all spatial units will be normalized by the pixel pitch defining the distance between neighboring pixels. In this way, all distances are in pixel units where one pixel is equal to one micro-mirror. A similar restriction holds for $\mathbf{v}_\perp$ in the orthogonal Lee hologram and so its value is set to $\mathbf{v}_\perp = (0, 1/p)$. It is also possible to write a single transmittance function encompassing both types of Lee holograms as

$$T(\mathbf{r}) = \sum_{n_1=-\infty}^{\infty} \sum_{n_2=-\infty}^{\infty} \mathrm{rect}\left[\frac{x - n_1 p - s_x}{w_x}\right] \mathrm{rect}\left[\frac{y - n_2 p}{w_y}\right], \qquad (20)$$

where $w_x$ and $w_y$ are the width and height of the rectangles, respectively, in pixel units, and $s_x$ controls the shift of the gratings. Its Fourier series is then given by

$$T(\mathbf{r}) = \sum_{m_1=-\infty}^{\infty} \sum_{m_2=-\infty}^{\infty} \frac{\sin\left(\frac{\pi m_1 w_x}{p}\right) \sin\left(\frac{\pi m_2 w_y}{p}\right)}{\pi m_1 \pi m_2} e^{-2\pi i m_1 \frac{x}{p} e^{i \frac{2\pi}{p} (m_1 x + m_2 y)}} \qquad (21)$$

from which the ($m_1 = -1, m_2 = 0$) diffraction order used to encode the target field can be seen to be given by

$$T_{-1,0} = \frac{w_y}{\pi p} \sin\left(\frac{\pi w_x}{p}\right) e^{2\pi i \frac{x}{p}}. \qquad (22)$$

Just as before, the spatial distribution of the target field is encoded into a combination of $w_x$, $w_y$, and $s_x$. In particular, since $w_x$ and $w_y$ can only take integer values between zero and $p$, from equation (22) it can be seen that the discretization also affects the diffraction efficiency. When $p$ is even the $\eta_d = 1/\pi^2$ just like before, whereas when $p$ is odd $\eta_d = \sin^2[\pi(p-1)/2p]/\pi^2$ which is slightly lower but tends to $1/\pi^2$ as $p$ increases.

Given the finite number of pixels within each period, $w_x$ and $w_y$ can take at most $p$ integer values which entails a quantization of the possible amplitude values that can be encoded in the hologram. However, when
<figure><img src="image_6.png" /><figcaption>**Figure 3.** Discretization of the amplitude and phase values that can be encoded into the parallel and orthogonal Lee holograms when they are aligned with the Cartesian layout of the DMD's micro-mirrors when $v = (1/4, 0)$. The gratings are color coded according to the complex value they encode. For the parallel Lee hologram, since the amplitude and phase are encoded along the same direction, the amplitude encoding depends on the phase encoding and vice versa. This interdependence can be seen from the fact that only two amplitude values can be achieved, and for each, the phases that can be encoded are different. In contrast, the orthogonal Lee hologram allows us to freely choose the amplitude and phase values independently of each other, while also enabling a larger number of complex values to be encoded.</figcaption></figure>

taking a closer look at the encoded amplitude dependence on $w_x$ and $w_y$ in equation (22), it can be seen that there are only $\lfloor p/2 \rfloor$ values of $w_x$ leading to a different amplitude whereas there are $p$ values for $w_y$. This is depicted in figure 3 for $p=4$, where the difference in the number of amplitude values that can be encoded between the parallel and orthogonal Lee holograms is evident. Likewise, for a given $w_x$ value, $p$ distinct uniformly distributed phase values can be encoded. However, these values depend on the parity of the width $w_x$ since this dictates whether the center of the fringes coincide with the center of a pixel or with a boundary between two. Since in equation (20) it was assumed that the origin of the Cartesian axes lies in the middle of a pixel, when $w_x$ is odd then $s_x = 0, 1, \dots, p-1$, and when $w_x$ is even then $s_x = 1/2, 3/2, \dots, (p-1)/2$. It must be noted that, in general, this supplementary phase values will be achieved for a different amplitude value thus creating a dependence between the amplitude and phase encodings for the parallel Lee hologram. Therefore, for a given $w_x$ value $p$ distinct uniformly distributed phase values can be encoded. This quantization is again depicted in figure 3.

To better understand the differences between the two types of Lee holograms, the shaping of a field with a phase vortex and with its amplitude increasing linearly from the center towards the edge is shown in figure 4. Here, regions where the phase and amplitude values are constant can clearly be appreciated. This is a manifestation of the quantization of the attainable complex values due to the discretization of the micromirror layout. This quantization can be further appreciated in figure 5 where the amplitude variation along different directions and the phase variations for varying radii exhibit a clear step-wise structure decorated by oscillations resulting from diffraction effects. Likewise, clear differences can be appreciated between the shaped fields resulting from the two types of holograms. The shaped field created by the parallel Lee holograms is not as uniform as the one created by the orthogonal one. This is a consequence of encoding both the phase and amplitude values along the same direction which creates a dependence between the two and reduces the number of achievable amplitude values with respect to the orthogonal one. Likewise, the doubling of achievable phase values at different amplitude values for the parallel Lee can be appreciated. Moreover, the nonlinear relationship relating the width to the amplitude for the parallel Lee concentrates most amplitude values around one. In comparison, for the orthogonal Lee the achievable amplitude and phase modulations are independent. Only a slight difference is appreciable at the boundaries between phase regions which is due to the sudden change in the hologram pattern. All the corresponding gratings leading to these values are depicted in figure 3. It is worth emphasizing that, even though the expression in equation (20) has been used to gain a deeper understanding of the consequences of discretizing the holograms, in practice, the other expressions given in equations (11) and (16) are used to generate the corresponding holograms since they are simpler to implement and computationally more efficient.
<figure><img src="image_7.png" /><figcaption>**Figure 4.** Shaping of a target circular field with a vortex at the center and with a linearly increasing amplitude using the parallel and orthogonal Lee, and Haskell holograms aligned with the pixel array and with $\nu = (1/4, 0)$. (first row) The binary holograms of size 800 × 800 aligned with the axis of the pixels, as shown in the inset. (second row) Logarithm of the amplitude of the Fourier transform of the holograms where we can clearly see the various diffraction orders. The white circle denote the position and size of the aperture used for the filtering. (third row) The shaped field where the variations along the overlaid white circles and segments are shown in figure 5.</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>**Figure 5.** (left) Amplitude and (right) phase variations obtained for the shaped field as a function of the target values along the white line segments and circles overlaid on the target field shown on the corresponding insets when using the Lee and Haskell holograms to produce the vortex disk field of figure 4.</figcaption></figure>

Despite the differences between both types of Lee holograms, neither of them produces a satisfactory shaped field in figure 4. In both cases, large areas with constant amplitude and phase values are clearly visible thus causing significant deviations from the target field. This problem arises from the limited number of complex values that can be encoded into the hologram as shown in figure 3. A possible solution would be to increase *p* since the number of both amplitude and phase values increases with *p*. The problem with this approach is that now more pixels of the DMD need to be used to encode a specific complex value. Assuming the target field varies smoothly, at least *p* × *p* sized super pixels need to be used to appropriately encode a given complex value. The number of super pixels in essence represents the number of available degrees of
<figure><img src="image_9.png" /></figure>

freedom on the DMD that can be used to shape light and thus limits the bandwidth of the fields that can be generated. Therefore, the ideal solution is to keep the same $p$ while finding alternative ways to increase the number of achievable phase and amplitude values.

## 4.2. Haskell hologram

One possible solution to increase the number of complex values that can be encoded while keeping the same value for $p$ is to merge both types of Lee holograms. In this case, the hologram would be composed of rectangles whose position, width and height would be adjusted to encode a target complex value. However, since there is no univocal relation between a complex value and the parameters of the rectangles, i.e. there can be several rectangles that encode the same complex value, a look-up table mapping a complex value to a specific rectangle would have to be constructed. However, if a look-up table is going to be used, there is a better alternative. As proposed by Haskell more than half a century ago [45, 46], one can instead consider combinations made out of the smallest units used to encode a hologram with a given period. These unit elements can then be used as basis elements to create more general grating structures that need not be composed of rectangles but can have more general shapes which can lead to supplementary phase and amplitude values. Figure 6 shows the basic principle behind this method.

A Haskell hologram is a two-dimensional array with primitive vectors $a_1 = (p, 0)$ and $a_2 = (0, p)$ of superpixels formed by grouping $p \times p$ pixels. As shown in figure 6, the Haskell basis elements are those in which a single pixel within the superpixel is turned on and thus form rectangular gratings with $w_x = w_y = 1$, and varying shifts along $x$ and $y$. A given target complex value is encoded by finding the superposition of these basis elements that encode the complex value that is closest to the target. To determine which complex values can be encoded into these holograms, it is necessary to derive the Fourier coefficient of the $(m_1 = -1, m_2 = 0)$ diffraction order of the transmittance function obtained from such a superposition. From equations (20) and (21) it can be deduced to be given by,

$$T_{-1,0} = \sum_{s_x=1}^{p} \sum_{s_y=1}^{p} \frac{c_{s_x s_y}}{\pi p} \sin\left(\frac{\pi}{p}\right) e^{2\pi i \frac{s_x-1}{p}}, \qquad (23)$$

where the coefficients $c_{s_x s_y}$ are either one or zero. From this expression, it can be seen that the basis elements that differ in a shift $s_x$ along $x$ encode different phase values. This leads to the encoding of $p$ distinct phase values that are uniformly distributed between 0 and $2\pi$ and with the same amplitude encoding. From the previous equation it can be seen that there is a clear degeneracy along the $y$ direction since the $p$ basis elements corresponding to different shifts $s_y$ lead to the same complex value encoding as depicted in figure 6.
Additionally, it is generally possible to have different combination of basis elements with different phase values that encode the same complex value. Therefore, a look-up table mapping a complex value to a specific combination of the basis elements needs to be created since there is no univocal relationship between the two. In practice, when constructing a Haskell hologram, the first step is to take the image of the target complex field having the same resolution as that of the DMD and down sampling it by a factor of p along each direction. In this way each point of the down-sampled array identifies the complex value that needs to be encoded into the corresponding superpixel. The value of each pixel within the superpixel is determined through the look-up table.

To get a better sense of which complex values can be encoded into a Haskell hologram it is possible to remove the shift $s_y$ from the Fourier coefficient by writing it as

$$T_{-1,0} = \sum_{s_x=1}^{p} \frac{C_{s_x}}{\pi p} \sin\left(\frac{\pi}{p}\right) e^{2\pi i \frac{s_x-1}{p}}, \qquad (24)$$

where $C_{s_x}$ can take integer values from zero to p, and simply represents the number of pixels along y that are set to one, but does not specify which ones. In this way, the different field values that can be encoded with each basis elements correspond to those with the same phase value as before but with p amplitudes values uniformly distributed between 0 and p. The constellation of possible complex values that can be encoded is then determined by considering all possible combinations of the basis elements as shown in figure 6.

Figures 4 and 5 show the results of using the Haskell hologram to shape the same field that was used to study the discretization effects on the Lee holograms. The improvements are evident, while there are still regions with constant phase and amplitude values, they are much smaller and thus produce a much smoother shaped field that clearly resembles the target field. This smoothness is particularly visible in figure 5 for the phase modulations which deviate only slightly from the target values. The amplitude values, however, could still be improved since the achievable values remain noticeably dependent on the particular direction. Now, to readers that might be familiar with the different holograms that have been proposed to shape light with DMDs, this method might seem equivalent to the superpixel method proposed more recently in [72]. However, they differ in a small detail that has a big impact on the number of complex values that can be encoded. Nonetheless, Haskell's holograms can be seen as the direct ancestor to the superpixel hologram even though this connection appears to have been lost over time.

# 5. Tilting the hologram

## 5.1. Lee holograms

While aligning the hologram with the pixel array seems natural, it might not be the best choice. Let us then consider what happens when the hologram is tilted with respect to the axes of the pixel array. For the sake of simplicity, only the particular case using of the holograms for phase modulation will be treated in full. Given the discretization of the pixels, in order to get a periodic structure in the hologram, the components of the carrier frequency vector need to be chosen as $\nu = (1/p_x, -1/p_y)$ where $p_y/p_x = k$ with k being an integer. Here it was assumed that $p_y \ge p_x$ without loss of generality. Given these assumptions, the resulting hologram is formed by a two-dimensional lattice of rectangles of width $w_x = \lfloor p_x/2 \rfloor$ and height $w_y = k$ and whose primitive vectors are $\mathbf{a}_1 = (p_x, 0)$ and $\mathbf{a}_2 = (1, k)$. Examples of this lattice are shown in figure 7 for $p_x = 1/4$ and $p_y = 1/16$.

The transmittance function for this hologram can be written as

$$T(\mathbf{r}) = \sum_{m_1=-\infty}^{\infty} \sum_{m_2=-\infty}^{\infty} \mathrm{rect}\left[\frac{x - m_2 p_x - m_1 - s_x}{w_x}\right] \mathrm{rect}\left[\frac{y - k m_1 - s_y}{w_y}\right]. \qquad (25)$$

As before, in order to understand which phase values can be encoded into this hologram, the transmittance function is expanded into a Fourier series giving

$$T(\mathbf{r}) = \sum_{m_1=-\infty}^{\infty} \sum_{m_2=-\infty}^{\infty} \frac{\sin\left(\pi m_1 \frac{w_x}{p_x}\right) \sin\left[\pi\left(m_2 - \frac{m_1}{p_x}\right) \frac{w_y}{k}\right]}{\pi m_1 \pi\left(m_2 - \frac{m_1}{p_x}\right)} e^{-i2\pi m_1 \left(\frac{s_x}{p_x} - \frac{s_y}{p_y}\right)} e^{-i2\pi m_2 \frac{s_y}{k}} \\ \times e^{i2\pi m_1 \left(\frac{x}{p_x} - \frac{y}{p_y}\right)} e^{i2\pi m_2 \frac{y}{k}}. \qquad (26)$$

Here, it can be seen that the diffraction pattern creates a reciprocal two-dimensional lattice with $\mathbf{b}_1 = \nu = (1/p_x, -1/p_y)$ and $\mathbf{b}_2 = (0, 1/k)$ which satisfy $\mathbf{a}_i \cdot \mathbf{b}_j = \delta_{ij}$. By filtering the $(m_1 = -1, m_2 = 0)$
<figure><img src="image_10.png" /></figure>

order, the shaped field will be proportional to

$$T_{-1,0} = \frac{p_x}{\pi^2} \sin\left(\pi \frac{w_x}{p_x}\right) \sin\left(\pi \frac{w_y}{p_x k}\right) e^{i2\pi \left(\frac{s_x}{p_x} - \frac{s_y}{p_y}\right)}. \qquad (27)$$

The first thing to notice from this expression is the total number of possible phase values that can be encoded. The smallest phase shift is now $2\pi/p_y$ which is produced when shifting the hologram by one pixel along the y direction. Therefore, the total number of phase values that can be encoded for a given value of $w_x$ and $w_y$ is increased by a factor of $k$. This drastic increase in phase values is exemplified in figure 7.

A crucial point is that this increase in the number of phase values comes at no cost in the number of degrees of freedom of the DMD, and thus of the resolution of the shaped field, with respect to the hologram obtained when $\nu = (1/p_x, 0)$ as long as $k \le p_x$. The only significant cost comes from the smaller prefactors in equation (27) when compared to those in equation (24) which diminish the diffraction efficiency of the grating since some light is now being diffracted along the y direction. This might be an important factor to consider if minimizing losses is more important than increasing the shaping accuracy. However, for applications in which losses need to be avoided at all costs, using phase-only SLMs is the optimal strategy since they can achieve 100% diffraction efficiency (neglecting the losses due to the pixelisation of the device and other technical considerations) [51–54]. It is also important to determine the optimal tilt angle of the hologram which is determined by the choice of $p_y$ for a given $p_x$. From equation (27) it can be seen that if the hologram is tilted at 45°, which is one of the most common choices, then $p_y = p_x$ and $k = 1$ so that there is no increase in the number of phases values that can be encoded. In contrast, the smaller the tilt the larger $p_y$ and $k$ are, and so is the number of phase values. However, if $p_y > p_x^2$ then the unit cell of the lattice starts becoming larger which lowers the resolution with respect to the aligned hologram. A good compromise is to take $p_y = p_x^2$.

Figures 8 and 9 show the drastic improvement provided by tilting the hologram on the shaping of the same target field as the one used in figures 4 and 5. For both Lee holograms it can be seen that the phase variations are much smoother, with the step-like dependence being barely noticeable in figure 9. Nonetheless, there is a clear difference for the amplitude variation between the two holograms. For the orthogonal Lee hologram the amplitude variations are fairly smooth whereas for the parallel Lee hologram large deviations from the target values can still be observed which depend on the phase value being encoded. Therefore, as was mentioned before, decoupling the phase and amplitude encodings allows for the independent encoding of the amplitude and phase information while also creating more uniform and smoother fields.

## 5.2. Superpixel hologram

Even though tilting the Lee holograms allows for a much smoother an accurate shaping of light, some applications might require a better field accuracy. As for the case in which hologram was aligned with the
<figure><img src="image_11.png" /><figcaption>**Figure 8.** Shaping of a target circular field with a vortex at the center and with a linearly increasing amplitude using the parallel and orthogonal Lee, and superpixel holograms tilted with respect to the pixel array with $v = (1/4, -1/16)$. (first row) The binary holograms of size 800 × 800 aligned with the axis of the pixels, as shown in the inset. (second row) Logarithm of the amplitude of the Fourier transform of the holograms where we can clearly see the various diffraction orders. The white circle denote the position and size of the aperture used for the filtering. (third row) The shaped field where the variations along the overlaid white circles and segments are shown in figure 5.</figcaption></figure>

<figure><img src="image_12.png" /><figcaption>**Figure 9.** (left) Amplitude and (right) phase variations obtained for the shaped field as a function of the target values along the white line segments and circles overlaid on the target field shown on the corresponding insets when using the Lee and super pixel holograms to produce the vortex disk field of figure 8.</figcaption></figure>

micro-mirror array, the ideal scenario would be to achieve a higher number of complex values without altering the resolution, that is keeping $v$ constant. Taking a similar approach as for the Haskell hologram, it is possible to construct a more general type of hologram by superimposing the smallest grating units that satisfy the same lattice structure, and thus the same primitive vectors. For given $p_x$ and $p_y$, there are a total of $k \times p_x = p_y$ distinct basis elements with their transmittance function being equal to that in equations (25) and (26) with $w_x = w_y = 1$. Therefore, the Fourier coefficient for the $(m_1 = -1, m_2 = 0)$ diffraction order
<figure><img src="image_13.png" /><figcaption>**Figure 10.** Writing a binary Haskell hologram. The top figure shows all the possible grating basis elements when $p = 4$ where the hue indicates the phase value that is encoded in them. The several basis elements which encode the same phase value can be combined to encode higher amplitude values that make up the various field values of basis elements. These field values can then be combined in order to obtain the constellation of complex values shown in the bottom row. To encode any such value a look-up table is used to determine the appropriate combination of basis elements and grating structure.</figcaption></figure>

resulting from a superposition of the various basis elements can be directly written as

$$T_{-1,0} = \frac{p_x}{\pi^2} \sin\left(\frac{\pi}{p_x}\right) \sin\left(\frac{\pi}{p_y}\right) \sum_{s_x=1}^{p_x} \sum_{s_y=1}^{p_y} c_{s_x s_y} e^{i2\pi \left(\frac{s_x}{p_x} - \frac{s_y}{p_y}\right)}, \quad (28)$$

where the coefficients $c_{s_x s_y}$ are either one or zero. Therefore, this superpixel hologram can encode any complex value that results from the superposition of $p_x \times k$ complex numbers uniformly distributed along a circle in the complex plane [72, 73]. Figure 10 shows all the basis elements for the particular case $p_x = 4$ and $p_y = 16$, along with the resulting complex values and an example the resulting diffraction grating for encoding a particular complex value. This type of hologram goes by the name of superpixel, since a given target complex value is encoded in a superpixel made of $p_x \times k$ pixels whose values are chosen with a look-up table to determine the appropriate combination that provides the closest value to the target. The enhanced shaping capabilities provided by the superpixel method can be fully appreciated in figures 8 and 9. It provides both the smoothest phase and amplitude variations. It must be noted that most amplitude oscillations come from diffraction effects stemming from the aperture used for the filtering and not the discretization of amplitude values in the hologram.

Having introduced Haskell's method, it is clear that the only difference, albeit a crucial one, is the tilt that is introduced for the superpixel method which allows lifting the degeneracy for the phase values. Note that for the original superpixel method $p_y = p_x^2$ which is the smallest value of $p_y$ which fully lifts the phase degeneracy and creates square superpixels. While not stressed in the original work [72], this tilt is a crucial component for the superpixel method. One cannot simply treat each superpixel independently since neighboring superpixels along $y$ need to be shifted by one pixel along $x$ in order to create the appropriate hologram. This shift can be seen in figure 10.

## 6. Closing remarks

Despite DMDs only providing a binary amplitude modulation with a finite number of pixels, it is possible to shape complicated light fields through specially designed holograms, which include the parallel and orthogonal Lee holograms, and the superpixel method. This is exemplified in figure 11, where these three types of holograms have been used to successfully shape higher-order Hermite-Gauss (HG) and LG beams, as well as a speckle field. This, however, is only achieved by appropriately tilting the hologram with respect to the axes of the micro-mirror array so that the carrier frequency of the hologram is given by $\nu = (1/p_x, 1/p_x^2)$, with $p_x$ being the period along the $x$ direction of the array in pixel units. This choice allows for keeping the
<figure><img src="image_14.png" /><figcaption>**Figure 11.** Shaping of complex optical fields using tilted Lee and superpixel holograms with $\nu = (1/4, -1/16)$ for two maximum values for the amplitude modulation. The complex fields being considered are high-order (first row) Hermite-Gauss (HG) and (second row) LG beams and (third row) a speckle field obtained by from the random superposition of 100 plane waves with a Gaussian envelope. The holograms used to generate the shaped fields, as well as all the fields that are shown have a size of $780 \times 780$ pixels.</figcaption></figure>

<table><caption>**Table 1.** Field ($C_E$) and intensity ($C_I$) correlations between the shaped and target fields. The target fields are the same as those shown in figure 11 and the shaped fields were obtained using aligned and tilted versions of the parallel (||) and orthogonal (⊥) Lee holograms for four different values of the period. For $p_x = 3$ and 4 both the results of the Haskell and super pixel holograms were also included.</caption><thead><tr><th rowspan="2">Period (p<sub>x</sub>)</th><th rowspan="2">Hologram</th><th rowspan="2">η<sub>d</sub> (%)</th><th colspan="2">HG beam</th><th colspan="2">LG beam</th><th colspan="2">Speckle</th></tr><tr><th>C<sub>E</sub></th><th>C<sub>I</sub></th><th>C<sub>E</sub></th><th>C<sub>I</sub></th><th>C<sub>E</sub></th><th>C<sub>I</sub></th></tr></thead><tbody><tr><td rowspan="6">3</td><td>Aligned || Lee</td><td>7.6</td><td>43.6</td><td>13.8</td><td>60.2</td><td>36.7</td><td>73.4</td><td>55.9</td></tr><tr><td>Aligned ⊥ Lee</td><td>7.6</td><td>99.6</td><td>99.6</td><td>96.4</td><td>96.9</td><td>93.6</td><td>95.4</td></tr><tr><td>Tilted || Lee (k = p<sub>x</sub>)</td><td>5.2</td><td>77.0</td><td>85.1</td><td>94.8</td><td>91.7</td><td>95.7</td><td>94.9</td></tr><tr><td>Tilted ⊥ Lee (k = p<sub>x</sub>)</td><td>5.2</td><td>99.7</td><td>99.8</td><td>99.6</td><td>99.7</td><td>96.2</td><td>96.6</td></tr><tr><td>Haskell</td><td>7.6</td><td>99.3</td><td>99.3</td><td>96.5</td><td>97.2</td><td>92.1</td><td>94.5</td></tr><tr><td>Super pixel</td><td>5.2</td><td>99.8</td><td>99.9</td><td>99.7</td><td>99.7</td><td>96.6</td><td>96.6</td></tr><tr><td rowspan="6">4</td><td>Aligned || Lee</td><td>10.1</td><td>64.3</td><td>39.7</td><td>68.9</td><td>47.6</td><td>82.1</td><td>68.4</td></tr><tr><td>Aligned ⊥ Lee</td><td>10.1</td><td>99.7</td><td>99.7</td><td>92.3</td><td>95.5</td><td>93.8</td><td>94.4</td></tr><tr><td>Tilted || Lee (k = p<sub>x</sub>)</td><td>8.2</td><td>87.1</td><td>97.7</td><td>99.4</td><td>99.3</td><td>96.5</td><td>96.1</td></tr><tr><td>Tilted ⊥ Lee (k = p<sub>x</sub>)</td><td>8.2</td><td>99.6</td><td>99.7</td><td>99.4</td><td>99.3</td><td>94.9</td><td>95.4</td></tr><tr><td>Haskell</td><td>10.1</td><td>99.5</td><td>98.3</td><td>99.1</td><td>98.0</td><td>95.8</td><td>95.4</td></tr><tr><td>Super pixel</td><td>8.2</td><td>99.7</td><td>99.9</td><td>99.8</td><td>99.8</td><td>94.8</td><td>95.2</td></tr><tr><td rowspan="6">5</td><td>Aligned || Lee</td><td>9.2</td><td>52.6</td><td>36.1</td><td>76.2</td><td>59.1</td><td>86.9</td><td>78.1</td></tr><tr><td>Aligned ⊥ Lee</td><td>9.2</td><td>99.7</td><td>99.8</td><td>99.0</td><td>99.4</td><td>96.6</td><td>96.7</td></tr><tr><td>Tilted || Lee (k = p<sub>x</sub>)</td><td>8.0</td><td>96.4</td><td>99.5</td><td>99.9</td><td>99.8</td><td>96.4</td><td>95.5</td></tr><tr><td>Tilted ⊥ Lee (k = p<sub>x</sub>)</td><td>8.0</td><td>99.7</td><td>99.9</td><td>99.6</td><td>99.6</td><td>91.9</td><td>93.2</td></tr><tr><td>Aligned || Lee</td><td>10.1</td><td>65.2</td><td>46.9</td><td>83.0</td><td>69.2</td><td>89.1</td><td>83.3</td></tr><tr><td>Aligned ⊥ Lee</td><td>10.1</td><td>99.8</td><td>99.9</td><td>97.1</td><td>98.6</td><td>96.2</td><td>96.5</td></tr><tr><td rowspan="2">6</td><td>Tilted || Lee (k = p<sub>x</sub>)</td><td>9.2</td><td>97.1</td><td>99.8</td><td>99.9</td><td>99.8</td><td>95.7</td><td>94.2</td></tr><tr><td>Tilted ⊥ Lee (k = p<sub>x</sub>)</td><td>9.2</td><td>98.1</td><td>99.0</td><td>97.7</td><td>97.6</td><td>93.8</td><td>94.2</td></tr></tbody></table>

same number of degrees of freedom as those of the holograms that are aligned with $\nu = (1/p_x, 0)$ or at $45^\circ$ with $\nu = (1/p_x, 1/p_x)$, but drastically increases the number of complex values that can be encoded. The improvement provided by this optimal tilt is evident from the field and intensity correlation values shown in table 1 for various values of the period $p_x$, particularly for the parallel Lee hologram. For each field, the size of the aperture was chosen to be slightly larger than their bandwidth. It should be mentioned that the correlations resulting from the hologram at $45^\circ$ are almost identical to those obtained with the aligned holograms. Because of this they have been omitted from table 1.

Taking a closer look at the correlation values in table 1, it is possible to draw some general conclusion. Firstly, as $p_x$ increases, the difference between the tilted and aligned holograms goes away for all except the parallel Lee hologram, which seems to always benefit from the tilt due to its more restricted phase modulation. However, as $p_x$ increases it reaches a point in which the correlation starts diminishing since the lower number of degrees of freedom available are not sufficient to properly resolve fields with larger
bandwidths. This effect can be appreciated for the speckle field, which is the one with the largest bandwidth. It is also noteworthy that the superpixels methods do not always produce a more accurately shaped field than the corresponding tilted Lee holograms. Alongside the correlation values, the diffraction efficiencies for each type of hologram are also shown in table 1. These values show the drop that is caused by tilting the hologram, and that holograms with even $p_x$ have better efficiencies than the neighboring odd values.

Large differences between the shaped fields generated by the different types of tilted holograms start to appear when the amplitude modulation is limited, that is, when the maximum amplitude of a given field is set to a value lower than one. This limited modulation can appear when one uses the DMD to regulate the total input power, or when fixing the total amount of energy on the input fields so that the field with the highest amplitude enjoys the full amplitude modulation, but the amplitude modulation for all others is limited. The effect of limiting the amplitude modulation is shown in figure 11 for the same fields as before. There, it can be seen that the parallel Lee hologram presents the largest deviations from the target field, which was to be expected. As mentioned in previous sections, coupling the phase and amplitude encoding into the hologram along the same direction limits the number of achievable amplitude values. Moreover, it creates a dependency between the amplitude and phase encodings, which leads to the angular lobes in the shaping of the LG beam. For the orthogonal Lee holograms the resulting fields are noticeably closer to the targets, but some differences are clearly visible. In contrast, for the superpixel method there is no appreciable difference in the shaped field. This is due to the large number of complex values that can be encoded through this method, with many of them having an amplitude that is lower than the maximal one, as shown in figure 10.

Taking all these considerations into account, choosing $\nu = (1/p_x, -1/p_x^2)$ with $p_x = 4$ provides a good compromise between the number of complex values that can be encoded and the number of degrees of freedom. This choice allows for the accurate shaping of complex field with large bandwidth, i.e. fast spatial variation. While for most cases the tilted Lee holograms should be sufficient, this choice of $\nu u$ also allows using the super pixel method if accurate modulation is required for different amounts of energy. For applications requiring the maximum achievable resolution of the DMD while providing phase modulation, it is necessary to set $p_x = 2$. This value is generally used to achieve binary phase modulation, which has proven sufficient for various applications [31, 74]. However, by tilting the hologram, it is possible to obtain four different phase values for a given amplitude. Moreover, all the codes needed to implement these holograms can be found in the dedicated GitHub repository along with examples of use [64].

As a last note it must be mentioned that there are other methods that have been used to shape light using a DMDs. For example, it is possible to use their rapid switching to modulate the amplitude detected by a camera with a large integration time. However, this type of amplitude modulation produces incoherent light which might not be suitable for many applications. There have been, nonetheless, other proposals for the shaping of coherent lights. In [75, 76], it was suggested to add additional masks at the Fourier plane in order to tailor the number and distribution of complex numbers that can be encoded using a DMD. While this approach also opens the door to using DMDs as information processing systems, its implementation is experimentally more complicated and unnecessary for most cases. There are only two other options for writing binary holograms to shape coherent light and that use the optical system shown in figure 1. The first is based on using an iterative method to design a hologram that produces a target intensity or field distribution [77]. However, this method is more computationally expensive than the holograms presented here and with no guarantee that it will yield a better shaped field. Therefore, if the desired target field distribution is known it is best to use one of the holograms presented here. The second technique is based on using pixel dithering to convert the grayscale hologram of equation (5) into a binary one [78, 79]. In this case the phase is encoded in the position of the fringes of the grating and the amplitude is modulated by setting specific pixels to zero or one in order to mimic the grayscale variation of the original hologram. The resulting hologram is then quite similar to that obtained with the orthogonal Lee hologram but is computationally more expensive and harder to implement. In which case, one would be better off using the superpixel method.

## Data availability statement

The code used to generate all the holograms presented in this work and to simulate the shaping of complex fields is available in [64].

The data that support the findings of this study are openly available at the following URL/DOI: https://github.com/rodguti90/pyDMDholo.
Acknowledgments

S M P, and R G C acknowledge the French Agence Nationale pour la Recherche Grants No.

ANR-23-CE42-0010-01 MUFFIN and No. ANR-20-CE24-0016 MUPHTA and the Labex WIFI Grant Nos.

ANR-10-LABX-24, ANR-10-IDEX-0001-02 PSL*.

conflicts of interest

The authors declare no conflicts of interest.

ORCID iDs

R Gutiérrez-Cuevas https://orcid.org/0000-0002-3451-6684

S M Popoff https://orcid.org/0000-0002-7199-9814

References

[1] Piccardo M et al 2021 Roadmap on multimode light shaping J. Opt. 24 013001

[2] Andrews D L 2008 *Structured Light and its Applications: an Introduction to Phase-Structured Beams and Nanoscale Optical Forces* (Academic Press Inc)

[3] Rubinsztein-Dunlop H et al 2017 Roadmap on structured light J. Opt. 19 013001

[4] Taylor M A, Waleed M, Stilgoe A B, Rubinsztein-Dunlop H and Bowen W P 2015 Enhanced optical trapping via structured scattering Nat. Photon. 9 669

[5] Gigan S et al 2022 Roadmap on wavefront shaping and deep imaging in complex media J. Phys. Photon. 4 042501

[6] Hell S W and Wichmann J 1994 Breaking the diffraction resolution limit by stimulated emission: stimulated-emission-depletion fluorescence microscopy Opt. Lett. 19 780

[7] Backer A S and Moerner W E 2014 Extending single-molecule microscopy using optical fourier processing J. Phys. Chem. B 118 8313

[8] Jouchet P, Gabriel C, Bourg N, Bardou M, Poüs C, Fort E and Lévêque-Fort S 2021 Nanometric axial localization of single fluorescent molecules with modulated excitation Nat. Photon. 15 297

[9] Vicidomini G, Bianchini P and Diaspro A 2018 STED super-resolved microscopy Nat. Methods 15 173

[10] Ashkin A, Dziedzic J M, Bjorkholm J E and Chu S 1986 Observation of a single-beam gradient force optical trap for dielectric particles Opt. Lett. 11 288

[11] Neuman K C and Block S M 2004 Optical trapping Rev. Sci. Instrum. 75 2787

[12] Callegari A, Mijalkov M, Gököz A B and Volpe G 2015 Computational toolbox for optical tweezers in geometrical optics J. Opt. Soc. Am. B 32 B11

[13] Volpe G et al 2023 Roadmap for optical tweezers J. Phys. Photon. 5 022501

[14] Gutiérrez-Cuevas R, Moore N J and Alonso M A 2018 Lorenz-mie scattering of focused light via complex focus fields: an analytic treatment Phys. Rev. A 97 053848

[15] Mirhosseini M, Magaña-Loaiza O S, O'Sullivan M N, Rodenburg B, Malik M, Lavery M P J, Padgett M J, Gauthier D J and Boyd R W 2015 High-dimensional quantum cryptography with twisted light New J. Phys. 17 033033

[16] Malik M, Erhard M, Huber M, Krenn M, Fickler R and Zeilinger A 2016 Multi-photon entanglement in high dimensions Nat. Photon. 10 248

[17] Krenn M, Malik M, Erhard M and Zeilinger A 2017 Orbital angular momentum of photons and the entanglement of laguerre-gaussian modes Phil. Trans. R Soc. A 375 20150442

[18] Yao A M and Padgett M J 2011 Orbital angular momentum: origins, behavior and applications Adv. Opt. Photonics 3 161

[19] Dennis M R, O'Holleran K and Padgett M J 2009 Singular Optics: Optical Vortices and Polarization Singularities Progress in Optics vol 53 ed E Wolf ch 5, pp 293–363

[20] Rotter S and Gigan S 2017 Light fields in complex media: mesoscopic scattering meets wave control Rev. Mod. Phys. 89 015005

[21] Popoff S M, Lerosey G, Fink M, Boccara A C and Gigan S 2011 Controlling light through optical disordered media: transmission matrix approach New J. Phys. 13 123021

[22] Popoff S, Lerosey G, Fink M, Boccara A C and Gigan S 2010 Image transmission through an opaque material Nat. Commun. 1 81

[23] Popoff S M, Lerosey G, Carminati R, Fink M, Boccara A C and Gigan S 2010 Measuring the transmission matrix in optics: an approach to the study and control of light propagation in disordered media Phys. Rev. Lett. 104 100601

[24] Vellekoop I M and Mosk A P 2007 Focusing coherent light through opaque strongly scattering media Opt. Lett. 32 2309

[25] Ambichl P, Brandstötter A, Böhm J, Kühmayer M, Kuhl U and Rotter S 2017 Focusing inside disordered media with the generalized wigner-smith operator Phys. Rev. Lett. 119 033903

[26] Gigan S 2022 Imaging and computing with disorder Nat. Phys. 18 980

[27] Bouchet D, Rotter S and Mosk A P 2021 Maximum information states for coherent scattering measurements Nat. Phys. 17 564

[28] Gutiérrez-Cuevas R, Bouchet D, de Rosny J and Popoff S M 2024 Crashing with disorder: Reaching the precision limit with tensor-based wavefront shaping Nat. Commun. 15 6319

[29] Carpenter J, Eggleton B J and Schröder J 2015 Observation of eisenbud-wigner-smith states as principal modes in multimode fibre Nat. Photon. 9 751

[30] Ambichl P, Xiong W, Bromberg Y, Redding B, Cao H and Rotter S 2017 Super- and anti-principal-modes in multimode waveguides Phys. Rev. X 7 041053

[31] Matthès M W, Bromberg Y, de Rosny J and Popoff S M 2021 Learning and avoiding disorder in multimode fibers Phys. Rev. X 11 021060

[32] Dennis M R, King R P, Jack B, O'Holleran K and Padgett M J 2010 Isolated optical vortex knots Nat. Phys. 6 118

[33] Pisanty E, Machado G J, Vicuña-Hernández V, Picón A, Celi A, Torres J P and Lewenstein M 2019 Knotting fractional-order knots with the polarization state of light Nat. Photon. 13 569
[34] Larocque H, Sugic D, Mortimer D, Taylor A J, Fickler R, Boyd R W, Dennis M R and Karimi E 2018 Reconstructing the topology of optical polarization knots *Nat. Phys.* **14** 1079

[35] Freund I 2005 Cones, spirals and möbius strips, in elliptically polarized light *Opt. Commun.* **249 7

[36] Bauer T, Banzer P, Karimi E, Orlov S, Rubano A, Marrucci L, Santamato E, Boyd R W and Leuchs G 2015 Observation of optical polarization möbius strips *Science* **347** 964

[37] Bliokh K Y, Alonso M A and Dennis M R 2019 Geometric phases in 2D and 3D polarized fields: geometrical, dynamical and topological aspects *Rep. Prog. Phys.* **82** 122401

[38] Du L, Yang A, Zayats A V and Yuan X 2019 Deep-subwavelength features of photonic skyrmions in a confined electromagnetic field with orbital angular momentum *Nat. Phys.* **15** 650–4

[39] Tsesse S, Ostrovsky E, Cohen K, Gjonaj B, Lindner N H and Bartal G 2018 Optical skyrmion lattice in evanescent electromagnetic fields *Science* **361** 993

[40] Gutiérrez-Cuevas R and Pisanty E 2021 Optical polarization skyrmionic fields in free space *J. Opt.* **23** 024004

[41] Gabor D 1948 A new microscopic principle *Nature* **161** 777

[42] Gabor D 1949 Microscopy by reconstructed wave-fronts *Proc. R. Soc. A* **197** 454

[43] Leith E N and Upatnieks J 1962 Reconstructed wavefronts and communication theory *J. Opt. Soc. Am.* **52** 1123

[44] Brown B R and Lohmann A W 1966 Complex spatial filtering with binary masks *Appl. Opt.* **5** 967

[45] Fienup J R and Goodman J W 1974 New ways to make computer-generated color holograms *Nouv. Rev. Opt.* **5** 269

[46] Haskell R E 1973 Computer-generated binary holograms with minimum quantization errors *J. Opt. Soc.* **63** 504A

[47] Lee W-H 1979 Binary computer-generated holograms *Appl. Opt.* **18** 3661

[48] Lee W-H 1974 Binary synthetic holograms *Appl. Opt.* **13** 1677

[49] Burch J 1967 A computer algorithm for the synthesis of spatial frequency filters *Proc. IEEE* **55** 599

[50] Lee W-H 1978 III computer-generated holograms: techniques and applications *Progress in Optics* vol ed E Wolf pp 119–232

[51] Konforti N, Marom E and Wu S-T 1988 Phase-only modulation with twisted nematic liquid-crystal spatial light modulators *Opt. Lett.* **13** 251

[52] Barnes T H, Eiju T, Matusda K and Ooyama N 1989 Phase-only modulation using a twisted nematic liquid crystal television *Appl. Opt.* **28** 4845

[53] Arrizón V, Ruiz U, Carrada R and González L A 2007 Pixelated phase computer holograms for the accurate encoding of scalar complex fields *J. Opt. Soc. Am. A* **24** 3500

[54] Rosales-Guzmán C and Forbes A 2017 *How to Shape Light with Spatial Light Modulators* (SPIE Press)

[55] Hornbeck L J 1997 Digital light processing for high-brightness high-resolution applications *Proc. SPIE* **3013

[56] Dudley D, Duncan W M and Slaughter J 2003 Emerging digital micromirror device (DMD) applications *Proc. SPIE* 4985

[57] Scholes S, Kara R, Pinnell J, Rodríguez-Fajardo V and Forbes A 2019 Structured light with digital micromirror devices: a guide to best practice *Opt. Eng.* **59** 1

[58] Ren Y-X, Lu R-D and Gong L 2015 Tailoring light with a digital micromirror device *Ann. Phys.* **527** 447

[59] Akbulut D, Huisman T J, van Putten E G, Vos W L and Mosk A P 2011 Focusing light through random photonic media by binary amplitude modulation *Opt. Express* **19** 4017

[60] Conkey D B, Caravaca-Aguirre A M and Piestun R 2012 High-speed scattering medium characterization with application to focusing light through turbid media *Opt. Express* **20** 1733

[61] Semmer F, Emperauger M-C, Lopez C, Bogicevic C, Treussart F, Perronet K and Marquier F 2023 3d real-time two-photon microscopy device for single-particle holographic tracking (3D-red shot) *ACS Photonics* **10** 3426

[62] Park M-C, Lee B-R, Son J-Y and Chernyshov O 2015 Properties of DMDs for holographic displays *J. Mod. Opt.* **62** 1600

[63] Popoff S M, Gutiérrez-Cuevas R, Bromberg Y and Matthés M W 2024 A practical guide to digital micro-mirror devices (dmds) for wavefront shaping *J. Phys. Photonics* **6** 043001

[64] Gutiérrez-Cuevas R 2023 *pyDMDholo* (available at: https://github.com/rodguti90/pyDMDholo)

[65] Ashcroft N W and Mermin N D 2022 *Solid State Physics* (Cengage Learning)

[66] Goodman J W 2005 *Introduction to Fourier Optics* (W.H. Freeman & Co Ltd)

[67] Lee W H 1970 Sampled fourier transform hologram generated by computer *Appl. Opt.* **9** 639

[68] Siegman A E 1986 *Lasers* (University Science Books)

[69] Gutiérrez-Cuevas R, Dennis M R and Alonso M A 2019 Generalized Gaussian beams in terms of Jones vectors *J. Opt.* **21** 084001

[70] Gutiérrez-Cuevas R, Wadood S, Vamivakas A and Alonso M 2020 Modal majorana sphere and hidden symmetries of structured-gaussian beams *Phys. Rev. Lett.* **125** 123903

[71] Bryngdahl O and Lohmann A W 1968 Interferograms are image holograms *J. Opt. Soc. Am.* **58** 141

[72] Goorden S A, Bertolotti J and Mosk A P 2014 Superpixel-based spatial amplitude and phase modulation using a digital micromirror device *Opt. Express* **22** 17999

[73] van Putten E G, Vellekoop I M and Mosk A P 2008 Spatial amplitude and phase modulation using commercial twisted nematic LCDs *Appl. Opt.* **47** 2076

[74] Vellekoop I M, Cui M and Yang C 2012 Digital optical phase conjugation of fluorescence in turbid tissue *Appl. Phys. Lett.* **101** 081108

[75] Ulusoy E, Onural L and Ozaktas H M 2011 Full-complex amplitude modulation with binary spatial light modulators *J. Opt. Soc. Am.* **A** **28** 2310

[76] Zlokazov E 2020 Methods and algorithms for computer synthesis of holographic elements to obtain a complex impulse response of optical information processing systems based on modern spatial light modulators *Quantum Electron.* **50** 643

[77] Lenton I C D, Stilgoe A B, Nieminen T A and Rubinsztein-Dunlop H 2020 OTSLM toolbox for structured light methods *Comput. Phys. Commun.* **253** 107199

[78] Lerner V, Shwa D, Drori Y and Katz N 2012 Shaping laguerre–gaussian laser modes with binary gratings using a digital micromirror device *Opt. Lett.* **37** 4826

[79] Cheremkhin P A and Kurbatova E A 2019 Comparative appraisal of global and local thresholding methods for binarisation of off-axis digital holograms *Opt. Laser. Eng.* **115** 119