Parallel matrix-matrix multiplication optical calculation method and system based on coherent light

By adopting the parallel matrix-matrix multiplication method based on coherent light in free space light calculation, the problem that light calculation is difficult to balance universality and parallelism is solved, and efficient light speed matrix-matrix multiplication is realized, which improves the universality of light calculations. and computing power.

CN119414919APending Publication Date: 2025-02-11SHANGHAI JIAOTONG UNIV +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411437417.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

Free space light computing is difficult to balance universality and parallelism, and the existing methods are complex and cannot effectively improve the computing power of the optical computing paradigm.

Method used

Using the parallel matrix-matrix multiplication method based on coherent light, the input matrix is ​​mapped onto the coherent laser through amplitude and phase modulation, and parallel summing is achieved through light focusing. .

Benefits of technology

Parallel light speed matrix-matrix multiplication with coherent light single propagation as the carrier, combining general computing power and three-dimensional computing power, improving the efficiency and ability of optical computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119414919A_ABST
    Figure CN119414919A_ABST
Patent Text Reader

Abstract

The invention relates to a parallel matrix-matrix multiplication light calculation method and system based on coherent light. The method comprises the following steps: acquiring two input matrixes to be multiplied; the method comprises the following steps of: modulating an input matrix to coherent laser by amplitude, modulating linear phases with different change rates to a light field corresponding to each row of a first input matrix, and carrying out parallel computing on a Hadamard product between each row of the first input matrix and each column of a second input matrix in a mixed state by utilizing the bose property of light and utilizing light imaging and focusing combination to obtain a Hadamard product; parallel summation is realized through light focusing; and by using duality between the spatial linear phase change rate and the spatial position of the frequency spectrum, the summation results from each row and each column are separated and arranged in parallel to obtain a matrix multiplication calculation result. Compared with the prior art, the method has the advantages of balancing universality and parallelism and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of optical computing technology, and in particular to a parallel matrix-matrix multiplication optical computing method and system based on coherent light. Background Art

[0002] Optics has become one of the promising candidate carriers for the next generation of high-performance computing due to its advantages of large bandwidth and low power consumption. The main technical approaches to optical computing include planar waveguide-based optical computing and free-space optical computing. With the emergence of high-performance electro-optical modulation arrays and photodetection arrays, free-space optical computing has become a more powerful solution due to its inherent two-dimensional information loading and computing capabilities.

[0003] Despite significant progress in devices, there is still a lack of a general and highly parallel optical computing paradigm, which makes it difficult for practical optical computing capabilities to keep up with data throughput. Current free-space optical computing still uses paradigms from decades ago, mainly based on paraxial diffraction and the "Stanford" method. Although the former is two-dimensional and parallel, it can only build the so-called diffraction computing architecture, which is a dedicated computing paradigm that cannot be applied to general computing tasks. Although the latter is a general vector-matrix multiplication paradigm, it has poor parallel computing capabilities because its time complexity implemented in a computer is O(N 2 In fact, since the introduction of the "Stanford" method, researchers have been continuously exploring parallel and universal free-space optical matrix-matrix multiplication (the time complexity of implementing it in a computer is O(N)). 3 )). They adopted methods such as spatial wavelength division multiplexing (WDM), but these methods are just multi-wavelength variants of the "Stanford" method and fail to fundamentally improve the computing power of the optical computing paradigm. In addition, these implementations are extremely complex, which contradicts the current trend of miniaturization and integration of optical computing structures. Some methods require complex preprocessing, such as changing the value of each element in the matrix or repeatedly distributing the matrix in space, resulting in additional delays and energy consumption, which contradicts the original intention of acceleration. Summary of the invention

[0004] The purpose of the present invention is to solve the problem that free-space optical computing is difficult to balance universality and parallelism, and to provide a parallel matrix-matrix multiplication optical computing method and system based on coherent light (single wavelength).

[0005] The purpose of the present invention can be achieved by the following technical solutions:

[0006] A parallel matrix-matrix multiplication optical computing method based on coherent light comprises the following steps:

[0007] S1, obtain two input matrices to be multiplied;

