sf.decompositions.rectangular_symmetric¶

rectangular_symmetric
(V, tol=1e11)[source]¶ Decomposition of a unitary into an array of symmetric beamsplitters.
This decomposition starts with the output from
rectangular_phase_end()
and further decomposes each of the T unitaries into MachZehnder interferometers consisting of two phaseshifters and two symmetric (50:50) beamsplitters.The two beamsplitters in this decomposition of T are modeled by
BSgate
with arguments \((\pi/4, \pi/2)\), and the two phaseshifters (seeRgate
) act on the input mode with the lower index of the two. The phase imposed by the first phaseshifter (before the first beamsplitter) is namedexternal_phase
, while we call the phase shift between the beamsplittersinternal_phase
.The algorithm applied in this function makes use of the following identity:
Rgate(alpha)  1 Rgate(beta)  2 Rgate(phi)  1 BSgate(theta, 0)  1, 2 equals Rgate(phi+alphabeta)  1 BSgate(pi/4, pi/2)  1, 2 Rgate(2*theta+pi)  1, 2 BSgate(pi/4, pi/2)  1, 2 Rgate(betatheta+pi)  1 Rgate(betatheta)  2
The phaseshifts by
alpha
andbeta
are thus pushed consecutively through all the T unitaries of the interferometer and these unitaries are converted into pairs of symmetric beamsplitters with two phase shifts. The phase shifts at the end of the interferometer are added to the ones from the diagonal unitary at the end of the interferometer obtained fromrectangular_phase_end()
. Parameters
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
 returns a tuple of the form
(tlist,np.diag(localV), None)
where:
tlist
: list containing[n, m, internal_phase, external_phase, n_size]
of the T unitaries neededlocalV
: Diagonal unitary matrix to be applied at the end of circuitNone
: the valueNone
, in order to make the return signature identical torectangular()
 returns a tuple of the form
 Return type
tuple[array]
Downloads