Correlated optical convolutional neural network with “quantum speedup”

Compared with electrical neural networks, optical neural networks (ONNs) have the potentials to break the limit of the bandwidth and reduce the consumption of energy, and therefore draw much attention in recent years. By far, several types of ONNs have been implemented. However, the current ONNs cannot realize the acceleration as powerful as that indicated by the models like quantum neural networks. How to construct and realize an ONN with the quantum speedup is a huge challenge. Here, we propose theoretically and demonstrate experimentally a new type of optical convolutional neural network by introducing the optical correlation. It is called the correlated optical convolutional neural network (COCNN). We show that the COCNN can exhibit “quantum speedup” in the training process. The character is verified from the two aspects. One is the direct illustration of the faster convergence by comparing the loss function curves of the COCNN with that of the traditional convolutional neural network (CNN). Such a result is compatible with the training performance of the recently proposed quantum convolutional neural network (QCNN). The other is the demonstration of the COCNN’s capability to perform the QCNN phase recognition circuit, validating the connection between the COCNN and the QCNN. Furthermore, we take the COCNN analog to the 3-qubit QCNN phase recognition circuit as an example and perform an experiment to show the soundness and the feasibility of it. The results perfectly match the theoretical calculations. Our proposal opens up a new avenue for realizing the ONNs with the quantum speedup, which will benefit the information processing in the era of big data.


Introduction
Artificial neural networks are the computational models composed of interconnected nodes, and can 'learn' to deal with complicated tasks such as image feature recognition, language translation, medical diagnosis, etc., through 'training' the parameters [1][2][3][4] .The optical neural networks (ONNs) can perform the function of the artificial neural networks by using optical elements.They have drawn much attentions in recent years because of the potential to go beyond their electrical counterparts.The advantages of the ONNs include the low crosstalk, neglectable time-delay in propagation, low heat generation, etc. 5,6 .Especially, they are expected to break the bandwidth limits of the electrical neural networks, achieving ultrahigh computing frequency enabled by THz-wide telecommunications band 7 .Also, the ONNs can get rid of the troubles caused by the Von Neumann bottleneck, avoiding the restrictions rooted in the energy and time consumption when reading and transmitting data from the memories 8 .With these benefits, the ONNs are proven to perform the image processing [9][10][11][12][13][14][15][16] , hand-written digits recognition [17][18][19][20][21] , and many other tasks [22][23][24][25][26] .The related techniques are also found to be applicable for logic 27 or matrix [28][29][30] operations.However, all the ONNs at present cannot exhibit a speedup as powerful as that indicated by the models such as quantum neural networks [31][32][33][34][35][36][37][38][39] , because they are implemented in a straightforward manner that closely follows the traditional neural networks without incorporating an algorithmic advances.With the proliferation of the data generated by the daily communication, the traditional neural networks must contain millions of parameters in order to capture the feature of the data, so that the training of them for practical use is becoming more and more consumptive.Hence, the same obstacle will also occur in the current development direction of the ONNs.So, how to build a new ONN which could provide an algorithmic speed up is highly demanded by the social needs and generally challenging.
On the other hand, the recent experimental progress towards the realization of quantum information processors has led to the emerged research field of quantum neural networks 31 .Excitingly, the advance of the quantum machine learning would fulfill the needs for data processing with an algorithmic speed up.By far, several quantum machine learning algorithms are proposed, including the quantum generative network 34 , quantum Boltzmann machine 35 , quantum transfer learning 38 , etc. Very recently, the quantum convolutional neural network (QCNN) is theoretically constructed 37 .Such a network has displayed its unique property for identifying the symmetry of quantum states.More importantly, it has been numerically shown that the convergence of a QCNN model is faster than the traditional convolutional neural network (CNN) model in the task of classifying the classical data 39 , which would greatly contribute to the application in daily life.
However, the realization of the QCNN requires large amount of the 2-qubit gates and the sufficient long coherence time of the multi-qubit system, which is technically hard for the current quantum devices.So, the demonstration of the advantageous quantum machine learning models like QCNN on the quantum platforms has not been given.
Inspired by the theoretical model of the QCNN, in this work, we introduce the optical correlation to the design of ONNs and propose the correlated optical convolutional neural networks (COCNNs).Such a new type of ONNs exhibits the ability to achieve the "quantum speed up" as effective as that shown by the QCNN.Such a speed up is verified from two aspects.For the first, the lost function of the COCNN has shown a faster convergence behavior in the classification tasks we consider when compared to that of the traditional CNN model.The results coincides with behavior of the QCNN 39 .For the second, the COCNN can realize the function of the QCNN, such as the recognition of the Haldane phase.This further validates the close relation between the COCNN and the QCNN.Last but not least, we take the 3-qubit phase recognition circuit as an example and perform an experimental realization of its function using the framework of the COCNN.The results fit well with the theoretical calculation.It means that our proposal reveals a new way of realizing the ONNs with the "quantum speedup", which will benefit the information processing in the coming years.