[0008] S2, modulate the input matrix to the coherent laser with amplitude, and modulate the linear phase with different change rates to the light field corresponding to each row of the first input matrix, and use the bosonic property of light to jointly and parallelly calculate the Hadamard product between each row of the first input matrix and each column of the second input matrix by light imaging and focusing in a mixed state, and realize parallel summation by light focusing;

[0009] S3, using the duality between the spatial linear phase change rate and the spatial position of the spectrum, separates and arranges the summation results from each row and each column in parallel to obtain the matrix multiplication calculation result.

[0010] The amplitude modulation specifically includes: mapping the elements in the input matrix to the coherent laser through amplitude modulation according to their sizes.

[0011] The phase modulation is specifically: modulating each row of the first input matrix using a linear phase with a different change rate, and the linear phase with a different change rate is expressed as (e j2πK(1)m ,e j2πK(2)m ,…,e j2πK(N)m ), where m represents the mth column, K(1), K(2), …, K(N) represent the different change rates corresponding to each row, and each element of the first input matrix after linear phase modulation is expressed as:

[0012]

[0013] Wherein, N represents the number of rows of the first input matrix, M represents the number of columns of the first input matrix, and a(n,m) represents the value of the light amplitude mapped to the matrix element value of the nth row and the mth column.

[0014] The method of using light imaging and focusing to jointly and parallelly calculate the Hadamard product between each row of the first input matrix and each column of the second input matrix in a mixed state, and realizing parallel summation through light focusing, specifically includes the following steps:

[0015] Performing row-direction imaging and column-direction focusing on the modulated first input matrix, and treating each row of the first input matrix as a coherent point light source with different intensities and uniform distribution at equal intervals;

[0016] Collimate the coherent point light source onto the transposed matrix surface of the modulated second input matrix to perform light field superposition of the two matrices;

[0017] The superimposed light field is focused in the row direction, the Hadamard product between each row of the first input matrix and each column of the second input matrix is ​​calculated, and the Hadamard products are summed in parallel.

[0018] According to the Huygens-Fresnel principle, the light field after propagation distance d is expressed as:

[0019]

[0020] Among them, U(x0,y0) is the original light field, stands for Fourier transform, f x , f y is the frequency domain coordinate, x0, y0 is the original light field coordinate; x, y are the light field coordinates after propagation, and λ is the wavelength of the coherent light.

[0021] In step S2, the first input matrix is ​​imaged in the row direction and propagated in the column direction by free diffraction. Each row is replicated multiple times in the column direction by diffusion, and then focused in the column dimension. The light fields are superimposed together, which is formally represented as the Fourier transform result of the original light field:

[0022]

[0023] Since the Fourier transform is a linear transform, the Fourier transform of the original light field is divided into the superposition of the diffraction effects of each pixel, that is, for the column direction, the N rows of the first input matrix are equivalent to N coherent point light sources with different intensities and uniformly distributed at equal intervals.

[0024] The light field distribution of each row obtained after the coherent point light source is collimated onto the transposed matrix surface of the modulated second input matrix is ​​a superposition of all the original rows,

[0025] The light field U(n,m) after the first input matrix collimation is expressed as:

[0026]

[0027] Then the first input matrix A(n,m) on the light field is converted to the mixing matrix:

[0028]

[0029] The mixing matrix is ​​amplitude modulated by the transposed matrix of the second input matrix, and this process is conceptualized as calculating the Hadamard product of each row of the first input matrix in parallel with all rows of the transposed matrix of the second input matrix and summing them, resulting in the dot product of each row of the first input matrix with all rows of the transposed matrix of the second input matrix.

[0030] In step S3, due to imaging in the column direction, the components of each row of the matrix maintain the original amplitude and phase relationship. Based on the row dimension focusing completed in step S2, according to the duality of different linear phases and different spatial positions of each row of the first input matrix, the dot product between the nth row of the first input matrix and different rows of the transposed matrix of the second input matrix is ​​naturally located at the nth position in the row dimension, forming the nth column of the multiplication matrix obtained by multiplying the first input matrix by the second input matrix.

[0031] A parallel matrix-matrix multiplication optical computing system based on coherent light, comprising:

[0032] An input module, used to obtain two input matrices to be multiplied;

