The exact meaning of Heisenberg Representation

Hello.
I need some help, I cannot understand the exact meaning of Heisenberg Representation M matrix. How does the Operation (Rotation) go from the second quantized form (above the “detail”) to the M-matrix, which is actually 3 by 3 matrix. Why it is not the 2*2 matrix?
To my knowledge, the MZI’s matrix takes the form like this(I will attach another picture in my following reply due to the limitation to the new users about number of posting pictures), which means there should be some complex number, but in the function qml.templates.Interferometer(this function is used for Optimizing a quantum optical neural network,https://pennylane.ai/qml/demos/qonn.html) it consists of real numbers.

Thanks.

To my knowledge, the phase shifter and Rotation should have the same matrix like this (22 matrix), instead of a 33 one.

Also, the matrix of MZI should take the form like this picture, which means it should contain some complex numbers.

Hi @Hamitonian — Welcome to the Forum. I think there are are a number of possible confusions in your statements.
Your U_{MZI} refers to the Heisenberg action of a two-mode gate on the destruction operators of two modes. Thus this beamsplitter maps the destruction operators of the two modes according to
\begin{pmatrix} a \\ b \end{pmatrix} \to \begin{pmatrix} a' \\ b' \end{pmatrix} = U_{MZI} \begin{pmatrix} a \\ b \end{pmatrix}.

The documentation of pennylane writes Heisenberg transformations for the quadrature operators and also adds the identity operator.
For a rotation of a single mode one has that the quadratures of a single mode transform under a rotation according to
\begin{pmatrix} I \\ x \\ p \end{pmatrix} \to \begin{pmatrix} I \\ x' \\ p' \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ 0 & \cos \theta & \sin \theta \\ 0 & -\sin \theta & \cos \theta \end{pmatrix} \begin{pmatrix} I \\ x \\ p \end{pmatrix}.

Note that in this case the matrix is block diagonal, i.e., the identity does not get mixed with the quadratures. The reason why we include the identity in the transformation is so that we can also deal with displacements (akin to using an Augmented matrix when dealing with affine transformations ) for which one has
\begin{pmatrix} I \\ x \\ p \end{pmatrix} \to \begin{pmatrix} I \\ x' \\ p' \end{pmatrix} = \begin{pmatrix} 1 & 0 & 0 \\ \Re(\alpha) & 1 & 0 \\ \Im(\alpha) & 0 & 1 \end{pmatrix} \begin{pmatrix} I \\ x \\ p \end{pmatrix}.

Hope this helps.

Nicolas