Nonlinear data generation and processing method based on optical quantum and optical quantum computer
By constructing and adjusting optical quantum circuits, the problems of high energy consumption and implementation barriers in nonlinear function computation in existing technologies have been solved, enabling high-energy-efficiency nonlinear data processing and improving the performance of neural networks and the practicality of quantum hardware.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TURINGQ CO LTD
- Filing Date
- 2025-10-10
- Publication Date
- 2026-07-14
Smart Images

Figure CN121543754B_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application filed on October 10, 2025, with parent application number 2025114396731 and invention title "Method for Nonlinear Data Generation and Processing Based on Optical Quantum and Optical Quantum Computer". Technical Field
[0002] This application relates to the field of quantum machine learning technology, and more specifically, to a method for generating and processing nonlinear data based on photons and a photonic quantum computer. Background Technology
[0003] In the field of high-performance computing, especially in applications for artificial intelligence (AI), signal processing, and scientific simulation, core computing tasks can be abstracted as applying a series of linear and nonlinear transformations to data streams. While linear transformations (such as matrix multiplication) have seen significant improvements in energy efficiency, the implementation of nonlinear functions (such as activation functions in neural networks and complex signal modulation) has become a key bottleneck restricting the overall system performance and energy consumption.
[0004] Existing technologies mainly address this problem through pure electric digital computing and pure photonic computing schemes, but both of these schemes have fundamental and irreconcilable limitations. Summary of the Invention
[0005] The purpose of this application is to provide a nonlinear data generation and processing method and an optical quantum computer based on photonic quantum computing, in order to address the shortcomings of the prior art and solve the limitations of the prior art.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0007] In a first aspect, one embodiment of this application provides a method for generating and processing nonlinear data based on photonic quantum mechanics, the method comprising:
[0008] Obtain the nonlinear function of the nonlinear layer and the attribute information of the nonlinear function, wherein the attribute information includes at least: domain information;
[0009] Based on the number of spectra of the nonlinear function and the attribute information of the nonlinear function, an initial optical quantum circuit corresponding to the nonlinear function is constructed. The initial optical quantum circuit includes at least a unitary matrix and a phase shifter.
[0010] The initial optical quantum circuit is measured, and the objective function corresponding to the initial optical quantum circuit is determined based on the measurement results.
[0011] Determine the loss information of the objective function, and determine whether to apply the initial quantum circuit based on the loss information. If yes, use the initial quantum circuit as the target quantum circuit; otherwise, iteratively adjust the initial quantum circuit based on the loss information, and use the initial quantum circuit at the end of the iteration as the target quantum circuit.
[0012] The input data of the nonlinear layer is processed based on the target optical quantum circuit to generate the output data of the nonlinear layer.
[0013] Optionally, constructing the initial photonic quantum circuit corresponding to the nonlinear function based on the number of spectra of the nonlinear function and the attribute information of the nonlinear function includes:
[0014] Based on the number of spectra of the nonlinear function, the photonic quantum parameters are determined, and the photonic quantum parameters include at least: the number of waveguides, the number of phase shifters, and the number of photons;
[0015] The initial quantum circuit is constructed based on the quantum parameters, the property information of the nonlinear function, and the preset quantum circuit architecture.
[0016] Optionally, determining the photonic quantum parameters based on the number of spectra of the nonlinear function includes:
[0017] Obtain preset photon number preference information;
[0018] The photon parameters are determined based on the number of spectra of the nonlinear function and the photon number preference information.
[0019] Optionally, constructing the initial quantum circuit based on the photon parameters, the property information of the nonlinear function, and a preset photon circuit architecture includes:
[0020] Based on the aforementioned photon parameters and the preset photon circuit architecture, an intermediate photon circuit is configured.
[0021] Based on the property information of the nonlinear function, the intermediate quantum circuit is configured a second time to obtain the initial quantum circuit.
[0022] Optionally, the step of performing a secondary configuration on the intermediate quantum circuit based on the property information of the nonlinear function to obtain the initial quantum circuit includes:
[0023] Based on the defined domain information, the input variables of the intermediate optical quantum circuit are determined;
[0024] Based on the input variables, the phase of the phase shifter in the intermediate quantum circuit is determined, and the intermediate quantum circuit is configured according to the phase of the phase shifter to obtain the initial quantum circuit.
[0025] Optionally, determining the phase of the phase shifter in the intermediate quantum circuit based on the input variables includes:
[0026] The phase of the phase shifter in the intermediate quantum circuit is determined based on the input variables and the index information corresponding to the phase shifter in the intermediate quantum circuit.
[0027] Optionally, the step of measuring the initial quantum circuit and determining the objective function corresponding to the initial quantum circuit based on the measurement results includes:
[0028] A photon number-resolved measurement is performed on the initial optical quantum circuit to obtain the measurement result, which is used to indicate the probability distribution of multiphoton events.
[0029] The objective function corresponding to the initial quantum circuit is calculated by weighted summation of the measurement results.
[0030] Optionally, the step of performing photon number-resolved measurement on the initial optical quantum circuit to obtain the measurement result includes:
[0031] The preset input state is input into the optical quantum circuit and evolved to obtain the output state;
[0032] The output state is subjected to photon number-resolved measurement, and multi-photon events are statistically analyzed to obtain the measurement results.
[0033] Optionally, determining whether to apply the initial quantum circuit based on the loss information includes:
[0034] If the loss information is less than a preset loss threshold, then the initial optical quantum circuit is determined to be applied;
[0035] If the loss information is greater than a preset loss threshold, then the unitary matrix in the initial photonic quantum circuit is adjusted according to the loss information.
[0036] Secondly, another embodiment of this application provides a nonlinear data generation and processing apparatus based on photonic quantum mechanics, the apparatus comprising:
[0037] The acquisition module is used to acquire the nonlinear function of the nonlinear layer and the attribute information of the nonlinear function, wherein the attribute information includes at least: domain information;
[0038] A construction module is used to construct an initial quantum circuit corresponding to the nonlinear function based on the number of spectra of the nonlinear function and the attribute information of the nonlinear function. The initial quantum circuit includes at least a unitary matrix and a phase shifter.
[0039] The determination module is used to measure the initial optical quantum circuit and determine the target function corresponding to the initial optical quantum circuit based on the measurement results;
[0040] The determining module is further configured to determine the loss information of the objective function, and determine whether to apply the initial quantum circuit based on the loss information. If yes, the initial quantum circuit is used as the target quantum circuit; if no, the initial quantum circuit is iteratively adjusted based on the loss information, and the initial quantum circuit at the end of the iteration is used as the target quantum circuit.
[0041] The computation module is used to perform computations on the input data of the nonlinear layer based on the target optical quantum circuit, and generate the output data of the nonlinear layer.
[0042] Optionally, the construction module is specifically used for:
[0043] Based on the number of spectra of the nonlinear function, the photonic quantum parameters are determined, and the photonic quantum parameters include at least: the number of waveguides, the number of phase shifters, and the number of photons;
[0044] The initial quantum circuit is constructed based on the quantum parameters, the property information of the nonlinear function, and the preset quantum circuit architecture.
[0045] Optionally, the construction module is specifically used for:
[0046] Obtain preset photon number preference information;
[0047] The photon parameters are determined based on the number of spectra of the nonlinear function and the photon number preference information.
[0048] Optionally, the construction module is specifically used for:
[0049] Based on the aforementioned photon parameters and the preset photon circuit architecture, an intermediate photon circuit is configured.
[0050] Based on the property information of the nonlinear function, the intermediate quantum circuit is configured a second time to obtain the initial quantum circuit.
[0051] Optionally, the construction module is specifically used for:
[0052] Based on the defined domain information, the input variables of the intermediate optical quantum circuit are determined;
[0053] Based on the input variables, the phase of the phase shifter in the intermediate quantum circuit is determined, and the intermediate quantum circuit is configured according to the phase of the phase shifter to obtain the initial quantum circuit.
[0054] Optionally, the construction module is specifically used for:
[0055] The phase of the phase shifter in the intermediate quantum circuit is determined based on the input variables and the index information corresponding to the phase shifter in the intermediate quantum circuit.
[0056] Optionally, the determining module is specifically used for:
[0057] A photon number-resolved measurement is performed on the initial optical quantum circuit to obtain the measurement result, which is used to indicate the probability distribution of multiphoton events.
[0058] The objective function corresponding to the initial quantum circuit is calculated by weighted summation of the measurement results.
[0059] Optionally, the determining module is specifically used for
[0060] The preset input state is input into the optical quantum circuit and evolved to obtain the output state;
[0061] The output state is subjected to photon number-resolved measurement, and multi-photon events are statistically analyzed to obtain the measurement results.
[0062] Optionally, the determining module is specifically used for:
[0063] If the loss information is less than a preset loss threshold, then the initial optical quantum circuit is determined to be applied;
[0064] If the loss information is greater than a preset loss threshold, then the unitary matrix in the initial photonic quantum circuit is adjusted according to the loss information.
[0065] Thirdly, another embodiment of this application provides an optical quantum computer, including: any of the target optical quantum circuits described in the first aspect.
[0066] Fourthly, another embodiment of this application provides an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of any of the methods described in the first aspect above.
[0067] Fifthly, another embodiment of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of any of the methods described in the first aspect above.
[0068] The beneficial effects of this application are as follows: By acquiring the nonlinear function and attribute information of the nonlinear layer, constructing an initial photonic quantum circuit based on the number of spectra and attribute information of the nonlinear function, and measuring the initial photonic quantum circuit, the target function can be determined based on the measurement results. Based on the loss information of the target function, the target photonic quantum circuit can be obtained, enabling computation on the input data of the nonlinear layer based on the target photonic quantum circuit. This not only allows for the equivalent and deterministic acquisition of the target photonic quantum circuit corresponding to a nonlinear layer of arbitrary complexity, thus improving the expressive power of the nonlinear layer, but also enables computation on the input data of the nonlinear layer to be completed in the optical domain, reducing the energy consumption during the nonlinear layer computation process. In other words, it can integrate the low-energy consumption characteristics of photonic computing, the nonlinear characteristics of photonic quantum computing, and the general programmability of electronic computing to perform high-energy-efficiency computation on the input data of the nonlinear layer.
[0069] Simultaneously, the obtained target quantum circuit can also serve as a physical activation unit in a neural network, enabling the network to autonomously "learn" and "evolve" the optimal activation function shape for a specific task during training. This significantly improves the model accuracy and convergence speed of the neural network, allowing for deep coupling between algorithm design and hardware implementation during network training to maximize overall performance, efficiency, and functionality. Furthermore, due to the photonic properties of the target quantum circuit, it can be applied to any time-series task requiring high-speed real-time decision-making, such as speech recognition and financial forecasting.
[0070] Furthermore, the target optical quantum circuit obtained in this application has the advantages of lower quantum circuit complexity and no need for nonlinear optical devices, which can significantly improve the availability, practicality, and value of quantum hardware in practical applications in the current stage of development of noisy, medium-scale quantum computing. In addition, the optical quantum-based nonlinear data generation and processing method provided in this application can also be applied to high-performance optical quantum computing clusters such as parallel or distributed systems, and deployed in fields such as financial processing, logistics manufacturing, and artificial intelligence through quantum hyper-convergence and other methods. Attached Figure Description
[0071] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0072] Figure 1 A schematic flowchart illustrating a nonlinear data generation and processing method based on photonic quantum principles provided in this application embodiment;
[0073] Figure 2 This is a schematic flowchart illustrating the process of constructing the initial quantum circuit corresponding to the nonlinear function in the nonlinear data generation and processing method based on photons provided in this application embodiment.
[0074] Figure 3 A schematic flowchart illustrating the determination of photonic quantum parameters in the nonlinear data generation and processing method based on photonic quantum provided in this application embodiment;
[0075] Figure 4 A schematic flowchart illustrating the construction of a quantum circuit in the nonlinear data generation and processing method based on photons provided in this application embodiment;
[0076] Figure 5 A schematic diagram of the process of obtaining the initial quantum circuit in the nonlinear data generation and processing method based on photons provided in the embodiments of this application;
[0077] Figure 6 This is a flowchart illustrating the process of determining the objective function corresponding to the initial quantum circuit in the nonlinear data generation and processing method based on photons provided in this application embodiment.
[0078] Figure 7 This is a schematic flowchart illustrating the process of obtaining measurement results in the nonlinear data generation and processing method based on photonic quantum provided in the embodiments of this application.
[0079] Figure 8 A schematic flowchart illustrating the process of determining whether to apply an initial quantum circuit in a nonlinear data generation and processing method based on photonics provided in this application embodiment;
[0080] Figure 9 A schematic diagram of a nonlinear data generation and processing device based on optical quantum provided in an embodiment of this application;
[0081] Figure 10 This is a schematic diagram of the electronic device structure provided in an embodiment of this application. Detailed Implementation
[0082] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0083] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0084] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0085] Existing technologies primarily address computational problems related to nonlinear functions through purely electric digital computing schemes and purely photonic computing schemes. Purely electric schemes can flexibly implement arbitrary nonlinearities, but at the cost of unsustainable high energy consumption and limited speed. Purely photonic schemes possess the potential for extremely low energy consumption and high speed, but face fundamental obstacles in achieving core nonlinear computations. Therefore, both schemes have fundamental and irreconcilable limitations.
[0086] Based on the aforementioned problems, this application proposes a method for generating and processing nonlinear data based on photonic quantum computing. This method acquires the nonlinear function and attribute information of the nonlinear layer, constructs an initial photonic quantum circuit based on the spectrum quantity and attribute information of the nonlinear function, and measures the initial photonic quantum circuit. Based on the measurement results, a target function is determined, and based on the loss information of the target function, a target photonic quantum circuit is obtained. This enables computation on the input data of the nonlinear layer based on the target photonic quantum circuit. This method integrates the low-energy consumption characteristics of photonic computing, the nonlinear characteristics of photonic quantum computing, and the general programmability of electronic computing, enabling high-energy-efficiency computation on the input data of the nonlinear layer.
[0087] It is understood that by executing the steps of the nonlinear data generation and processing method based on photonic quantum provided in the embodiments of this application, the expression mechanism of nonlinear functions can be realized at the physical level, thereby integrating the low energy consumption characteristics of photonic computing, the nonlinear characteristics of photonic quantum computing, and the general programmability of electronic computing to perform high-energy-efficiency computing on the input data of the nonlinear layer.
[0088] The following describes in detail the nonlinear data generation and processing method based on photonic quantum provided in this application, with reference to several embodiments.
[0089] Figure 1 A flowchart illustrating a nonlinear data generation and processing method based on photonic quantum mechanics provided in this application is shown below. Figure 1 As shown, the subject executing this method can be any electronic device with processing capabilities, and the method includes:
[0090] S101. Obtain the nonlinear function of the nonlinear layer and the attribute information of the nonlinear function.
[0091] It can be understood that the nonlinear function of the nonlinear layer refers to the nonlinear function itself that is desired to be realized in the optical quantum circuit.
[0092] The nonlinear function can be a nonlinear activation function, specifically, a nonlinear activation function used in a neural network, such as ReLU, Tanh, Sigmoid, or any composite function. The shape of the nonlinear function can be directly determined by a set of Fourier coefficients, which also serve as trainable parameters when using nonlinear layers in the neural network.
[0093] Optionally, depending on the structure of the neural network to be trained, the nonlinear function of the corresponding nonlinear layer and the attribute information of the nonlinear function can be obtained.
[0094] Among these, the attribute information includes at least the domain information. Specifically, the domain information refers to the range of values of the input variable x of the nonlinear function. The domain information can affect the effectiveness and convergence of the Fourier expansion, and also determine how to discretize the input variable x.
[0095] Optionally, the attribute information may also include: the Fourier spectrum characteristics of the nonlinear function, wherein the Fourier spectrum characteristics include: how many independent frequency components are included in the Fourier series expansion of the nonlinear function, the amplitude and phase information of each frequency component, and whether the nonlinear function is a periodic function.
[0096] Optionally, the attribute information also includes the nonlinear characteristics of the nonlinear function. These nonlinear characteristics determine the training strategy and hardware selection. They include: steep change characteristics, high-frequency oscillation characteristics, jump characteristics, and discontinuity characteristics. Specifically, steep change characteristics indicate whether the nonlinear function has a steep change; high-frequency oscillation characteristics indicate whether the nonlinear function has high-frequency oscillation components; jump characteristics indicate whether the nonlinear function has jumps; and discontinuity characteristics indicate whether the nonlinear function has discontinuities.
[0097] Optionally, the attribute information may also include: accuracy requirements, calculation speed requirements, noise tolerance, etc.
[0098] S102. Based on the number of spectra of the nonlinear function and the attribute information of the nonlinear function, construct the initial photonic quantum circuit corresponding to the nonlinear function.
[0099] Optionally, after obtaining the nonlinear function, the number of spectra of the nonlinear function can be determined, and the initial photonic quantum circuit corresponding to the nonlinear function can be constructed based on the number of spectra and the attribute information of the nonlinear function.
[0100] The number of spectra refers to the number of independent frequency components contained in a nonlinear function after its Fourier series expansion within its domain.
[0101] For example, taking a nonlinear function that is periodic as an example, the nonlinear function can be expanded into a Fourier series, and the number of all independent frequency components can be extracted to obtain the number of spectra. Taking a nonlinear function that is nonperiodic as an example, the nonlinear function can be approximated over a finite interval, and the first N dominant frequency components can be retained, where N is the number of Fourier spectra, and N is a positive integer.
[0102] For example, taking the nonlinear function f(x) = sin(x) + cos(2x) as an example, the number of spectra can be 2.
[0103] For example, the complexity of the initial quantum circuit can be determined based on the number of spectra of the nonlinear function, and the modulation range of the initial quantum circuit can be determined based on the property information of the nonlinear function, thereby constructing the initial quantum circuit corresponding to the nonlinear function.
[0104] The initial quantum circuit, as the physical realization of a nonlinear function, is a programmable photon path network composed of multiple optical elements. It is used to perform controllable linear transformations and interference operations on the input photon state, thereby realizing quantum information processing tasks. The initial quantum circuit includes at least a unitary matrix and a phase shifter.
[0105] For example, the initial quantum circuit can be implemented based on a unitary matrix-phase shifter-unitary matrix architecture, which can realize arbitrary multimode unitary transformations. The initial quantum circuit is used to perform controllable linear transformations and interference operations on the input photon states, and finally obtains a function expression of the input variable x by measuring the photon number distribution at the output end.
[0106] The input photon state can be a photon number state (or simply Fock state), which specifically refers to an eigenstate describing the state of an optical field with a definite number of photons. A Fock state uses the number of photons to label a state, representing a quantum state in the optical field with a specific number of photons.
[0107] The unitary matrix represents the interference behavior of photons propagating between multiple waveguides. It can be implemented by a cascaded structure of beam splitters and phase shifters. Specifically, it can be obtained by mapping a linear interference network consisting of a series of beam splitters and phase shifters, for example, a combination of a series of 2×2 beam splitters and phase shifters. The parameters of the unitary matrix (e.g., beam splitter angles, phase shifter phases) can be optimized using gradient descent. The phase shifter is used to control the photon phase.
[0108] S103. Measure the initial photonic quantum circuit and determine the objective function corresponding to the initial photonic quantum circuit based on the measurement results.
[0109] Optionally, the initial quantum circuit can be evolved, and the output of the initial quantum circuit can be measured with photon number resolution to obtain the measurement results, thereby constructing the objective function corresponding to the initial quantum circuit based on the measurement results.
[0110] The measurement result can be the output probability distribution of the initial photonic quantum circuit, which is essentially a Fourier series expansion of the input phase.
[0111] The objective function corresponding to the initial quantum circuit refers to the function obtained by the initial quantum circuit through quantum state evolution and measurement of the input. The objective function can express the initial quantum circuit.
[0112] S104. Determine the loss information of the objective function. Based on the loss information, determine whether to apply the initial quantum circuit. If yes, use the initial quantum circuit as the target quantum circuit. If no, iteratively adjust the initial quantum circuit and use the initial quantum circuit at the end of the iteration as the target quantum circuit.
[0113] Optionally, after obtaining the objective function, the loss information of the objective function can be determined according to the preset loss function, and the initial quantum circuit can be used as the target quantum circuit based on the loss information of the objective function. If so, the initial quantum circuit is used as the target quantum circuit.
[0114] Optionally, if not, the initial quantum circuit is iteratively adjusted based on the loss information, and the objective function and the loss information of the objective function are redefined until the iteration ends. The initial quantum circuit at the end of the iteration is then used as the target quantum circuit.
[0115] The loss information is used to indicate the difference between the objective function and the nonlinear function.
[0116] For example, the objective function can be calculated based on a preset loss function and a regularization term to obtain loss information. The preset loss function can be, for example, mean squared error.
[0117] For example, the unitary matrix and phase shifters in the initial quantum optical circuit can be adjusted, such as by adjusting the parameters of the unitary matrix or the number of phase shifters. The number of waveguides and photons in the initial quantum optical circuit can also be adjusted.
[0118] S105. Based on the target optical quantum circuit, the input data of the nonlinear layer is processed to generate the output data of the nonlinear layer.
[0119] Optionally, after obtaining the target optical quantum circuit, the input data of the nonlinear layer can be processed based on the target optical quantum circuit to generate the output data of the nonlinear layer.
[0120] Optionally, after obtaining the target optical quantum circuit, the target optical quantum circuit can be used as an optical quantum chip to construct an optical quantum computer.
[0121] For example, the target photonic quantum circuit can serve as the physical activation unit in a neural network, enabling the neural network to autonomously "learn" and "evolve" the optimal activation function shape for a specific task during training, rather than passively using a preset ReLU or Sigmoid. This helps to significantly improve model accuracy and convergence speed, opening a new paradigm of "algorithm-hardware co-design".
[0122] For example, the target quantum circuit can also serve as the core of the physical reservoir in a high-dimensional nonlinear dynamic system. The target quantum circuit is used to map the input data of the nonlinear layer to a complex feature space with high performance, generating the output data of the nonlinear layer. Furthermore, in this process, the state evolution speed of the target quantum circuit approaches the speed of light, and the energy consumption is extremely low. The target quantum circuit can be applied to any time-series task requiring high-speed real-time decision-making, such as speech recognition and financial forecasting.
[0123] In this embodiment, by acquiring the nonlinear function and attribute information of the nonlinear layer, and constructing an initial photonic quantum circuit based on the number of spectra and attribute information of the nonlinear function, and measuring the initial photonic quantum circuit, the target function can be determined based on the measurement results. Based on the loss information of the target function, the target photonic quantum circuit is obtained, enabling computation on the input data of the nonlinear layer based on the target photonic quantum circuit. This not only allows for the equivalent and deterministic acquisition of the target photonic quantum circuit corresponding to a nonlinear layer of arbitrary complexity, improving the expressive power of the nonlinear layer, but also enables computation on the input data of the nonlinear layer to be completed in the optical domain, reducing the energy consumption during the nonlinear layer computation process. In other words, it can integrate the low-energy consumption characteristics of photonic computing, the nonlinear characteristics of photonic quantum computing, and the general programmability of electronic computing to perform high-energy-efficiency computation on the input data of the nonlinear layer.
[0124] Simultaneously, the obtained target quantum circuit can also serve as a physical activation unit in a neural network, enabling the network to autonomously "learn" and "evolve" the optimal activation function shape for a specific task during training. This significantly improves the model accuracy and convergence speed of the neural network, allowing for deep coupling between algorithm design and hardware implementation during network training to maximize overall performance, efficiency, and functionality. Furthermore, due to the photonic properties of the target quantum circuit, it can be applied to any time-series task requiring high-speed real-time decision-making, such as speech recognition and financial forecasting.
[0125] Furthermore, the target optical quantum circuit obtained in this application has the advantages of lower quantum circuit complexity and no need for nonlinear optical devices, which can significantly improve the availability, practicality, and value of quantum hardware in practical applications in the current stage of development of noisy, medium-scale quantum computing. In addition, the optical quantum-based nonlinear data generation and processing method provided in this application can also be applied to high-performance optical quantum computing clusters such as parallel or distributed systems, and deployed in fields such as financial processing, logistics manufacturing, and artificial intelligence through quantum hyper-convergence and other methods.
[0126] As one possible implementation, the following provides an illustrative example of the process of constructing the initial optical quantum circuit corresponding to the nonlinear function. Figure 2 This is a schematic flowchart illustrating the construction of the initial quantum circuit corresponding to the nonlinear function in the quantum-based nonlinear data generation and processing method provided in this application embodiment. (Refer to...) Figure 2 As shown, in S102 above, the initial photonic quantum circuit corresponding to the nonlinear function is constructed based on the number of spectra of the nonlinear function and the attribute information of the nonlinear function, including:
[0127] S201. Determine the photonic quantum parameters based on the number of spectra of the nonlinear function.
[0128] It is understandable that the more spectra a nonlinear function has, the higher the complexity of the optical quantum circuit.
[0129] Optionally, the photonic parameters can be obtained by matching them from a preset mapping relationship between the number of spectra of the nonlinear function and the photonic parameters.
[0130] The quantum parameters include at least the waveguide number, the number of phase shifters, and the number of photons. The quantum parameters may also include the size of the unitary matrix.
[0131] For example, the number of waveguides can be the same as the number of spectra, the number of photons can be determined based on the number of spectra, the number of photons multiplied by the number of phase shifters can be greater than or equal to the number of spectra, and the number of phase shifters can be the number of waveguides minus 1. For example, when the number of spectra is 2, the number of waveguides can be 2, the number of photons can be 2, the number of phase shifters can be 1, and the size of the unitary matrix can be 2*2.
[0132] By determining the number of spectra of the nonlinear function, the photonic quantum parameters can be made to match the expressive power of the obtained target photonic quantum circuit with the complexity of the nonlinear function, thereby improving the expressive power of the obtained target photonic quantum circuit for nonlinear functions.
[0133] S202. Construct an initial quantum circuit based on the photon parameters, the property information of the nonlinear function, and the preset photon circuit architecture.
[0134] Optionally, an initial quantum circuit can be constructed based on the obtained quantum parameters, the property information of the nonlinear function, and the preset quantum circuit architecture.
[0135] For example, a preset quantum circuit architecture can be obtained, and the quantum circuit architecture can be adjusted according to the information indicated by the quantum parameters and the property information of the nonlinear function, so as to obtain the initial quantum circuit.
[0136] The preset quantum circuit architecture is a unitary matrix-phase shifter-unitary matrix architecture.
[0137] By determining the number of spectra of nonlinear functions, photonic parameters are identified. Based on these parameters, the properties of the nonlinear functions, and a pre-defined photonic circuit architecture, an initial photonic circuit can be constructed. This improves the efficiency and stability of photonic circuit construction, reduces training costs, and increases convergence success rate. Furthermore, it integrates the low-energy consumption of photonic computing, the nonlinearity of photonic computing, and the general programmability of electronic computing to achieve high-efficiency, high-precision nonlinear layer processing.
[0138] As one possible implementation method, Figure 3This is a schematic flowchart illustrating the determination of photonic quantum parameters in the photonic quantum-based nonlinear data generation and processing method provided in this application embodiment. (Refer to...) Figure 3 As shown, in S201 above, the photonic quantum parameters are determined based on the number of spectra of the nonlinear function, including:
[0139] S301. Obtain preset photon number preference information.
[0140] Optionally, preset photon number preference information can be obtained.
[0141] The photon number preference information is used to indicate the desired initial input photon state when constructing the initial photonic quantum circuit. For example, the photon number preference information can be 2, that is, the desired input photon state is a quantum state containing exactly two photons.
[0142] S302. Determine the photon parameters based on the number of spectra of the nonlinear function and the photon number preference information.
[0143] Optionally, the photon parameters can be obtained based on the spectral information of the nonlinear function, the photon number preference information, and the preset rules for determining photon parameters.
[0144] For example, the number of waveguides can be the same as the number of spectra, the number of photons can be determined based on the number of spectra, and the number of phase shifters can be the number of waveguides minus 1. For instance, when the number of spectra is 2, the number of waveguides can be 2, the number of photons can be 2, the number of phase shifters can be 1, and the size of the unitary matrix can be 2*2.
[0145] By determining the photonic quantum parameters using the number of spectra and photon number preference information of the nonlinear function, the expressive power of the photonic quantum circuit can be matched with the complexity of the nonlinear function. Furthermore, photonic quantum resources can be allocated as needed, thereby improving the expressive power of the target photonic quantum circuit for nonlinear functions while achieving efficient utilization of photonic quantum resources.
[0146] As one possible implementation method, Figure 4 This is a schematic flowchart illustrating the construction of a quantum circuit in the quantum-based nonlinear data generation and processing method provided in this application embodiment. (Refer to...) Figure 4 As shown, in step S202 above, an initial quantum circuit is constructed based on the photon parameters, the property information of the nonlinear function, and the preset photon circuit architecture, including:
[0147] S401. Based on the photon parameters and the preset photon circuit architecture, the intermediate photon circuit is configured.
[0148] The preset optical quantum circuit architecture can include three layers. The first layer is a unitary matrix, consisting of beam splitters and phase shifters, used to construct arbitrary unitary transformations. The second layer is a phase shifter, consisting of adjustable phase shifters, used to introduce controllable relative phases. The third layer is a unitary matrix, consisting of beam splitters and phase shifters, used to adjust the output mode.
[0149] Optionally, the dimension of the initial optical quantum circuit can be determined based on the waveguide number, and the required number of beam splitters and phase shifters can be calculated based on the waveguide number, and the parameters of each beam splitter and phase shifter can be configured to obtain the intermediate optical quantum circuit.
[0150] For example, taking a waveguide number of 4, a photon number of 2, and a phase shifter number of 3, the intermediate quantum circuit can be obtained by using Clements decomposition on a 2*2 unitary matrix. The first layer of the intermediate quantum circuit includes six beam splitters and six phase shifters, the second layer includes three phase shifters, and the third layer includes six beam splitters and six phase shifters.
[0151] S402. Based on the property information of the nonlinear function, the intermediate photonic quantum circuit is reconfigured to obtain the initial photonic quantum circuit.
[0152] Optionally, the input state of the intermediate quantum circuit can be encoded based on the property information of the nonlinear function, thereby realizing the secondary configuration of the initial quantum circuit and obtaining the intermediate quantum circuit.
[0153] As one possible implementation method, Figure 5 This is a schematic flowchart illustrating the initial quantum circuit obtained in the nonlinear data generation and processing method based on photons provided in this application embodiment. (Refer to...) Figure 5 As shown, in step S401 above, the intermediate quantum circuit is configured a second time based on the property information of the nonlinear function to obtain the initial quantum circuit, including:
[0154] S501. Determine the input variables of the intermediate quantum circuit based on the domain information.
[0155] Optionally, the domain information can be discretized according to a preset discretization granularity to obtain the input variables of the intermediate optical quantum circuit.
[0156] S502. Based on the input variables, determine the phase of the phase shifter in the intermediate quantum circuit, and configure the intermediate quantum circuit according to the phase of the phase shifter to obtain the initial quantum circuit.
[0157] Alternatively, the input variables can be mapped to the phase of the phase shifter in the intermediate quantum circuit, and the intermediate quantum circuit can be configured according to the phase of the phase shifter to obtain the initial quantum circuit.
[0158] For example, the input variables can be mapped to the phase of the phase shifter in the intermediate quantum circuit according to the order of the input variables, and the phase angle of the phase shifter in the intermediate quantum circuit can be adjusted according to the phase of the phase shifter to obtain the initial quantum circuit.
[0159] As one possible implementation, in S502 above, determining the phase of the phase shifter in the intermediate optical quantum circuit based on the input variables includes:
[0160] The phase of the phase shifter in the intermediate quantum circuit is determined based on the input variables and the index information corresponding to the phase shifter in the intermediate quantum circuit.
[0161] Optionally, the phase of the phase shifter in the intermediate quantum circuit can be calculated based on the input variables and the index information corresponding to the phase shifter in the intermediate quantum circuit.
[0162] For example, taking the input variable as x, assuming that the current phase shifter is the i-th phase shifter in the optical quantum circuit, the phase of the i-th phase shifter can be calculated as i*x.
[0163] By using input variables and the index information corresponding to the phase shifters in the optical quantum circuit, the phase of the phase shifters in the optical quantum circuit can be determined. This allows the input variables to be mapped to the parameters of multiple phase shifters, and the parameters of each phase shifter are proportional to its index. This makes the influence of the input variables on the initial optical quantum circuit linearly extensible, thereby increasing the number of Fourier spectra and realizing the function expression and optimization capabilities of the optical quantum circuit.
[0164] The above provides an illustrative explanation of the process of constructing the initial quantum circuit corresponding to the nonlinear function. It can be understood that after constructing the initial quantum circuit, the initial quantum circuit can be measured, and the target function corresponding to the initial quantum circuit can be determined based on the measurement results. The following is a detailed explanation.
[0165] As one possible implementation method, Figure 6 This is a flowchart illustrating the process of determining the objective function corresponding to the initial quantum circuit in the nonlinear data generation and processing method based on photons provided in this application embodiment. (Refer to...) Figure 6 As shown, in S103 above, the initial quantum circuit is measured, and the objective function corresponding to the initial quantum circuit is determined based on the measurement results, including:
[0166] S601. Perform photon number-resolved measurement on the initial photonic quantum circuit and obtain the measurement results.
[0167] Optionally, the initial photonic quantum circuit can be evolved multiple times, and the evolved initial photonic quantum circuit can be measured with photon number resolution. After each evolution, a multiphoton event is obtained, and the multiple multiphoton events obtained by sampling are statistically analyzed to obtain the measurement result.
[0168] The measurement results are used to indicate the probability distribution of multiphoton events.
[0169] S602. The measurement results are weighted and summed to calculate the objective function corresponding to the initial photonic quantum circuit.
[0170] Optionally, each event in the measurement results is assigned a preset weight corresponding to that event, and the weights are summed to calculate the objective function corresponding to the initial quantum circuit.
[0171] The weighted summation of the measurement results is essentially a Fourier series expansion of the input phase.
[0172] By performing photon number-resolved measurements on the initial quantum circuit, the measurement results are obtained, and the target function corresponding to the initial quantum circuit is calculated by weighted summation. Through measurement and statistics, the "physical output" of the initial quantum circuit can be transformed into a "mathematical function", so that the initial quantum circuit is no longer a "black box" but a mathematical function with a clear input-output mapping, thereby improving the interpretability and controllability of the initial quantum circuit.
[0173] As one possible implementation method, Figure 7 This is a schematic flowchart illustrating the process of obtaining measurement results in the nonlinear data generation and processing method based on photonics provided in this application embodiment, with reference to... Figure 7 As shown, the above-mentioned S601 performs photon number-resolved measurements on the initial optical quantum circuit and obtains the measurement results, including:
[0174] S701. Input the preset input state into the initial photonic quantum circuit and evolve it to obtain the output state.
[0175] Optionally, a preset input state is input into the initial photonic quantum circuit, and the input state is transformed into an output photonic state through the evolution of optical elements in the initial photonic quantum circuit.
[0176] S702. Perform photon number resolution measurement on the output state and count multiphoton events to obtain the measurement results.
[0177] Optionally, multiple output states are subjected to photon number-resolved measurements by a detector, and statistical sampling is performed to obtain sampling results. Based on the sampling results, the frequency of each event is calculated to obtain the measurement results.
[0178] The measurement results can be the probability distribution of multiphoton events, which can reflect the distribution of the quantum state output by the initial photonic quantum circuit in different modes under the current input state.
[0179] As one possible implementation method, Figure 8 This is a flowchart illustrating the process of determining whether to apply an initial quantum circuit in the quantum-based nonlinear data generation and processing method provided in this application, as illustrated in the embodiments of the present application. Figure 8 As shown, S104 above determines whether to apply the initial quantum circuit based on the loss information, including:
[0180] S801. If the loss information is less than the preset loss threshold, then determine to apply the initial optical quantum circuit.
[0181] Optionally, if the loss information is less than a preset loss threshold, the initial optical quantum circuit can be determined to be applied.
[0182] S802. If the loss information is greater than the preset loss threshold, then adjust the unitary matrix in the initial optical quantum circuit according to the loss information.
[0183] Optionally, if the loss information is greater than the preset loss threshold, the unitary matrix in the initial optical quantum circuit can be adjusted according to the loss information through the end-to-end backpropagation algorithm, and S103-S104 can be re-executed.
[0184] Specifically, the parameters of the unitary matrix in the initial quantum circuit can be updated based on the loss information, thereby enabling the objective function to better approximate the nonlinear function.
[0185] For example, the parameters of the unitary matrix can be used as trainable variables. Based on the loss information, the gradient of the loss information with respect to the parameters of the unitary matrix can be calculated through backpropagation. Then, the parameters of the unitary matrix can be updated based on the gradient using optimizers such as Adam and RMSProp.
[0186] By adjusting the unitary matrix in the photonic quantum circuit, the function output by the target photonic quantum circuit can be made to approximate the target function by controlling the photon interference path, thereby realizing the physical expression of the nonlinear function.
[0187] Based on the same inventive concept, this application also provides an optical quantum-based nonlinear data generation and processing device corresponding to the optical quantum-based nonlinear data generation and processing method. Since the principle of the device in this application is similar to the optical quantum-based nonlinear data generation and processing method described above in this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0188] Reference Figure 9 As shown, Figure 9This is a schematic diagram of a nonlinear data generation and processing device based on photonic quantum mechanics provided in an embodiment of this application. The device includes: an acquisition module 901, a construction module 902, a determination module 903, and a calculation module 904.
[0189] The acquisition module 901 is used to acquire the nonlinear function of the nonlinear layer and the attribute information of the nonlinear function. The attribute information includes at least the domain information.
[0190] The construction module 902 is used to construct the initial quantum circuit corresponding to the nonlinear function based on the number of spectra of the nonlinear function and the attribute information of the nonlinear function. The initial quantum circuit includes at least: a unitary matrix and a phase shifter.
[0191] The determination module 903 is used to measure the initial optical quantum circuit and determine the objective function corresponding to the initial optical quantum circuit based on the measurement results;
[0192] The determination module 903 is also used to determine the loss information of the objective function, and to determine whether to apply the initial quantum circuit based on the loss information. If so, the initial quantum circuit is used as the target quantum circuit; if not, the initial quantum circuit is iteratively adjusted based on the loss information, and the initial quantum circuit at the end of the iteration is used as the target quantum circuit.
[0193] The computation module 904 is used to perform computations on the input data of the nonlinear layer based on the target optical quantum circuit, and generate the output data of the nonlinear layer.
[0194] Optionally, module 902 is specifically used for:
[0195] The photon parameters are determined based on the number of spectra of the nonlinear function. The photon parameters include at least the number of waveguides, the number of phase shifters, and the number of photons.
[0196] Based on the properties of the photon parameters, the nonlinear function, and the preset photon circuit architecture, an initial photon circuit is constructed.
[0197] Optionally, module 902 is specifically used for:
[0198] Obtain preset photon number preference information;
[0199] The photon parameters are determined based on the number of spectra of the nonlinear function and the photon number preference information.
[0200] Optionally, module 902 is specifically used for:
[0201] Based on the photon parameters and the preset photon circuit architecture, the intermediate photon circuit is configured.
[0202] Based on the property information of the nonlinear function, the intermediate photonic quantum circuit is reconfigured to obtain the initial photonic quantum circuit.
[0203] Optionally, module 902 is specifically used for:
[0204] Based on the domain information, determine the input variables of the intermediate optical quantum circuit;
[0205] Based on the input variables, the phase of the phase shifter in the intermediate quantum circuit is determined, and the intermediate quantum circuit is configured according to the phase of the phase shifter to obtain the initial quantum circuit.
[0206] Optionally, module 902 is specifically used for:
[0207] The phase of the phase shifter in the intermediate quantum circuit is determined based on the input variables and the index information corresponding to the phase shifter in the intermediate quantum circuit.
[0208] Optionally, module 903 is specifically used for:
[0209] A photon number-resolved measurement is performed on the initial photonic quantum circuit to obtain the measurement results, which are used to indicate the probability distribution of multiphoton events.
[0210] The objective function corresponding to the initial quantum circuit is calculated by weighted summation of the measurement results.
[0211] Optionally, module 903 is determined, specifically for...
[0212] The preset input state is input into the photonic quantum circuit and evolved to obtain the output state;
[0213] The output state is measured with photon number resolution, and multiphoton events are counted to obtain the measurement results.
[0214] Optionally, module 903 is specifically used for:
[0215] If the loss information is less than the preset loss threshold, then the initial optical quantum circuit is determined to be applied;
[0216] If the loss information is greater than the preset loss threshold, the unitary matrix in the initial photonic quantum circuit is adjusted according to the loss information.
[0217] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0218] This application also provides an optical quantum computer, which includes: the aforementioned target optical quantum circuit, a single-photon source, and a photon detector.
[0219] This includes the target photonic quantum circuit, the single-photon source, and the optical connection of the photon detector. The photon detector can be a single-photon detector.
[0220] Among them, optical quantum computers are quantum computing devices that use photons (light particles) as qubits for information processing. Single photon sources generate high-quality single photons as qubit carriers by exciting quantum dots with lasers or by spontaneous parametric downconversion (SPDC).
[0221] The target optical quantum circuit is obtained by executing the steps of the above-mentioned nonlinear data generation and processing method based on optical quantum. Specifically, it is composed of optical components such as optical fiber, waveguide, beam splitter, phase modulator, and mirror to realize optical transmission and interference, information encoding and logic operation (such as Hadamard gate and CNOT gate).
[0222] The single-photon detector measures the final state of a photon (such as the Fock state or path) and outputs the calculation results. For details on the specific processing procedures of an optical quantum computer, please refer to the relevant technical descriptions, which will not be elaborated upon here.
[0223] This application also provides an electronic device, such as... Figure 10 As shown, Figure 10 The schematic diagram of the electronic device structure provided in the embodiments of this application includes: a processor 1001, a memory 1002, and optionally, a bus 1003. The memory 1002 stores machine-readable instructions executable by the processor 1001 (e.g., ...). Figure 9 The device includes the acquisition module 901, the construction module 902, the determination module 903, and the execution instructions corresponding to the calculation module 904. When the electronic device is running, the processor 1001 and the memory 1002 communicate through the bus 1003. When the machine-readable instructions are executed by the processor 1001, the steps of the above-mentioned nonlinear data generation and processing method based on photons are executed.
[0224] This application also provides a computer-readable storage medium storing a computer program, which, when run by a processor, executes the steps of the above-described nonlinear data generation and processing method based on photons.
[0225] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.
[0226] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0227] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for generating and processing nonlinear data based on photonic quantum mechanics, characterized in that, include: Obtain the nonlinear function of the nonlinear layer and the attribute information of the nonlinear function, wherein the attribute information includes at least: domain information; Based on the number of spectra of the nonlinear function, the photonic quantum parameters are determined, and the photonic quantum parameters include at least: the number of waveguides, the number of phase shifters, and the number of photons; Based on the aforementioned photon parameters and the preset photon circuit architecture, an intermediate photon circuit is configured. Based on the defined domain information, the input variables of the intermediate optical quantum circuit are determined; Based on the input variables, the phase of the phase shifter in the intermediate quantum circuit is determined, and the intermediate quantum circuit is configured according to the phase of the phase shifter to obtain an initial quantum circuit, which includes at least a unitary matrix and a phase shifter. The initial optical quantum circuit is measured, and the objective function corresponding to the initial optical quantum circuit is determined based on the measurement results. Determine the loss information of the objective function, and determine whether to apply the initial quantum circuit based on the loss information. If yes, use the initial quantum circuit as the target quantum circuit; otherwise, iteratively adjust the initial quantum circuit based on the loss information, and use the initial quantum circuit at the end of the iteration as the target quantum circuit. The input data of the nonlinear layer is processed based on the target optical quantum circuit to generate the output data of the nonlinear layer.
2. The method for generating and processing nonlinear data based on photonic quantum as described in claim 1, characterized in that, Determining the photonic quantum parameters based on the number of spectra of the nonlinear function includes: Obtain preset photon number preference information; The photon parameters are determined based on the number of spectra of the nonlinear function and the photon number preference information.
3. The method for generating and processing nonlinear data based on photonic quantum as described in claim 1, characterized in that, Determining the phase of the phase shifter in the intermediate quantum optical circuit based on the input variables includes: The phase of the phase shifter in the intermediate quantum circuit is determined based on the input variables and the index information corresponding to the phase shifter in the intermediate quantum circuit.
4. The method for generating and processing nonlinear data based on photonic quantum as described in claim 1, characterized in that, The step of measuring the initial quantum circuit and determining the target function corresponding to the initial quantum circuit based on the measurement results includes: A photon number-resolved measurement is performed on the initial optical quantum circuit to obtain the measurement result, which is used to indicate the probability distribution of multiphoton events. The objective function corresponding to the initial quantum circuit is calculated by weighted summation of the measurement results.
5. The method for generating and processing nonlinear data based on photonic quantum as described in claim 4, characterized in that, The step of performing photon number-resolved measurements on the initial optical quantum circuit to obtain measurement results includes: The preset input state is input into the optical quantum circuit and evolved to obtain the output state; The output state is subjected to photon number-resolved measurement, and multi-photon events are statistically analyzed to obtain the measurement results.
6. The method for generating and processing nonlinear data based on photonic quantum as described in claim 1, characterized in that, The step of determining whether to apply the initial quantum circuit based on the loss information includes: If the loss information is less than a preset loss threshold, then the initial optical quantum circuit is determined to be applied; If the loss information is greater than a preset loss threshold, then the unitary matrix in the initial photonic quantum circuit is adjusted according to the loss information.
7. A nonlinear data generation and processing device based on photonic quantum, characterized in that, include: The acquisition module is used to acquire the nonlinear function of the nonlinear layer and the attribute information of the nonlinear function, wherein the attribute information includes at least: domain information; A construction module is used to determine the photonic parameters based on the number of spectra of the nonlinear function. The photonic parameters include at least the number of waveguides, the number of phase shifters, and the number of photons. Based on the photonic parameters and a preset photonic circuit architecture, an intermediate photonic circuit is configured. Based on the domain information, the input variables of the intermediate photonic circuit are determined. Based on the input variables, the phases of the phase shifters in the intermediate photonic circuit are determined, and based on the phases of the phase shifters, the intermediate photonic circuit is configured to obtain an initial photonic circuit, which includes at least a unitary matrix and phase shifters. The determination module is used to measure the initial optical quantum circuit and determine the target function corresponding to the initial optical quantum circuit based on the measurement results; The determining module is further configured to determine the loss information of the objective function, and determine whether to apply the initial quantum circuit based on the loss information. If yes, the initial quantum circuit is used as the target quantum circuit; if no, the initial quantum circuit is iteratively adjusted based on the loss information, and the initial quantum circuit at the end of the iteration is used as the target quantum circuit. The computation module is used to perform computations on the input data of the nonlinear layer based on the target optical quantum circuit, and generate the output data of the nonlinear layer.
8. A quantum optical computer, characterized in that, The optical quantum computer includes: a target optical quantum circuit obtained by performing the method described in any one of claims 1-6.