[0033] A calculation module is used to modulate the input matrix onto the coherent laser with amplitude, and modulate the linear phase with different change rates onto the light field corresponding to each row of the first input matrix, and utilize the bosonic property of light to jointly and parallelly calculate the Hadamard product between each row of the first input matrix and each column of the second input matrix by light imaging and focusing in a mixed state, and realize parallel summation by light focusing;

[0034] The separation module is used for utilizing the duality between the spatial linear phase change rate and the spatial position of the spectrum to separate and arrange the summation results from each row and each column in parallel to obtain the matrix multiplication calculation result.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] The present invention realizes parallel light-speed matrix-matrix multiplication by combining phase, amplitude, and spatial position multiplexing, using coherent light single propagation as a carrier. At the same time, it has both general computing power and three-dimensional computing power, so that optical computing can better accelerate various computing tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 is a flow chart of the method of the present invention;

[0038] Figure 2 The schematic diagram of the coherent optical parallel matrix-matrix multiplication calculation method is shown in FIG.

[0039] Figure 3 Schematic diagram of the positional relationship after Fourier transformation of different linear phases in an embodiment. DETAILED DESCRIPTION

[0040] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0041] For a computer, the computational steps of matrix-matrix multiplication are decomposed into two sequential operations: first, the Hadamard product is calculated between each row of matrix A and each column of matrix B; then, the results of these Hadamard products are summed and assigned to the corresponding matrix positions. The present invention mainly utilizes the bosonic properties of light to simultaneously calculate the Hadamard products between each row and each column in a mixed state, and then achieves parallel summation through focusing. Thereafter, by utilizing the duality between the spatial linear phase change rate and the spatial position of the spectrum, the results from each row and each column can be separated and arranged in parallel.

[0042] Specifically, this embodiment provides a parallel matrix-matrix multiplication optical computing method based on coherent light, such as Figure 1 As shown, the following steps are included:

[0043] S1, obtain two input matrices to be multiplied, denoted as matrix A and matrix B respectively;

[0044] S2, modulate the input matrix to the coherent laser with amplitude, and modulate the linear phase with different change rates to the light field corresponding to each row of matrix A, and use the bosonic property of light to jointly and parallelly calculate the Hadamard product between each row of matrix A and each column of matrix B by light imaging and focusing in a mixed state, and realize parallel summation by light focusing;

[0045] S3, using the duality between the spatial linear phase change rate and the spatial position of the spectrum, separates and arranges the summation results from each row and each column in parallel to obtain the matrix multiplication calculation result.

[0046] like Figure 2 As shown, the upper part is a schematic diagram of light field propagation, and the lower part is a schematic diagram of matrix operation. In order to avoid excessive complexity, all imaging diagrams in the figure are made without inversion. T represents transpose, ⊙ represents Hadamard product, and (n,:) represents all elements in the nth row of the matrix.

[0047] First, both matrix A and matrix B are amplitude modulated, and are mapped to the coherent laser through amplitude modulation according to the size of the elements in the input matrix.

[0048] Then, each row of the matrix A is modulated by a linear phase with different change rates. The linear phase with different change rates is expressed as (e j2πK(1)m ,e j2πK(2)m ,…,e j2πK(N)m ), where m represents the mth column, K(1), K(2), …, K(N) represent the different change rates corresponding to each row, Figure 2Different colors represent the propagation process of different linear phases. The elements of matrix A after linear phase modulation are expressed as:

[0049]

[0050] Wherein, N represents the number of rows of the first input matrix, M represents the number of columns of the first input matrix, and a(n,m) represents the value of the light amplitude mapped to the matrix element value of the nth row and the mth column.

[0051] In a hybrid state, light imaging and focusing are used to jointly and parallelly calculate the Hadamard product between each row of matrix A and each column of matrix B, and parallel summation is achieved through light focusing, specifically including the following steps:

[0052] 1) Perform row-direction imaging and column-direction focusing on the modulated matrix A, and regard each row of the matrix A as a coherent point light source with different intensities and uniform distribution at equal intervals;

[0053] 2) Collimate the coherent point light source to the transposed matrix B of the modulated matrix B T On the surface, the light fields of the two matrices are superimposed;

[0054] 3) The superimposed light field is focused in the row direction, the Hadamard product between each row of matrix A and each column of matrix B is calculated, and the Hadamard products are summed in parallel.