The structure of a COCNN and its performances
The sketch of a general COCNN is shown in Fig. 1.It is composed of four basic parts: the correlated light source, the convolution, the pooling, and the detections.As the most basic component, we firstly introduce the part of the correlated light source.This setup is used for encoding the information.Different from the previous ONNs 9, 13,15 which only employ the amplitude of the light for the encoding, we employ the correlation of the multi-mode polarized beams to encode data.In fact, using such a special type of classical beams, one can obtain the classical analogy of the quantum correlations between qubits.For example, a polarized beam field  =  + , with  () being the horizontal (vertical) polarization vector, is analog to the qubit state |0⟩ + |1⟩ under the mapping  → |0⟩ and  → |1⟩.Here,  and  represent the complex coefficients of the polarization basis.
In what follows, we use the notation | ) to denote the classical states analog to the qubit states, e.g., |) = |) + |).More generally, by employing  multi-mode polarized beams, one can obtain a classical state which is the analogy of a general N-qubit quantum state   Secondly, we introduce the part of the convolution, as shown by the layers of the connected blue squares in Fig. 1.This is an essential part for processing the encoded data in our proposal.Traditionally, the convolution of the data is mathematically expressed by the linear transformation of a vector, which is the main function of the convolution blocks in the previous ONNs 5,9,18 .Here, the part of the convolution is also the linear transformation, but applied to the correlation rather than the amplitude of the beams of light.This leads to a completely different way of design for implementing the transformation.Following Eq. ( 1), the convolution can be described by a unitary operation   on |).Here, we restrict that   is composed of general 2-beam operations  2 , as shown by the blue squares in Fig. OMU is equivalent to the quantum CZ gate.The reason why the setup of the Q-H-Qs and the OMUs in Fig. 1 implements an arbitrary rotation of |2) can be explained in refereeing to the quantum computing theory.In the theory of quantum computing, a universal 2-qubit gate can be decomposed into three CNOT gates and eight single qubit rotations 40 , and a CNOT gate can be synthesized by a CZ gate and two Hadamard gates 41 .Therefore, the decomposition of  2 into Q-H-Qs and OMUs can be correspondingly given.According to the definition of a  2 , it can be parameterized by 15 real numbers, which is the same with the parameter number of a 2-qubit gate.
So, as shown by Fig. 1, one layer of  2 acting on the adjacent beams of an -beam array may have 15 × ( − 1) trainable parameters in total.This is larger than the convolution kernel applied in the standard convolutional neural networks (CNNs) framework 42 , or other equivalent ONN schemes 5,9,18 , which has at most  parameters for an -dimensional input.
Thirdly, we introduce the part of the pooling, as shown by the layers of the brown squares in Fig. 1 with two inputs and one output.This is the key step for reducing the size of the data.Particularly, each brown square is called a combiner whose basic function is to generate simpler correlated states by decreasing the beam number.
The function of the combiner is strictly given by where (2| (( 1 |, ( 1 |) is the Hermitian conjugate of |2) (( 1 |, ( 1 |).The form |2)(2| is analog to the density matrix of a quantum state, and we also call it the density matrix of the beam state |2). is the identity operation on a single beam state.Notice that Eq. ( 2) is analog to the partial trace in quantum 2-partite system, which physically means looking into the single particle subspace of the system.Therefore, via the combiner defined by Eq. ( 2), the correlated state of the two beams is embedded into the state of one beam, losing part of the original information.Hence, if the combiner is applied for  times, an array of  beams is reduced to an array of  −  beams.The recipe of implementing Eq. ( 2) is shown in the brown dashed box in Fig. 1.At first, the upper beam is fed into a birefringence crystal (BC).The thickness of the BC is demanded to break the coherence of the horizontal and vertical polarization components.Then, the beam passes through an element set of HWP-PBS-HWP.Such an element set is equivalent to a polarizer, which can change an arbitrary state  +  to ( + )( + )/2.Then, the beam is modulated onto the lower beam through a nonlinear crystal unit (NLU).
The basic function of an NLU is to generate [( + )/2] + [( + )/2] with the input ( + )( + )/2 and another beam  + , where  and  are also complex coefficients of the polarization basis.The function of an NLU means that the  (or ) component of one mode in the output beam is the product of the  (or ) components of the corresponding modes of the input beams.This is generally the second-order nonlinear crystal in nature.A detailed analysis is given in the S2 of the Supplementary Information.Notice that by using one layer of the combiner, the information of the data encoded in the -beam correlation is suppressed into those of  −  beams.It indicates that the dimension of the state space shrinks from 2  to 2 − , which is more efficient than the layer for average pooling or max pooling in the traditional CNNs, or other ONN models involving equivalent structures 9 .
Fourthly, we introduce the part the of the detection.The basic aim of the detection is to measure the correlation defined by ∫( 1 ⋅  1 )( 2 ⋅  2 ) … (  ⋅   ) .In our proposal, we consider a two-step procedure to achieve so.In the first step, each beam interferes with a local oscillator (LO) signal by using a homodyne interferometer, so that the projection of the th beam   ⋅   can be obtained by the intensity difference of the outputs of the interferometer.The polarization of LO signal for measuring the th beam   is set to be at the projection direction   .The LO signal is coherent with all modes of   , and can be generated by splitting the beam of   , as shown by the rightmost part of Fig. 1.In the second step, all the projections   ⋅   ( = 1, … , ) measured by the homodyne detections are multiplied together by a processor.Then, the obtained result is proportional to the correlation defined by the above integral.In fact, the detection setup here is identical to the one employed in Ref. (40).The underlying background of the setup is also the correspondence between the beam states defined by Eq. ( 1) and the qubit states, which is given in the first section of the Materials and methods as mentioned above.
The training of a COCNN is similar to other machine learning algorithms.By properly setting the loss function, one can assess the performance of the COCNN on a given dataset and update the parameters according to it.Here, we also employ the mean square error (MSE) as the loss function.If the target output of the ith data sample is denoted by   , and the corresponding output of the COCNN is denoted by   ′ , the MSE can be given by where  is the total number of the samples.the numerical results in Ref. (39).Therefore, the speed-up we find here is as effective as that of a QCNN.
The second one is about performing the specific function of a QCNN.As pointed out by Ref. (37), one function of a QCNN is to identify the phase of a many-body quantum system.We consider the QCNN circuit for recognizing the Haldane phase.As mentioned above, a correlated projection of a quantum state can be mapped to the correlation of the beams.So, the ground state of the Haldane Hamiltonian, can also be encoded by the correlated beams we consider.  and   in Eq. ( 4) are the Pauli-X and Pauli-Z operator on the ith particle.Integer  is the total number of the particles, and , ℎ 1 and ℎ 2 are the coefficients of the Hamiltonian 43 .In Ref. (37), a strict QCNN is presented to justify the phase of the ground states under different , ℎ 1 and ℎ 2 .Because the convolution and pooling of our scheme have a good correspondence with the quantum counterparts in QCNN, our COCNN can also implement the phase recognition algorithm based on the QCNN.An instruction about the detailed setup is given in the second section of the Materials and methods.We numerically simulate the situation when  = 12 and the results are shown in Fig. 2(c).The phases identified with the ground state energy density is marked by the color of the background as the reference.The red triangles in Fig. 2(c) denotes the phase boundary information obtained by the second order derivative of the simulated results of the COCNN for phase recognition.Corresponding to the QCNN scheme, the results of the COCNN are the projections of the output beam states on the Pauli-X basis of the polarization.Notably, due to the layers of pooling, the correlation of the output is involved by fewer beams than the input ones encoding the ground state.
Hence, such an output contains the information for identifying the phase and is much easier to measure, just like the characters shown by the QCNN.In the particular case here, the phase of the state encoded by the correlation of the 12 beams is eventually recognized by measuring the correlation of the 3 output beams.It also worth noticing that the results in Fig. 2(c) is comparable with the numerical illustration in Ref. (37), validating the correspondence between the COCNN and the QCNN.Therefore, our scheme is capable of carrying out data processing similar to that of a quantum network.We also provide a detailed analysis of the connections between COCNNs and QCNNs in S3 of the Supplementary Information.

The experimental realization of a COCNN
In this part, we explore the experimental demonstration of the above scheme.Taking the COCNN analog to the 3-qubit phase recognition QCNN as an example, we show our experimental setup in Fig. 3.The setup also performs the functions explained in Fig. 1, including the part of the correlated light source, convolution, pooling, and measurements.The part of correlated light source in the experimental setup is implemented by adopting the spatial modes as the   of the beam state.The spatial modes are generated by one 632.8nmHe-Ne laser (ThrolabsHNL210LB).The light output by the laser is polarized by a beam displacer (BD) and then split into four spatial modes by three beam splitters (BS, ThorlabsBS016).For each mode, the polarization state is adjusted by a Q-H-Q.The filters thereafter are used for balancing the intensity of different modes.This is a simplified version of the strategy for generating the correlated light source in the above discussions.The simplification is based on the intrinsic relation between the beam state defined by Eq. ( 1) and the corresponding qubit states.As mentioned above, the intrinsic relation is strictly characterized by the Eqs.(S6) in S1 of the Supplementary Information, indicating that there could be more than one setup for the beams in order to mimic a given quantum state.Therefore, it can be explored to identify the most experiment-friendly beam setup among the alternatives.
In our case, we choose to settle down the polarization components of the two beams of the set, and implement the required operation effectively by manipulating the states of the rest beam.Hence, the analogy of the quantum circuit can be realized by only one beam involving four spatial modes, as shown by the left of Fig. 3.This largely reduces the requirements on the experiments.A strict explanation of the simplification is presented in the third section of the Materials and methods.
Next, the modes are fed into the part of convolution, corresponding to the blue layers in  The optical elements used in the experiment is listed below.The related elements for performing an operation are marked by the area of a certain color.
After the part of convolution, the spatial modes go into the region for pooling and measurements, corresponding to the brown layers and the detections in Fig. 1.Because of the simplification we consider, the pooling operation in the experiment is realized by measuring the sum of the intensity difference of all the modes (see S4 of the Supplementary Information for details).Hence, it is merged into the measurements as shown in To benchmark the performance, we firstly check the output of the above optical setup when the inputs are the analogies of several special quantum states.Particularly, we consider the ten states of the beams, including  Next, we present the phase recognition results.The input states here are set to be the analogies of the ground states of the 3-site Haldane Hamiltonian.The basic strategy to encode the ground states into the beams is given in S6 of the Supplementary Information.The ground states are calculated by the diagonalization.Here, ℎ 1 / is set to be 0.4, 0.8, 1.2 and 1.6, and ℎ 2 / is taken from -2.0 to 2.0 with an interval of 0.25.According to the numerical simulation of the COCNN scheme, we measure Tr{|  )(  |} in this case, which is equivalent to the measurement of the QCNN phase recognition circuit due to the basis transformation enabled by the four HWPs in the red region.The results are marked by the red dots in the left panel of Fig. 5, and the data for obtaining the results is provided in S6 of the Supplementary Materials.For comparison, we plot the standard phase recognition results obtained by string-order parameters (SOP) 37 , shown by the light blue curves in left panel of Fig. 5.In the 3-site case, the SOP is given by ⟨⟩.From the left panel, we can see that the experimental data fits well with the SOP results, validating the effectiveness of the setup.
Besides, the phase boundaries can also be obtained by the second order derivative of the experimental data, shown by the dark blue curves in Fig. 5. Compared with the numerical simulation in Fig. 2(c), it can be found that the dark blue curves match the boundaries obtained by the numerical results.A direct illustration is shown by the right panel of Fig. 5.It worth noticing that the original SOP is a quantity that requires to measure the three-particle correlations.Using the COCNN here, it is effectively reduced to measuring the character of a single particle.This phenomenon in the COCNN experiment reveals the benefit of applying the QCNN for recognizing Haldane phase proposed by Ref. (37).
Additionally, it can be found that the 3-qubit phase recognition QCNN functions as the fundamental building block of the -qubit phase recognition QCNN due to the repeated structure of the network (as shown in Fig. S5 of the Supplementary Information).This implies that the experimental setup of the COCNN, which performs the same operation as the 3-qubit phase recognition QCNN, can also be viewed as the fundamental building block of the phase recognition COCNN that utilizes -beam states.Moreover, for implementing other complicated tasks, the parameters of our general COCNN explained in the second section will be trained on the specific datasets of the tasks.The setups for those tasks can also be given by using the similar arrangements as in Fig. 3, according to our general proposal and the first section of the Materials and methods.Meanwhile, the simplification strategy applied here can also be extended to those tasks involving  beams.Thus, in principle, the -beam COCNNs for the task or others are also implementable.

Discussion
In summary, we have proposed to introduce the correlation of the light fields for establishing a new ONN framework, which is called as the COCNN.Different from the previous ONN, which only adopts the superposition property of light, the COCNN can exhibit similar characters of the quantum neural networks.We numerically show that for the classification tasks we consider, the loss function of a COCNN converges faster than that of a CNN.Moreover, we have also shown the COCNN can be applied to implement the function of the QCNNs, such as the one for the recognition of the Haldane phase.Considering the fact that the COCNN we propose has a one-to-one correspondence with the quantum circuit, the speed-up here could be as effective as the speed-up of a QCNN.Taking the COCNN analog to the 3-qubit phase recognition QCNN as an example, we have explored the experimental demonstration of the COCNN.The function of the setup has been firstly checked by setting the input to be the analogy of ten quantum states, and secondly set to perform the phase recognition for the ground states of the 3-site Haldane Hamiltonian.All the experimental results are in good agreement with the theoretical results of the QCNN, indicating that the function of the QCNN can be realized by using our COCNN scheme in principle.
As mentioned above, the main character of the COCNN strategy is the modulation of the correlated beam states.It is the major cause of the acceleration in the training process.On the basis of the modulation, a convolutional operation can be given, enabling a quite effective capture of the data feature.More importantly, the pooling operation in this manner can reduce the size of the processed data faster than the traditional pooling of the CNN.The two operations of the COCNN are equivalent to those applied in the QCNN.Hence, we think that such a scheme potentially advances the boundaries of optical acceleration.Meanwhile, the results also indicate that the COCNN allows for the realization of the properties of quantum neural network in a more affordable way.Despite the potential advantages of quantum neural networks, implementing them practically requires deep quantum circuits with many multi-qubit gates and complicated measurements.This necessitates significant resources to stabilize the circuits and correct errors, which is technically challenging due to the unavoidable environmental disturbances.A potentially better alternative to implementing advantageous algorithms suggested by quantum computing theory is to find a system described by the same math as quantum theory and interrupted less by the environment.The proposed COCNN serves as an example of such a system, as evidenced by the ease of element arrangements and low requirements on the circumstances in our experiments.In all, given the exponential growth of data and the scarcity of resources for high-quality computation, the COCNN we propose presents a cost-effective and high-performance solution that could have widespread applications in various data science research fields.

The correspondence between beam states and qubit states
The array of the beams we consider has been introduced in Ref. (40).Here we briefly review the basic setup.Consider the 2-beam state as an example.The state can be given by two beams In Eq. ( 7), , such that the general expressions of the  ℎ 1 ℎ 2 …ℎ  , … ,   1  2 …  in Eq. ( 1) are given by, In the main text, we point out that  ℎ 1 ℎ 2 …ℎ  , … ,   1  2 …  in Eq. ( 1) have a one-to-one relationship with  00…0 , … ,  11…1 in Eq. (9).The underlying conditions for the one-to-one relationship are precisely characterized by Eqs.(10).In fact, the coefficients  ℎ 1 ℎ 2 …ℎ  , … ,   1  2 …  in Eq. ( 1) can be viewed as the components of a vector in the Hilbert space 40 .More generally, any other physical system that can be described by the similar mathematics would be also characterized by the Hilbert space.

The details of the numerical simulation shown by Fig. 2
The specific models of the numerical simulation in Fig. 2 are instructed below.In Fig. 2(a), we compare the convergence of the loss function of the two networks in a binary classification task.The task we consider is to learn the labels of the eight-dimensional 0-1 vectors.The labels of the vectors are either "0" or "1".In our consideration, the labels of the vectors are generated randomly.The results shown in Fig. 2(a) are averaged over the data obtained by 12 times of training.In each training, the vector set is re-labeled randomly.
To accomplish the task, we set the COCNN by adopting one C-layer and one P-layer on three input beams, such as  ̃1,  ̃2 and  ̃3.The state of the beams can be given by |3) =  ℎ 1 ℎ 2 ℎ 3 | 1 )| 2 )| 3 ) + in Fig. 2(c) are plotted by marking the turning point of the surface in accordance with its second order derivative.The colors of background are determined by the ground-state energy density, whose boundaries are identified by the derivative of the energy density function.Notice that identifying the phase of the ground state usually requires to measure the string order parameter of all the particles.The motivation for proposing the QCNN is to decrease the number of the particles needed to measure.In our simulated example, the ground state of the 12-site Haldane Hamiltonian is mapped to the correlation of the 12 beams, and a corresponding phase graph can be obtained by measuring the four output beams.Therefore, the results can be viewed as an illustration of the QCNN spirit, showing a good match with the results in Ref. (37).

