rectangular_symmetric(V, tol=1e-11)[source]

Decomposition of a unitary into an array of symmetric beamsplitters.

This decomposition starts with the output from rectangular_MZ() and performs the equivalent of rectangular_phase_end() by placing all the local phase shifts after the interferometers.

If the Mach-Zehnder unitaries are represented as M and the local phase shifts as D, the new parameters to shift the local phases to the end are calculated such that

\[M^{-1} D = D_{\mathrm{new}} M_{\mathrm{new}}\]
  • V (array) – unitary matrix of size n_size

  • tol (int) – the number of decimal places to use when determining whether the matrix is unitary


returns a tuple of the form (tlist,np.diag(localV), None)


  • tlist: list containing [n, m, internal_phase, external_phase, n_size] of the T unitaries needed

  • localV: Diagonal unitary matrix to be applied at the end of circuit

  • None: the value None, in order to make the return signature identical to rectangular()

Return type