[0055] According to the Huygens-Fresnel principle, the light field after propagation distance d is expressed as:

[0056]

[0057] Among them, U(x0,y0) is the original light field, stands for Fourier transform, f x , f y is the frequency domain coordinate, x0, y0 is the original light field coordinate; x, y are the light field coordinates after propagation, and λ is the wavelength of the coherent light.

[0058] By imaging the matrix A in the row direction and propagating it in the column direction with free diffraction, each row is replicated multiple times in the column direction through diffusion, and then focused in the column dimension. The light field is no longer diffused, but superimposed together, which is formally expressed as the Fourier transform result of the original light field:

[0059]

[0060] Since the Fourier transform is a linear transform, the Fourier transform of the original light field is divided into the superposition of the diffraction effects of each pixel. Therefore, for the column direction, the N rows of the matrix A are equivalent to N coherent point light sources with different intensities and uniform distribution at equal intervals.

[0061] The light field distribution of each row obtained after collimating the coherent point light source onto the transposed matrix surface of the modulated second input matrix is ​​the superposition of all the original rows, and due to imaging in the column direction, the components of each row of the matrix can still maintain the original amplitude (matrix value) and phase (linear phase) relationship.

[0062] The light field U(n,m) after collimation by matrix A is expressed as:

[0063]

[0064] Then the matrix A(n,m) on the light field is converted to the mixing matrix:

[0065]

[0066] The mixing matrix is ​​the transpose of matrix B T The amplitude modulation process is conceptualized as each row of matrix A is modulated by the matrix B. T The Hadamard product is calculated in parallel for all rows of A and summed. Focusing on the row dimension can achieve the summation of the Hadamard product results, thereby generating each row of matrix A and matrix B T Dot product of all rows.

[0067] After focusing on the row dimension, according to the duality of different linear phases and different spatial positions of each row of matrix A, the nth row of matrix A is related to matrix B T The dot products between different rows of are naturally located at the nth position in the row dimension, forming the nth column of the matrix AB, as Figure 3 As shown, at the same time, the column dimension imaging preserves the positional relationship in the column, so the result is the transpose of the matrix AB, that is, (AB) T .

[0068] This embodiment also provides a parallel matrix-matrix multiplication optical computing system based on coherent light, comprising:

[0069] An input module, used to obtain two input matrices to be multiplied;

[0070] A calculation module is used to modulate the input matrix onto the coherent laser with amplitude, and modulate the linear phase with different change rates onto the light field corresponding to each row of the first input matrix, and utilize the bosonic property of light to jointly and parallelly calculate the Hadamard product between each row of the first input matrix and each column of the second input matrix by light imaging and focusing in a mixed state, and realize parallel summation by light focusing;

[0071] The separation module is used for utilizing the duality between the spatial linear phase change rate and the spatial position of the spectrum to separate and arrange the summation results from each row and each column in parallel to obtain the matrix multiplication calculation result.

[0072] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0073] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning, or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. A parallel matrix-matrix multiplication optical computing method based on coherent light, characterized in that: The following steps are involved: S1, obtain two input matrices to be multiplied; S2, modulate the input matrix to the coherent laser with amplitude, and modulate the linear phase with different change rates to the light field corresponding to each row of the first input matrix, and use the bosonic property of light to jointly and parallelly calculate the Hadamard product between each row of the first input matrix and each column of the second input matrix by light imaging and focusing in a mixed state, and realize parallel summation by light focusing; S3, using the duality between the spatial linear phase change rate and the spatial position of the spectrum, separates and arranges the summation results from each row and each column in parallel to obtain the matrix multiplication calculation result.

2. The method of optical computing based on parallel matrix-matrix multiplication of coherent light according to claim 1, characterized in that: The amplitude modulation specifically includes: mapping the elements in the input matrix to the coherent laser through amplitude modulation according to their sizes.

3. The method of optical computing based on parallel matrix-matrix multiplication of coherent light according to claim 1, characterized in that: The phase modulation is specifically: modulating each row of the first input matrix using a linear phase with a different change rate, and the linear phase with a different change rate is expressed as (e j2πK(1)m ,e j2πK(2)m ,…,e j2πK(N)m ), where m represents the mth column, K(1), K(2), …, K(N) represent the different change rates corresponding to each row, and each element of the first input matrix after linear phase modulation is expressed as: Wherein, N represents the number of rows of the first input matrix, M represents the number of columns of the first input matrix, and a(n,m) represents the value of the light amplitude mapped to the matrix element value of the nth row and the mth column.