(𝑖 = 1 ,
… , ) encodes the information to be processed, which is schematically shown in the leftmost part of Fig.1.Fundamentally, the N multi-mode polarized beams can be used to analogize the N-qubit state, because the correlation of beams defined by the integral ∫( 1 ⋅  1 )( 2 ⋅  2 ) … (  ⋅   )  is formally related to the quantum correlated projection (⟨ 1 |⟨ 2 | … ⟨  |)|  ⟩.The unit vector   ( = 1, … , ) denotes the direction of the polarization projection of the beam   , and |  ⟩ is the corresponding projection state of the th qubit40 .A detailed explanation of the correspondence between beam states and qubit states is given in the first section of the Materials and methods.Based on Eq. (1), a data sample expressed by a 2  -dimensional complex vector can be encoded by the correlations of above  beams.In what follows, we show that encoding the data by the correlations enables a better way to process it.

Fig. 1 |
Fig. 1 | The general setup of a COCNN.The correlated light source, whose polarized modes are marked by arrows with different colors, is manipulated by the parts of the convolution (blue) and the pooling (brown).The part of the convolution is composed of the 2-beam operations marked by blue, and the details of a 2-beam operation is given in the blue dashed box.As shown inside the box, a 2-beam operation is implemented by eight Q-H-Qs and three NLUs.The part of the pooling is composed of the combiners marked by brown, and the details of a combiner is given in the brown dashed box.As shown inside the box, a combiner is implemented by a BC, an HWP-PBS-HWP, and an NLU.Finally, the detection of the output is performed by a homodyne interferometer and a processor.The interferometer is mainly built by a pair of mirrors (MP) and two beam splitters (BSs).

