### LabView Code for Generating Arbitrary Optical Beams

*m*,

*n*and relative phase between superpositions. The weight allows you to do weighted superposition of different modes. Since the laser does not always fall on the exact middle of the SLM there are two different ways to move the hologram of the SLM, you can either change the x and y centre of the SLM (3rd panel to the right on the top row) you can also move the top left of the hologram (4th panel to the right on the top row). The

*x*and

*y*angle control the angle of the blazing function and they can be changed for optimizing the output of the SLM. The masking that comes with the program is by Karimi et al [1,2] which provides an exact solution for intensity and phase encryption for an SLM. Because some SLM‘s come with calibration files, this program allows the user to upload these files to create a more accurate hologram. Not all SLMs operate optimally at a greyscale of 255, so an option to scale the greyscale is provided. Also provided in the program are visual representations of the field intensity and phase in addition to the pattern on the hologram. The package is available for download in a .llb file. To use it all one must do is click on the link and open the library.

##### Related publication

- Test of mutually unbiased bases for six-dimensional photonic quantum systems,
*Scientific Reports***3**, 2726 (2013). - Exact solution to simultaneous intensity and phase encryption with a single phase-only hologram,
*Optics Letters***38**, 3546 (2013).

### Quantum Optics Mathematica Package

This package is built to manipulate the spin angular momentum (SAM) and orbital angular momentum (OAM) of light with optical components such as: Wave-Plates (WP), Beam Splitter (BS), Polarizing Beam Splitter (PBS), Q-Plate (QP), Pitch-Fork Hologram (HOLO), Mirror (M), Optical Fiber (OF), Dove Prism (DP), and Mach-Zehnder Interferometer (MZ). The photon state in our package has been considered as a Ket p[s,m], where p is the photon linear momentum and can take two values of u and d associated to the beam which is going up and down. s is the photon polarization state and can take any superposition of the six values of {H,V,L,R,A,D} correspond to Horizontal, Vertical, Left-circular, Right-circular, Anti-diagonal and Diagonal polarization states, respectively.

Finally m = {…,-2, -1, 0, 1, 2, …} is the orbital angular momentum of the photon.

The beta-version of the Quantum Optics Mathematica package is available for download via this page.

In order to install the package follow the below steps:

- Download the beta-version of the package.
- Unzip it.
- Put the unzip folder inside the Applications folder of your $UserBaseDirectory, i.e. $UserBaseDirectory/Applications of your PC. You must then run Mathematica and type $UserBaseDirectory, then press Shift+Enter.
- Close Mathematica program.
- Lunch Mathematica again, and go to palette on the sidebar and look for the Quantum Optics Palette (see the image).
- In order to load the package just run the first bottom, i.e. Needs[“QuantumOptics`Photon”].
- Enjoy!

Here find useful examples of the package elements.

This package has been created by Prof. Ebrahim Karimi and Prof. Enrico Santamato. Using and publishing this package for non-commercial purposes is free. However, users should address the package in case of scientific researches.