4. The method of optical computing based on parallel matrix-matrix multiplication of coherent light according to claim 1, characterized in that: The method of using light imaging and focusing to jointly and parallelly calculate the Hadamard product between each row of the first input matrix and each column of the second input matrix in a mixed state, and realizing parallel summation through light focusing, specifically includes the following steps: Performing row-direction imaging and column-direction focusing on the modulated first input matrix, and treating each row of the first input matrix as a coherent point light source with different intensities and uniform distribution at equal intervals; Collimate the coherent point light source onto the transposed matrix surface of the modulated second input matrix to perform light field superposition of the two matrices; The superimposed light field is focused in the row direction, the Hadamard product between each row of the first input matrix and each column of the second input matrix is ​​calculated, and the Hadamard products are summed in parallel.

5. The method of optical computing based on parallel matrix-matrix multiplication of coherent light according to claim 4, characterized in that: According to the Huygens-Fresnel principle, the light field after propagation distance d is expressed as: Among them, U(x0,y0) is the original light field, stands for Fourier transform, f x , f y is the frequency domain coordinate, x0, y0 is the original light field coordinate; x, y are the light field coordinates after propagation, and λ is the wavelength of the coherent light.

6. The method of optical computing based on parallel matrix-matrix multiplication of coherent light according to claim 5, characterized in that: In step S2, the first input matrix is ​​imaged in the row direction and propagated in the column direction by free diffraction. Each row is replicated multiple times in the column direction by diffusion, and then focused in the column dimension. The light fields are superimposed together, which is formally represented as the Fourier transform result of the original light field: Since the Fourier transform is a linear transform, the Fourier transform of the original light field is divided into the superposition of the diffraction effects of each pixel, that is, for the column direction, the N rows of the first input matrix are equivalent to N coherent point light sources with different intensities and uniformly distributed at equal intervals.

7. The method of optical computing based on parallel matrix-matrix multiplication of coherent light according to claim 3, characterized in that: The light field distribution of each row obtained after the coherent point light source is collimated onto the transposed matrix surface of the modulated second input matrix is ​​a superposition of all the original rows, The light field U(n,m) after the first input matrix collimation is expressed as: Then the first input matrix A(n,m) on the light field is converted to the mixing matrix:

8. The method of optical computing based on parallel matrix-matrix multiplication of coherent light according to claim 7, characterized in that: The mixing matrix is ​​amplitude modulated by the transposed matrix of the second input matrix, and this process is conceptualized as calculating the Hadamard product of each row of the first input matrix in parallel with all rows of the transposed matrix of the second input matrix and summing them, resulting in the dot product of each row of the first input matrix with all rows of the transposed matrix of the second input matrix.

9. The method of optical computing based on parallel matrix-matrix multiplication of coherent light according to claim 4, characterized in that: In step S3, due to imaging in the column direction, the components of each row of the matrix maintain the original amplitude and phase relationship. Based on the row dimension focusing completed in step S2, according to the duality of different linear phases and different spatial positions of each row of the first input matrix, the dot product between the nth row of the first input matrix and different rows of the transposed matrix of the second input matrix is ​​naturally located at the nth position in the row dimension, forming the nth column of the multiplication matrix obtained by multiplying the first input matrix by the second input matrix.

10. A parallel matrix-matrix multiplication optical computing system based on coherent light, characterized in that: include: An input module, used to obtain two input matrices to be multiplied; A calculation module is used to modulate the input matrix onto the coherent laser with amplitude, and modulate the linear phase with different change rates onto the light field corresponding to each row of the first input matrix, and utilize the bosonic property of light to jointly and parallelly calculate the Hadamard product between each row of the first input matrix and each column of the second input matrix by light imaging and focusing in a mixed state, and realize parallel summation by light focusing; The separation module is used for utilizing the duality between the spatial linear phase change rate and the spatial position of the spectrum to separate and arrange the summation results from each row and each column in parallel to obtain the matrix multiplication calculation result.