Fig. 2 |
Fig. 2 | (a) The comparison between the training of a COCNN model and that of a traditional CNN model on a binary classification task, and (b) that on a multiclass classification task.In (a) and (b), the hollow squares and solid dots are the numerical results.The blue curve in (a) and the red curve in (b) are fitted by the squares obtained by the traditional CNN model, which is composed of a traditional convolutional layer and a traditional pooling layer (the classical C-P layer model).The green curve in (a)

Fig. 1 .
The first operation in this part is an operation analog to the two CZ gates on adjacent qubits.After simplification, the operation is implemented by the pair of HWPs in the left yellow region.The one on the second mode shifts the phase of the vertical component by a factor of , and the one on the third mode shifts the phase of the same component by the same magnitude.The second operation is a combination of the two single-beam rotations, which is analog to the two quantum Hadamard gates on the first and the third qubit respectively.In the general proposal, it can be realized by two Q-H-Qs.Here, it is implemented by the four BSs in the gray region.The upper left BS mix the first and the third modes, and the lower left BS mix the second and the fourth modes.The right two BSs mix the outputs of the left ones.The third operation is a three-beam operation, which is the analogy of quantum Toffoli gate with the second qubit serving as the target qubit.According to our general proposal, it can be realized by using a series of 2-beam operations.Through the simplification strategy here, it is implemented by the HWP in the orange region.This HWP exchange the horizontal and vertical component of the fourth mode.The fourth operation is the same with the first operation.Therefore, it is also implemented by a pair of HWPs whose area is marked by yellow.The fifth operation is a single beam rotation, analog to the single Hadamard gate on the second qubit.This operation is applied for changing the basis of the projection in the next part.Here, it is implemented by four HWPs in the red region.Each HWP in the region changes the  polarization component to ( + )/√2 and changes the  polarization component to ( − )/√2.Then, the following projection of the beam is going to be casted in the Pauli-X basis.

