# qml.templates.subroutines.Interferometer¶

Interferometer(theta, phi, varphi, wires, mesh='rectangular', beamsplitter='pennylane')[source]

General linear interferometer, an array of beamsplitters and phase shifters.

For $$M$$ wires, the general interferometer is specified by providing $$M(M-1)/2$$ transmittivity angles $$\theta$$ and the same number of phase angles $$\phi$$, as well as $$M-1$$ additional rotation parameters $$\varphi$$.

By specifying the keyword argument mesh, the scheme used to implement the interferometer may be adjusted:

• mesh='rectangular' (default): uses the scheme described in Clements et al., resulting in a rectangular array of $$M(M-1)/2$$ beamsplitters arranged in $$M$$ slices and ordered from left to right and top to bottom in each slice. The first beamsplitter acts on wires $$0$$ and $$1$$:

• mesh='triangular': uses the scheme described in Reck et al., resulting in a triangular array of $$M(M-1)/2$$ beamsplitters arranged in $$2M-3$$ slices and ordered from left to right and top to bottom. The first and fourth beamsplitters act on wires $$M-1$$ and $$M$$, the second on $$M-2$$ and $$M-1$$, and the third on $$M-3$$ and $$M-2$$, and so on.

In both schemes, the network of Beamsplitter operations is followed by $$M$$ local Rotation Operations.

The rectangular decomposition is generally advantageous, as it has a lower circuit depth ($$M$$ vs $$2M-3$$) and optical depth than the triangular decomposition, resulting in reduced optical loss.

This is an example of a 4-mode interferometer with beamsplitters $$B$$ and rotations $$R$$, using mesh='rectangular':

Note

The decomposition as formulated in Clements et al. uses a different convention for a beamsplitter $$T(\theta, \phi)$$ than PennyLane, namely:

$T(\theta, \phi) = BS(\theta, 0) R(\phi)$

For the universality of the decomposition, the used convention is irrelevant, but for a given set of angles the resulting interferometers will be different.

If an interferometer consistent with the convention from Clements et al. is needed, the optional keyword argument beamsplitter='clements' can be specified. This will result in each Beamsplitter being preceded by a Rotation and thus increase the number of elementary operations in the circuit.

Parameters
• theta (tensor_like) – size $$(M(M-1)/2,)$$ tensor of transmittivity angles $$\theta$$

• phi (tensor_like) – size $$(M(M-1)/2,)$$ tensor of phase angles $$\phi$$

• varphi (tensor_like) – size $$(M,)$$ tensor of rotation angles $$\varphi$$

• wires (Iterable or Wires) – Wires that the template acts on. Accepts an iterable of numbers or strings, or a Wires object.

• mesh (string) – the type of mesh to use

• beamsplitter (str) – if clements, the beamsplitter convention from Clements et al. 2016 (https://dx.doi.org/10.1364/OPTICA.3.001460) is used; if pennylane, the beamsplitter is implemented via PennyLane’s Beamsplitter operation.

Raises

ValueError – if inputs do not have the correct format