Fig. 3 |
Fig. 3 | The experimental realization of a simplified COCNN analog to the 3-qubit QCNN circuit for the

Fig. 5 |
Fig. 5 | The results when the input states encode the Haldane ground states.The red dots in the left panel are the experimental data.The Xand Y-axis of the coordinates represent the ratios ℎ 1 / and ℎ 2 /.The Z-axis represent the expectation Tr{|  )(  |} in our basis, equivalent to the measurements in the QCNN phase recognition circuit.The light blue curves are obtained by the SOP.The dark blue curves are the phase boundaries obtained by the second order derivative of the experimental data.The right panel display the comparison of the phase boundaries obtained by the experimental data and those shown in Fig. 2(c).
of   denotes the orthonormal modes satisfying the relation ∫   1 (, ) …    (, ) =   1 ,…,  , and  represents the parameter domain where the condition holds. , =  , H  +  , V  denotes the polarization of the mode   .Such a setup of the beams The N multi-mode polarized beams that give the state of Eq. (1) can be denoted by   ( = 1, … , ), each of which can be expressed by ∑    ,  =1.The 1. Given a state of the two correlated beams |2) =  ℎ 1 ℎ 2 | 1 )| 2 ) +  ℎ 1  2 | 1 )| 2 ) +   1 ℎ 2 | 1 )| 2 ) +   1  2 | 1 )| 2 ),  2 represents the operations that can rotate |2) to an As we mentioned in the main text, the LO beam for measuring  1 and  2 are expressed by  1 LO =  1 and  2 LO =  2 . represents the mode coherent with all   s, such that  ⋅   ∝   .Using the homodyne detection, one obtains the real part of the projection of  1 as well as that of  2 denoted by Re{ 2 }.Re{ } means taking the real part.The imaginary part can be obtained by shifting the phase of  1 LO and  2 LO by /4.Then, one can obtain the correlation by multiplying   and  +1 and integrating the product in the domain where the orthonormal condition of [ 1 *  2 * ] denotes dyadic vector generated by  1 * and  2 * , and those applied for other vectors are similar.By using the compact notation | ) in the main text, one can reform Eq.(7) into [( 1 |( 2 |]|2), which is of the same form with the projection of the 2-qubit state.More generally, one can obtain the state given by Eq. (1) with  correlated beams, analog to the -qubit state , the conditions of the 12 variables for mimicking state(15)can be characterized by 8 equations.So, the equation set has a solution in principle.However, if more modes are introduced, the experimental realization of the modulations can be further simplified.Consider the case when  = 4, one has 3 | 3 ⟩ can be deduced by following relations,