Block-feed computation method and apparatus for quantum fully connected approximation

By dividing the coupling matrix into M×M sub-blocks, assigning strongly coupled pairs to the same sub-block, and combining this with a dynamic repartitioning mechanism, the problem of error accumulation in the Ising machine is solved, achieving high-precision and low-latency computational results.

CN123068752APending Publication Date: 2026-11-10BEIJING QBOSON QUANTUM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611222078.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-12
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

In existing Ising machine feedback loops, the fixed segmentation of the coupling matrix leads to a continuous increase in error, reducing the optimization effect.

Method used

The coupling matrix is ​​divided into M×M sub-blocks. Strongly coupled pairs are assigned to the same sub-block. Full matrix-vector multiplication is performed on diagonal sub-blocks, while sparse matrix-vector multiplication is performed on off-diagonal sub-blocks, retaining the strongly coupled terms. Combined with a dynamic repartitioning mechanism, the sub-block configuration is updated periodically.

Benefits of technology

It improves the accuracy of Ising machine calculations, reduces computational latency, balances high precision and low latency, and enhances iterative calculation speed and hardware resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123068752A_ABST
    Figure CN123068752A_ABST
Patent Text Reader

Abstract

This invention provides a block-feedback computation method and apparatus for the quantum fully connected approximation. The method includes: dividing an N×N coupling matrix J corresponding to N spin variables into M×M sub-blocks, each sub-block having B rows and columns; performing complete matrix-vector multiplication calculations on each of the M diagonal sub-blocks to obtain the local field components within each sub-block; retaining only coupling terms whose absolute coupling strength exceeds a threshold θ, and performing sparse matrix-vector multiplication calculations based on the retained coupling terms; updating all spin variables according to the feedback signal to complete one round of iterative solution; and re-dividing the coupling matrix into sub-blocks and updating the sub-block configuration after each preset iteration interval. This invention solves the problem that fixing the coupling matrix into blocks leads to a continuous increase in error, thus reducing the optimization effect of the Ising machine, and achieves the effect of dynamically adjusting the blocks to improve the computational accuracy of the Ising machine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of quantum computing technology, and in particular to a block feedback computing method and apparatus based on the quantum fully connected approximation. Background Technology

[0002] The Ising Machine is a dedicated computational architecture for solving combinatorial optimization problems. Its core working principle is as follows: Each spin variable is coupled through a coupling matrix. ( The system interacts with symmetric matrices, and through iterative evolution, searches for the Ising Hamiltonian. Minimize the spin configuration. In each iteration, the feedback computation module needs to perform matrix-vector multiplication:

[0003] in For the first The measurement result of each spin. The computational complexity is O(n). When the spin number When it is large (e.g.) Computational latency has become the main bottleneck for system performance.

[0004] The following solutions exist in relevant technologies to address this problem: 1. NTT Coherent Ising Machine Solution: In a 2016 Science paper, the NTT team implemented a 2000-spin CIM using an FPGA for fully connected feedback computation. However, as the number of spins increased to the 100,000 level (in 2021), the latency of fully connected computation increased dramatically, requiring the adoption of strategies such as time-sharing multiplexing, which sacrificed real-time performance.

[0005] 2. Sparse matrix method: Some works will couple the matrix Restricting it to a sparse matrix (retaining only some non-zero elements) can reduce computational complexity to ( (This is the average number of non-zero elements), but this is a limitation of the problem itself and cannot handle densely coupled optimization problems.

[0006] 3. GPU Acceleration Solution: While using GPUs for matrix multiplication offers high throughput, the latency is insufficient to meet the real-time requirements of the Ising machine feedback loop (which typically requires...). GPU PCIe communication latency ( ) and kernel boot overhead ( This further exacerbated the overall delay.

[0007] 4. Existing FPGA Implementation: A team implemented it in 2024. Single-FPGA full-precision CIM simulation, but the latency of fully connected computation still increases. Growth, further expanded It faces the dual constraints of resources and latency.

[0008] In other words, none of the related technologies can maintain the computational accuracy of near-fully connected systems while reducing computational complexity. A method that significantly reduces performance, and this method needs to be adapted to the FPGA hardware architecture to meet the real-time requirements of the Ising machine feedback loop.

[0009] In existing Ising machine feedback loops, in order to solve the computational delay problem, although the coupling matrix can be divided into blocks or the spins can be clustered according to the initial coupling strength, the block division scheme remains unchanged throughout the iterative solution process. The newly formed strongly coupled spin pairs during the spin iteration process will be dispersed into off-diagonal sub-blocks and sparsely discarded, resulting in continuous accumulation of errors and reducing the optimization effect of the Ising machine.

[0010] It can be seen that the related technology has the problem that fixing the coupling matrix into blocks leads to a continuous increase in error, thus reducing the optimization effect of the Ising machine.

[0011] There is currently no effective solution to the aforementioned problems in the relevant technologies. Summary of the Invention

[0012] This invention provides a block feedback calculation method and apparatus for quantum fully connected approximation, which at least solves the problem in related technologies where fixing the coupling matrix in blocks leads to a continuous increase in error, thereby reducing the optimization effect of the Ising machine.

[0013] According to an embodiment of the present invention, a block-based feedback calculation method for quantum fully connected approximation is provided for multiplication calculation of coupling matrix and spin vector in Ising machine feedback loop, comprising: S1: dividing the N×N coupling matrix J corresponding to N spin variables into M×M sub-blocks, each sub-block having B rows and columns, where M=N / B, and M, N, and B are all integers greater than 1. When dividing the coupling matrix, spin pairs with an absolute coupling strength greater than a preset threshold are assigned to the same sub-block; S2: performing a complete matrix-vector multiplication calculation on each of the M diagonal sub-blocks to obtain the local field components within each diagonal sub-block; S3: for coupling terms in off-diagonal sub-blocks, only retaining those with an absolute coupling strength exceeding the threshold θ. S2: The coupling terms are obtained, and sparse matrix-vector multiplication is performed based on the retained coupling terms to obtain the local field components between sub-blocks; S4: The local field components within the sub-blocks and the local field components between the sub-blocks are summed according to the spin index to obtain the feedback signal corresponding to each spin; S5: All spin variables are updated according to the feedback signal to complete one round of iterative solution; S6: Steps S2 to S5 are executed repeatedly to complete multiple rounds of iteration. After each preset iteration interval, the coupling matrix is ​​re-divided into sub-blocks using the same block size and partitioning algorithm as in step S1, and the sub-block configuration is updated.

[0014] Furthermore, dividing the N×N coupling matrix J corresponding to the N spin variables into M×M sub-blocks includes: constructing sub-blocks based on the absolute value of the coupling strength. The weighted graph is defined by edge weights. The K-way balanced graph partitioning algorithm is applied to the weighted graph to divide the N nodes representing spin variables into M node clusters with a balanced number of nodes, resulting in M×M sub-blocks. The partitioning optimization objective is to minimize the sum of the absolute values ​​of the weights of the coupling edges between clusters.

[0015] Furthermore, retaining coupling terms whose absolute coupling strength exceeds the threshold θ includes: for each off-diagonal sub-block, calculating the empirical cumulative distribution function F(x) of the absolute values ​​of all coupling terms in the current off-diagonal sub-block; setting a retention ratio parameter ρ, where 0 < ρ < 1; and solving for F(θ) = 1. The threshold θ of ρ is used to filter the coupling terms, retaining only those coupling terms whose absolute value of coupling strength is greater than θ and are in the first ρ quantile, and discarding the remaining weak coupling terms.

[0016] Furthermore, the triggering condition for re-partitioning the coupling matrix includes: defining a consistency index within each sub-block obtained after partitioning at the current iteration time t, used to characterize the overall strength of the coupling correlation among all spin variables within the k-th sub-block; the larger the value of the consistency index, the stronger the spin coupling correlation within the corresponding sub-block; calculating the arithmetic mean of the consistency indices of all sub-blocks or the weighted sum of the sizes of each sub-block to obtain the global consistency index I. global (t); when any iteration time t satisfies I global (t)≤α When I0, the coupling matrix is ​​re-partitioned into sub-blocks, where α is a preset re-partitioning sensitivity parameter, 0 < α < 1, and I0 is the initial global consistency index corresponding to the initial completion of sub-block partitioning.

[0017] Furthermore, for each sub-block The internal consistency index is calculated using the following method: ,in, Indicates that recently The average value of the spin state in each iteration. To adjust the sliding window size, , For the first The set of spin indices corresponding to each sub-block, σ i σ j These are the i-th and j-th spin variables, respectively.

[0018] Furthermore, the coupling matrix is ​​re-partitioned into sub-blocks, and the sub-block configuration is updated by using the spin correlation matrix under the current iteration. Replacement of original coupling strength |J ij | serves as the edge weight benchmark for graph partitioning; each spin variable is used as an independent node in the weighted graph, and the weight of the edge connecting node i and node j is |Cij|, completing the weighted graph reconstruction; the METIS multi-way balanced graph partitioning algorithm is executed on the reconstructed weighted graph, with the partitioning constraint: all nodes are divided into M node clusters of balanced node size, and the optimization objective is to minimize the sum of the weights of the edges connecting different clusters; each node cluster corresponds one-to-one with the spin sub-blocks after the coupling matrix partitioning, and an updated sub-block configuration is generated based on the node cluster allocation relationship obtained from the partitioning; based on the updated sub-block configuration, a sparse index table between sub-blocks adapted for sparse matrix-vector multiplication operations is reconstructed, where the matrix elements of the spin correlation matrix satisfy... , σ i σ j These are the i-th and j-th spin variables, respectively.

[0019] Furthermore, the preset iteration interval is determined in the following way: the change ratio of the sub-block number of each rotation in the results of two consecutive re-executions of sub-block partitioning is obtained to obtain the partition change rate; if the partition change rate corresponding to L consecutive re-partitioning operations is less than the preset lower limit δlow, the preset iteration interval is doubled; if the partition change rate corresponding to a single re-partitioning operation is greater than the preset upper limit δhigh, the preset iteration interval is halved; where L is the preset number of consecutive judgments, 0 < δlow < δhigh < 1, and δlow, δhigh, and L are all pre-configured by the type of the Ising problem to be solved.

[0020] Furthermore, the value of B for the number of rows and columns of the sub-block opt Determined by the following formula: Among them, B min To meet the minimum sub-block size that satisfies the preset maximum approximation error constraint, This represents the floor function; the total computation delay function is: In the formula, P is the number of parallel computing units, and t mac T is the time taken for a single multiplication-accumulation operation. intra The computational delay for complete dense computation within a sub-block monotonically increases with increasing block size B; T inter Calculate the delay for the sparse coupling term between sub-blocks.

[0021] According to another embodiment of the present invention, a block feedback computing device for quantum fully connected approximation is provided for performing multiplication calculations of coupling matrix and spin vector in Ising machine feedback loop, comprising: a partitioning unit for performing S1: dividing an N×N coupling matrix J corresponding to N spin variables into M×M sub-blocks, each sub-block having B rows and columns, where M=N / B, and M, N, and B are all integers greater than 1; when partitioning the coupling matrix, spin pairs with an absolute coupling strength greater than a preset threshold are assigned to the same sub-block; a computing unit for performing S2: performing complete matrix-vector multiplication calculations on each of the M diagonal sub-blocks to obtain the local field components within each diagonal sub-block; and a multiplication unit for performing S3: for coupling terms in off-diagonal sub-blocks, only retaining those with an absolute coupling strength exceeding a threshold θ. The coupling terms are processed, and sparse matrix-vector multiplication is performed based on the retained coupling terms to obtain the local field components between sub-blocks; the summation unit is used to perform S4: sum the local field components within the sub-blocks and the local field components between the sub-blocks according to the spin index to obtain the feedback signal corresponding to each spin; the solution unit is used to perform S5: update all spin variables according to the feedback signal to complete one round of iterative solution; the update unit is used to perform S6: repeatedly execute steps S2 to S5 to complete multiple rounds of iteration, and after each preset iteration interval, the coupling matrix is ​​re-divided into sub-blocks using the same block size and partitioning algorithm as in step S1, and the sub-block configuration is updated.

[0022] According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.

[0023] According to yet another embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0024] Through this invention, S1: Divide the N×N coupling matrix J corresponding to N spin variables into M×M sub-blocks, where each sub-block has B rows and columns, where M=N / B, and M, N, and B are all integers greater than 1. When dividing the coupling matrix, spin pairs with an absolute coupling strength greater than a preset threshold are assigned to the same sub-block; S2: Perform a complete matrix-vector multiplication calculation on each of the M diagonal sub-blocks to obtain the local field components within each diagonal sub-block; S3: For coupling terms in the off-diagonal sub-blocks, retain only those with an absolute coupling strength exceeding the threshold θ, and perform sparse matrix-vector multiplication calculation based on the retained coupling terms to obtain the local field components between sub-blocks; S4: Summate the local field components within the sub-blocks and the local field components between sub-blocks according to the spin index to obtain the feedback signal corresponding to each spin; S5: Update all spin variables according to the feedback signal to complete one round of iterative solution; S6: Repeat steps S2 to S5. After multiple iterations, at each preset iteration interval, the coupling matrix is ​​re-partitioned using the same block size and partitioning algorithm as in step S1, and the sub-block configuration is updated. Therefore, this solves the problem in related technologies where a fixed block partitioning of the coupling matrix leads to continuously increasing errors and thus reduces the optimization effect of the Ising machine, achieving the effect of dynamically adjusting the block partitioning to improve the computational accuracy of the Ising machine. Attached Figure Description

[0025] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other embodiments based on these drawings without creative effort.

[0026] Figure 1 This is a hardware structure block diagram of a mobile terminal for a block feedback computation method based on quantum fully connected approximation according to an embodiment of the present invention. Figure 2 This is a flowchart of a block feedback computation method for quantum fully connected approximation according to an embodiment of the present invention; Figure 3 This is the overall flowchart of the block feedback calculation method in this embodiment; Figure 4 yes Coupling matrix A schematic diagram of the block structure; Figure 5 This is a diagram of the internal architecture of the parallel computing unit (PE). Figure 6 This is a flowchart of the dynamic repartitioning mechanism; Figure 7This is a top-level architecture diagram based on FPGA implementation; Figure 8 This is a structural block diagram of a block feedback computing device based on the quantum fully connected approximation according to an embodiment of the present invention. Detailed Implementation

[0027] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0029] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a block feedback computation method based on a quantum fully connected approximation according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more (only one is shown in the figure) processors 102 (processor 102 may include, but is not limited to, processing devices such as microprocessors (MCUs) or programmable logic devices (FPGAs)) and a memory 104 for storing data. The mobile terminal may also include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0030] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the block feedback computation method of the quantum fully connected approximation in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0031] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0032] This embodiment provides a block feedback computation method based on the quantum fully connected approximation. Figure 2 This is a flowchart of a block feedback computation method for the quantum fully connected approximation according to an embodiment of the present invention, as shown below. Figure 2 As shown, the process includes the following steps: Step S1: Divide the N×N coupling matrix J corresponding to the N spin variables into M×M sub-blocks. The number of rows and columns of each sub-block is B, where M=N / B, and M, N, and B are all integers greater than 1. When dividing the coupling matrix, spin pairs with an absolute value of coupling strength greater than a preset threshold are assigned to the same sub-block. The technical solution of this embodiment can be applied to the multiplication calculation of coupling matrix and spin vector in the feedback loop of Ising machine (including coherent Ising machine CIM, NV color center Ising machine, etc.). For the Ising machine containing N×N dimension coupling matrix J corresponding to N spin variables, the coupling matrix is ​​uniformly divided into M×M sub-block matrices. The number of rows and columns of each sub-block is B, which satisfies the block constraint relationship M=N / B. M, N, and B are all integers greater than 1, and N is divisible by B, ensuring that all sub-blocks are of balanced size and have consistent computational load.

[0033] During matrix partitioning, clustering optimization is achieved based on the physical characteristics of coupling strength: spin pairs with an absolute coupling strength greater than a preset threshold are preferentially assigned to the same sub-block. Since the correlation between strongly coupled spin pairs has the greatest impact on spin state updates and local field calculation results, grouping them into the same sub-block ensures that core strongly coupled relationships are included in subsequent accurate calculations, reducing the accuracy loss caused by approximate calculations from the source.

[0034] Step S2: Perform a complete matrix-vector multiplication calculation on each of the M diagonal sub-blocks to obtain the local field components within each sub-block; The complete matrix-vector multiplication calculation is performed on each of the M diagonal sub-blocks obtained by partitioning. The diagonal sub-blocks contain all the internal coupling relationships of the same set of spins, which are the core coupling terms that determine the local spin field values ​​and the iterative update of the spin state. Therefore, in this embodiment, no sparse truncation is performed on the diagonal sub-blocks. All coupling relationships are retained for accurate dense calculation, and the local field components within each sub-block are completely obtained, ensuring that the core coupling information is not lost and there is no approximation error.

[0035] Step S3: For coupling terms in off-diagonal sub-blocks, only retain coupling terms whose absolute value of coupling strength exceeds the threshold θ, and perform sparse matrix-vector multiplication calculation based on the retained coupling terms to obtain the local field components between sub-blocks; Off-diagonal sub-blocks correspond to cross-cluster coupling relationships between different sub-block clusters, exhibiting numerous weak coupling terms with negligible impact on spin states. Full computation of these terms would incur significant unnecessary computational overhead. Therefore, an adaptive threshold filtering method is applied to all off-diagonal sub-block coupling terms, retaining only valid strong coupling terms with absolute coupling strength exceeding a preset threshold θ, while discarding other low-weight weak coupling terms. A sparse computation matrix is ​​constructed based on the retained valid coupling terms, and sparse matrix-vector multiplication is performed to quickly obtain the local field components between sub-blocks corresponding to each off-diagonal sub-block. This sparse approximation significantly reduces the computational cost of cross-block couplings and compresses the hardware computation latency of a single iteration.

[0036] Step S4: Sum the local field components within the sub-block and the local field components between sub-blocks according to the spin index to obtain the feedback signal corresponding to each spin; After obtaining the precisely calculated local field components within the sub-block and the sparsely approximated local field components between sub-blocks, the components are summed item by item according to the unique index dimension of each spin variable. The result is a complete feedback signal corresponding to each spin variable. This feedback signal integrates the precise information of strong coupling within the spin and the approximate information of effective coupling across the spin, comprehensively characterizing the spin force coupling state in the current iteration state.

[0037] Step S5: Update all spin variables based on the feedback signal to complete one round of iterative solution; The state of all spin variables in the Ising machine system is updated synchronously to complete a complete iterative solution process, realize the iterative evolution of spin states, and promote the optimization convergence process of combinatorial optimization problems.

[0038] Step S6: Repeat steps S2 to S5 to complete multiple iterations. After each preset iteration interval, re-partition the coupling matrix using the same block size and partitioning algorithm as in step S1, and update the sub-block configuration.

[0039] Steps S2 to S5 are executed iteratively to continuously complete multiple rounds of spin iteration updates, achieving continuous convergence of the optimization process. Simultaneously, a periodic dynamic repartitioning mechanism is set up. After each preset iteration interval, the original coupling matrix is ​​repartitioned using the same block size and partitioning algorithm as in step S1, updating the global sub-block configuration.

[0040] During the iteration process, the associated states of spins continuously change with each iteration. A fixed sub-block configuration gradually leads to problems such as strongly coupled spins being scattered across blocks and weakly coupled spins clustering together, resulting in a continuous accumulation of approximation errors and a decrease in computational efficiency. This step periodically replicates the initial optimal partitioning logic, refreshes the sub-block spin grouping structure, and regroups real-time strongly coupled spins into the same sub-block, continuously ensuring the rationality of accurate and sparse approximation calculations and suppressing the accumulation of iteration errors.

[0041] The technical solution of this embodiment can be applied to the block feedback computation of quantum fully connected approximation. It can balance high precision and low latency, achieve precise reduction of computing power, and adopt a hybrid computing architecture of "full accurate computation of diagonal blocks + sparse approximation computation of off-diagonal blocks". The core strong coupling relationship has no precision loss, and the redundant weak coupling computation is greatly reduced. While retaining the key iterative convergence information, the complexity of traditional O(N²) full computation is greatly reduced, the iteration computation speed of Ising machine is significantly improved, and the computing power and power consumption of hardware platforms such as FPGA and ASIC are reduced.

[0042] By using a periodic dynamic repartitioning mechanism, the dynamic changes in spin coupling correlation during the iteration process are adapted, and the sub-block grouping structure is refreshed periodically. This avoids the problems of core coupling information truncation and continuous accumulation of approximation errors caused by long-term fixed block division, thus continuously ensuring the stability and effectiveness of iterative calculation. It has good load balancing and can give full play to the computing power advantages of multiple parallel computing units, thereby significantly improving the optimization iteration efficiency of large-scale spin Ising systems.

[0043] In this embodiment, the triggering methods for re-dividing the coupling matrix into sub-blocks include timed triggering and conditional triggering. Timed triggering is triggered every preset iteration interval; conditional triggering is triggered immediately when a condition is met.

[0044] In an optional implementation, dividing the N×N coupling matrix J corresponding to the N spin variables into M×M sub-blocks includes: constructing a matrix J with the absolute value of the coupling strength... Given a weighted graph with edge weights, the K-way balanced graph partitioning algorithm is applied to the weighted graph to divide the N nodes representing spin variables into M node clusters with a balanced number of nodes, resulting in M×M sub-blocks. The partitioning optimization objective is to minimize the sum of the absolute values ​​of the weights of the coupling edges between clusters.

[0045] For the coupling matrix partitioning process in the basic steps, a K-way multi-path balanced graph partitioning algorithm based on coupling strength weights is used to achieve optimal clustering partitioning. Specifically, each spin variable is abstracted as an independent node in the graph network, and the absolute value of the coupling strength between any two spin nodes |J| is used as the weight. ij | As the weight of the edges connecting the nodes, a complete weighted undirected graph is constructed; then the K-way balanced graph partitioning algorithm is performed on the weighted graph to divide all N spin nodes into M node clusters with a balanced number of nodes, and finally the M×M structure of the coupling matrix sub-block is mapped.

[0046] The optimization objective of this scheme is to minimize the sum of the absolute weights of all cross-sub-block and cross-cluster coupling edges, and to retain the spin pairs with the strongest global coupling strength within the same sub-block to the greatest extent possible, thereby minimizing the loss of strong coupling information across blocks. Compared to simple sequential or fixed-block partitioning methods, this graph partitioning strategy is based on physical coupling relationships to achieve intelligent clustering and grouping of spins.

[0047] The sub-block grouping structure is optimized from a global perspective to maximize the preservation of strongly coupled core information within sub-blocks and minimize the inherent accuracy loss caused by approximate calculations. At the same time, the number of nodes in each sub-block is balanced to adapt to the hardware parallel computing architecture and avoid problems such as single-block computing power overload and load imbalance, laying the foundation for subsequent high-precision and high-parallelity iterative calculations.

[0048] In an optional implementation, retaining coupling terms whose absolute coupling strength exceeds a threshold θ includes: for each off-diagonal sub-block, calculating the empirical cumulative distribution function F(x) of the absolute values ​​of all coupling terms in the current off-diagonal sub-block; setting a retention ratio parameter ρ, where 0 < ρ < 1; and solving for F(θ) = 1. The threshold θ of ρ is used to filter the coupling terms, retaining only those coupling terms whose absolute value of coupling strength is greater than θ and are in the first ρ quantile, and discarding the remaining weak coupling terms.

[0049] For the coupling term selection process of off-diagonal sub-blocks in the basic steps, a data-adaptive threshold solution method is adopted to replace the fixed manual threshold, achieving refined sparse pruning. Specifically: for each off-diagonal sub-block, the distribution characteristics of the absolute values ​​of all coupling terms within the sub-block are statistically analyzed, and an empirical cumulative distribution function F(x) for the absolute values ​​of coupling terms is constructed; a coupling retention ratio parameter ρ in the interval of 0 to 1 is pre-configured to represent the proportion of strongly coupled terms that need to be retained; and the cumulative distribution function is used to solve for F(θ) = 1. The critical threshold θ of ρ.

[0050] During the screening process, only coupling terms with an absolute value greater than the critical threshold θ are retained, i.e., the strongly coupled terms in the top ρ quantile of the global ranking are retained, and the remaining terms with a percentage of 1 are automatically discarded. The weakly coupled redundant term of ρ. This method can adaptively generate differentiated screening thresholds based on the differences in coupling distribution among different sub-blocks and different problem scenarios.

[0051] This implementation overcomes the shortcomings of fixed thresholds in adapting to different matrices and different iteration states, and achieves adaptive sparse pruning. Under the premise of uniform computing power, it maximizes the retention of effective coupling information and eliminates invalid and redundant calculations, accurately balances the acceleration benefits and accuracy losses of sparse computing, and greatly improves the adaptability and versatility of the algorithm for various optimization problems.

[0052] In an optional implementation, the triggering condition for re-partitioning the coupling matrix includes: defining a consistency index within each sub-block obtained after partitioning at the current iteration time t, used to characterize the overall strength of the coupling correlation among all spin variables within the k-th sub-block; the larger the consistency index value, the stronger the spin coupling correlation within the corresponding sub-block; calculating the arithmetic mean of the consistency indices of all sub-blocks or the weighted sum of the sizes of each sub-block to obtain the global consistency index I. global (t); when any iteration time t satisfies I global (t)≤α At I0, the coupling matrix is ​​re-partitioned into sub-blocks, where α is a preset repartition sensitivity parameter, 0 < α < 1, and I0 is the initial global consistency index corresponding to the initial sub-block partitioning.

[0053] Building upon the basic periodic repartitioning fallback mechanism, a dynamic triggering mechanism based on the degree of spin correlation decay is added to achieve on-demand repartitioning. Specifically, an internal consistency index is defined for each sub-block at each iteration time t to quantify the overall coupling strength of the spin group within the sub-block. The higher the index value, the stronger the spin correlation within the sub-block and the better the effectiveness of the current block structure.

[0054] Based on the internal consistency metrics of all sub-blocks, the global consistency metric I is calculated using either the arithmetic mean or a weighted summation of sub-block sizes.global (t), representing the effectiveness of the global block structure; recording the initial global consistency index I0 when the first block is completed, and setting a repartition sensitivity parameter α between 0 and 1. At any iteration time, once I is detected... global (t)≤α I0 indicates that the global spin correlation has significantly decreased and the original block structure has failed, immediately triggering a coupling matrix repartitioning operation. I0 can be calculated by obtaining the initial I0 after the initial W iterations, or by using the statistics of the initial coupling strength as the initial consistency index.

[0055] This implementation breaks away from the mechanical nature of fixed-period repartitioning, enabling "on-demand triggering and timely updates." It repartitions in advance when spin correlations change rapidly, avoiding continuous error accumulation in the failed block structure during multiple iterations. When the spin state is stable, frequent repartitioning is unnecessary, reducing ineffective reconstruction overhead and balancing iteration accuracy with computational resource utilization.

[0056] In an optional implementation, for each sub-block The internal consistency index is calculated using the following method: ,in, Indicates that recently The average value of the spin state in each iteration. To adjust the sliding window size, , For the first The set of spin indices corresponding to each sub-block, σ i σ j These are the i-th and j-th spin variables, respectively.

[0057] It provides a precise and quantifiable method for calculating the consistency index within sub-blocks, offering a reliable numerical basis for triggering dynamic repartitioning. Among these, The total number of spins within the sub-block; · This metric represents the average spin state time based on the most recent W iterations. The sliding window W ranges from 10 to 50 to ensure smooth and stable statistical results without abrupt changes. Essentially, this metric is a normalized statistical representation of the spin co-correlation strength within a sub-block, accurately reflecting the degree of cluster correlation among spins within that sub-block. It enables quantifiable, monitorable, and determinable block effectiveness, avoiding the subjectivity and lag of traditional experience-based repartitioning. The sliding window averaging design effectively suppresses iteration noise interference, improving the accuracy and stability of repartitioning triggers, and ensuring the smoothness of iteration convergence from a mechanistic perspective.

[0058] In an optional implementation, the coupling matrix is ​​re-partitioned, and the sub-block configuration is updated by: using the spin correlation matrix under the current iteration. Replacement of original coupling strength |J ij | serves as the baseline for edge weights in graph partitioning; each spin variable is used as an independent node in the weighted graph, and the weight of the edge connecting node i and node j is |C. ij | Complete the weighted graph reconstruction; execute the METIS multi-path balanced graph partitioning algorithm on the reconstructed weighted graph, with the partitioning constraint: divide all nodes into M node clusters of balanced size, and the optimization objective is to minimize the sum of the weights of the connecting edges between different clusters; each node cluster corresponds one-to-one with the spin sub-blocks after the coupling matrix partitioning, and an updated sub-block configuration is generated based on the node cluster allocation relationship obtained from the partitioning; based on the updated sub-block configuration, reconstruct the sparse index table between sub-blocks adapted for sparse matrix-vector multiplication operations, where the matrix elements of the spin correlation matrix satisfy... , σ i σ j These are the i-th and j-th spin variables, respectively.

[0059] After the repartitioning operation is triggered, the fixed original coupling weights are discarded, and iterative real-time spin correlation is used to complete the block reconstruction, realizing the dynamic adaptation of the block structure to the spin state. Specifically, a real-time spin correlation matrix is ​​constructed. , replacing the static original coupling strength |J ij | As the basis for edge weights in graph partitioning, the matrix elements satisfy... It accurately characterizes the real-time correlation strength between any two spins during the iteration process.

[0060] In this embodiment, each spin is considered an independent node, and |C| is used as the unit of rotation. ij | Reconstructs a weighted graph based on the node edge weights, executes the METIS multi-path balanced graph partitioning algorithm, with the constraint of obtaining M balanced node clusters, and the optimization objective of minimizing the sum of weights between clusters. A new sub-block configuration is generated based on the node cluster affiliation, and a sparse index table between sub-blocks adapted for sparse multiplication calculations is simultaneously reconstructed to provide data support for subsequent iterative calculations. This approach overcomes the limitations of traditional fixed-coupling weighted block partitioning, ensuring that the block structure always conforms to the real-time spin correlation distribution during iteration. After reconstructing the spin coupling relationship in the later stages of iteration, newly generated strongly correlated spins can be quickly aggregated into the same sub-block, maximizing the proportion of accurate calculations and suppressing approximation errors, significantly improving the optimization accuracy and convergence success rate in complex iterative scenarios.

[0061] In an optional implementation, the preset iteration interval is determined as follows: the change ratio of the sub-block number of each rotation in the results of two consecutive re-executions of sub-block partitioning is obtained to obtain the partition change rate; if the partition change rate corresponding to L consecutive re-partitioning operations is less than the preset lower limit δlow, the preset iteration interval is doubled; if the partition change rate corresponding to a single re-partitioning operation is greater than the preset upper limit δhigh, the preset iteration interval is halved; where L is the preset number of consecutive judgments, 0 < δlow < δhigh < 1, and δlow, δhigh, and L are all pre-configured by the type of the Ising problem to be solved.

[0062] Intelligent adaptive adjustment of the repartitioning iteration interval is achieved to adapt to state changes at different stages of the iteration. Specifically, the partition change rate is defined to quantitatively represent the proportion of change in the sub-block number of the spin after two adjacent repartitions, reflecting the drastic change in the current spin cluster structure.

[0063] The system predetermines the number of consecutive decision cycles L, the lower limit of the rate of change δlow, and the upper limit of the rate of change δhigh, satisfying 0 < δlow < δhigh < 1. If the rate of change of each partition in L consecutive repartitions is less than δlow, it indicates that the spin structure is stable and frequent repartitioning is unnecessary; therefore, the predetermined iteration interval is doubled to save computational resources. If the rate of change of a single repartition is greater than δhigh, it indicates that the spin structure is undergoing drastic evolution and the partitions are failing rapidly; therefore, the iteration interval is halved to increase the update frequency. L, δlow, and δhigh can all be pre-configured according to the type of Ising problem to be solved.

[0064] This embodiment can achieve adaptive adaptation of the repartition frequency, which is "sparse when stable and dense when changing". During the stable iteration phase, it reduces the redundant overhead of repartitioning and index reconstruction, thereby improving the calculation speed. During the drastic iteration, it increases the update frequency, corrects the block error in time, and further balances the global calculation overhead and iteration accuracy.

[0065] In an optional implementation, the value of B for the number of rows and columns of the sub-block is... opt Determined by the following formula: Among them, B min To meet the minimum sub-block size that satisfies the preset maximum approximation error constraint, This represents the floor function; the total computation delay function is: In the formula, P is the number of parallel computing units, and t mac T is the time taken for a single multiplication-accumulation operation. intra The computational delay for complete dense computation within a sub-block monotonically increases with increasing block size B; T inter The delay is calculated for the sparse coupling term between sub-blocks and is independent of the sub-block size B.

[0066] The block size formula automatically configures the block parameter B, avoiding the randomness and suboptimal nature of manual empirical values. Wherein, B... min To meet the minimum sub-block size constraint of the preset maximum approximation error and ensure that the iteration accuracy does not exceed the limit, the total computational delay of this scheme is composed of the dense computational delay within the sub-block and the sparse computational delay between sub-blocks. In the total computational delay function, P is the number of hardware parallel computing units. The logic for determining the optimal size is: B min Ensure that the system's approximate error meets the accuracy constraints and avoid accuracy collapse due to excessively small sub-block sizes; To achieve load balancing between dense and sparse computation, the optimal size is determined, matching the computational time of both parts and maximizing the utilization of hardware parallel computing power. The maximum value of both is ultimately chosen, simultaneously satisfying the lower limit of accuracy and hardware load balancing requirements. This scheme enables automatic solution of the theoretically optimal sub-block size, eliminating reliance on manual debugging; it strictly constrains the upper limit of iterative approximation error to ensure solution accuracy, while achieving hardware and software computational load balancing, minimizing global iterative computation latency. It maximizes the algorithm's acceleration potential from the parameter configuration level, adapting to Ising optimization scenarios of different scales and accuracy requirements.

[0067] This embodiment also provides a specific implementation method, which will be further described below in conjunction with the specific implementation method.

[0068] This solution belongs to the field of quantum computing hardware acceleration and combinatorial optimization computing. Specifically, it involves an efficient matrix-vector multiplication computation method and its FPGA implementation architecture for feedback loops in Ising machines (including coherent Ising machines (CIM), NV color-center Ising machines, etc.). This method maintains near-fully connected computational accuracy while reducing computational complexity. The method significantly reduces costs and is adapted to FPGA hardware architecture, meeting the real-time requirements of the Ising machine feedback loop.

[0069] I. The solution in this embodiment can solve the following problems: 1. Ising Machine Fully Connected Feedback Calculation The latency bottleneck caused by complexity, especially Time delay exceeds This cannot meet the requirement of completing feedback within the spin coherence time.

[0070] 2. Existing sparse approximation methods have limitations on the structure of the coupling matrix and cannot handle general densely coupled problems.

[0071] 3. Static sparsification cannot adapt to the dynamic changes in spin state during the iteration of the Ising machine, leading to the gradual accumulation of approximation errors.

[0072] There is a lack of block computing solutions that are efficiently adapted to FPGA parallel architectures.

[0073] II. Technical Principles Feedback calculation The physical source of the bottleneck: the feedback field of the Ising machine. yes dimensional vector and Matrix multiplication has a natural computational cost of O(n). In the fully connected problem Since the matrix is ​​not sparsity, it is impossible to speed up the process using sparse matrices. When necessary to execute This is the second multiplication-addition operation.

[0074] The mathematical basis of block approximation: Spin groups are classified according to spatial clustering. Each sub-block Each sub-block retains a spin. Fully connected computation is maintained within each sub-block (capturing strong coupling), while only coupling terms exceeding a threshold are retained between sub-blocks (ignoring weak coupling). Physical basis: Combinatorial optimization problems typically exhibit a community structure—strong spin coupling within the same community and weak coupling between communities. The block approximation utilizes this structural prior.

[0075] Total complexity from Down to .when Time-optimal, complexity is O(n log n). .

[0076] The physical motivation for dynamic repartitioning: During the iteration of the Ising machine, the spin state changes continuously, and the initial community partitioning may become unreasonable. When the spin consistency within a sub-block decreases (partial spin flipping causes "splits" within the block), the sub-block needs to be split; when adjacent sub-blocks have highly consistent states, they can be merged to reduce computational load. This achieves a dynamic balance between approximate accuracy and computational efficiency.

[0077] (1) The block feedback calculation method proposed in this embodiment includes the following core steps: Step 1: Blocking the coupling matrix: Coupling matrix Divided into There are 10 sub-blocks, each sub-block being 10 ... ( The partitioning criterion is to allocate spin pairs with high coupling strength to the same sub-block as much as possible.

[0078] Step 2: Calculate fully connected sub-blocks: For each The sub-block performs a complete matrix-vector multiplication, with a computational complexity of O(n log n). .common Diagonal blocks, total computational cost .

[0079] Step 3: Calculation of sparse coupling between sub-blocks: For off-diagonal sub-blocks (coupling between sub-blocks), only the coupling strength is retained. Exceeding the threshold The coupling items. Through pre-sorting and indexing, this step has a time complexity of O(n log n). .

[0080] Step 4: Dynamic Re-partitioning: Every In each iteration, the sub-block partitioning is recalculated based on the current spin state to ensure that the approximate accuracy remains stable as the system evolves.

[0081] Total computational complexity: ,exist , When, delay .

[0082] (2) Sub-block partitioning algorithm Initial partitioning – a clustering method based on coupling strength: Construct a weighted graph Node set edge weight ; right Perform spectral clustering or METIS graph partitioning to... Each node is divided into Given uniformly sized clusters, the optimization objective is to minimize the sum of edge weights between clusters:

[0083] Constraint: The size difference of each cluster does not exceed 1, i.e. ; This partitioning is performed once during system initialization and is subsequently updated through dynamic repartitioning.

[0084] Partitioning Complexity: The complexity of partitioning a METIS graph is... Spectral clustering is (Executed only once during initialization, it does not affect iteration performance).

[0085] (3) Threshold selection method Adaptive threshold The method for determining it is as follows: Percentile threshold based on coupling strength distribution: All coupling terms between statistical sub-blocks Calculate the empirical cumulative distribution function of the distribution. ; Set retention ratio parameters (typical value) ), let the threshold satisfy:

[0086] That is, before retention The strongest coupling term of the ratio is discarded. A weakly coupled term in the ratio; The number of retained inter-sub-block coupling terms is approximately ; when Choose to At that time, the computational complexity between sub-blocks is ,at this time:

[0087] for , That is, to retain the agreement Inter-block coupling terms.

[0088] Approximate error bound: Let the sum of the absolute values ​​of the discarded coupling terms between sub-blocks be... Then the approximate error of the feedback signal satisfies:

[0089] For those that follow a normal distribution The coupling matrix (such as the Sherrington-Kirkpatrick model). The expected value is , The increase approaches zero.

[0090] (4) Dynamic repartitioning mechanism Consistency metric definition: for each sub-block ( Define the internal state consistency index:

[0091] in Indicates that recently Time average in rounds of iteration ( This represents the sliding window size, a typical value. ).

[0092] This reflects the correlation strength between spins within a sub-block. When At higher values, the spin heights within a sub-block are correlated, and fully connected computation is most effective for that sub-block.

[0093] Re-partitioning trigger criteria: Define a global consistency metric .when Descend to initial value of When it is less than twice ( For the sensitivity parameter of repartitioning, typical value Triggering repartitioning:

[0094] Repartitioning Algorithm: 1. Using the spin correlation matrix of the current iteration Replace coupling strength As edge weights for graph partitioning; 2. Construct a weighted graph Perform METIS partitioning to obtain new sub-block configurations; 3. Reconstruct the sparse index table between sub-blocks; 4. Re-division of the period Adaptive adjustment: If the rate of change of partitions after 3 consecutive re-divisions ,but Double; if the rate of change in a single instance ,but Halve.

[0095] (5) Derivation of the optimal selection formula Assume the system has Each spin is divided into Each sub-block (each sub-block) (Spin), single multiply-accumulate (MAC) operation time FPGA has Parallel computing units (PEs).

[0096] Intra-block computation delay:

[0097] Sparse computation delay between sub-blocks: the number of retained inter-sub-block coupling terms (Guaranteed by threshold selection), each item requires 1 MAC:

[0098] Total delay:

[0099] right Differential order :

[0100] because about Monotonically increasing, theoretically The minimum value should be taken. But When the value is too small, more coupling terms are discarded between sub-blocks, increasing the approximation error. Therefore, a trade-off must be struck between delay and accuracy.

[0101] Optimization with Approximation Error Constraints: Defining the Approximation Error for Decreasing function ( The larger the value, the more complete the computation within the sub-block, and the more accurate the approximation. For the SK model:

[0102] Set the maximum allowable approximation error ,but The lower bound is:

[0103] The optimal choice:

[0104] in make sure (Calculate load balancing).

[0105] Numerical examples: , , :

[0106]

[0107]

[0108]

[0109] (6) PE architecture design Parallel Computing Unit (PE) Structure: Each PE contains the following components: Multiply-Accumulate (MAC): 16-bit fixed-point multiplier + 32-bit accumulator, completes one multiply-accumulate cycle per period, clock frequency 250 MHz. ); Local Memory: Dual-port BRAM, capacity bit, storing the spin measurement value of the current processing sub-block. ; Coupling Coefficient Cache (J-Cache): Stores the current sub-block's... The coupled matrix sub-blocks employ a ping-pong dual-buffer structure to streamline computation and data loading. Sparse Index Unit: Stores items that exceed the threshold coupling between sub-blocks. The triples are in CSR (Compressed Sparse Line) format and support sequential reading.

[0110] Dataflow design: Phase 1 (Calculation within a sub-block): The fully connected computation of each sub-block is in Scheduling is performed on each PE, and each PE processes... Each sub-block. The PE uses row-first traversal for... Matrix calculation row by row ; Phase 2 (Inter-block computation): Each sparse coupling term is evenly distributed to Each PE processes [number] PEs. A triplet, execute ; Phase 3 (Result Summarization): The partial sums of each PE are accumulated using a reduction tree to obtain the final result. .

[0111] FPGA resource estimation (using Xilinx Kintex UltraScale+ KU15P as an example): 64 PEs: DSP48E2 = 64 DSPs (5520 can be used). Sub-block storage: bit = 102.4 KB BRAM (75.9 Mb available), Coupled matrix storage: bit = 2 MB ( hour), Resource utilization: DSP 1.2%, BRAM 1.1%, with ample margin for expansion. .

[0112] The beneficial effects of this embodiment are: 1. Significantly reduced computation latency: The computation complexity of fully connected feedback is reduced from O(N^2) to O(N^2). B+N When N=1000, the delay is from logN). 156 μ"s" decreased to 1.72 μ"s" (64 PE, 250 MHz clock) meets the requirement of completing feedback within the spin coherence time; 2. Controllable approximation accuracy: By selecting the threshold parameter p and the sub-block size B, a flexible balance can be struck between accuracy and speed, and the approximation error of the SK model approaches zero as N increases; 3. Strong adaptability: The dynamic repartitioning mechanism ensures that the approximate accuracy remains stable throughout the solution process, avoiding error accumulation caused by spin state evolution; 4. Hardware-friendly: The PE architecture is fully compatible with the parallel computing resources of FPGA (DSP, BRAM), and the data flow design eliminates memory access bottlenecks; 5. Good scalability: Full-precision CIM simulation with N=4096 has been achieved on a single FPGA, and this method can be further extended to N>10000.

[0113] This solution also provides several specific examples.

[0114] Solving the MAX-CUT problem with N=1000 spins: Problem Description: Given a random 3-regular graph with 1000 nodes (each node has exactly 3 edges), find the maximum cut. The corresponding Ising coupling matrix J is a 1000×1000 sparse matrix with 3000 non-zero elements (3 non-zero elements in each row).

[0115] Parameter settings: Spin number N=1000 Sub-block size B = 100 (M = 10 sub-blocks) PE quantity P=64 Clock frequency f = 250 MHz (t_mac = 4 ns) Threshold retention ratio p=0.01 The dynamic repartitioning cycle T_"repart" = 50 rounds Consistency threshold α = 0.7 Sliding window W=20 rounds Total number of iterations: 500 rounds Initial partitioning: METIS is used to perform a 10-way partitioning of the 3-regular graph, with the goal of minimizing the number of edges across sub-blocks. Due to the 3-regularity and sparse nature of the graph, METIS can retain approximately 85% of the edges within sub-blocks.

[0116] Calculation process: Computation within sub-blocks: Fully connected computation of 10 100×100 sub-blocks, but due to the sparsity of the original matrix (only 3 non-zero elements per row), the actual number of non-zero elements within a sub-block is approximately 2550 (85% × 3000). Utilizing sparsity, the computational cost within sub-blocks is further reduced.

[0117] Inter-block computation: 450 non-zero inter-block coupling terms remain, far fewer than N. The budget is logN=10000.

[0118] Single iteration delay: T_"total" =(2550+450) / 64×4 "ns"≈0.19 μ"s".

[0119] Total delay for 500 rounds: 500 × 0.19 μ"s"≈95 μ"s".

[0120] Dynamic repartitioning: Repartitioning is performed once each at rounds 50, 100, ..., 450. Since the 3-regular graph structure is fixed, the repartitioning rate of change is always <5%, and T_"repart" automatically doubles to 100 rounds after round 150.

[0121] Results: The quality of the solution (cut value / known optimal cut value) reached 0.998, which is almost consistent with the 0.999 of the fully connected computation, verifying the effectiveness of the block approximation.

[0122] by Solving the spin-based SK model: Problem Description: Sherrington-Kirkpatrick (SK) model, Coupling matrix Each element is sampled independently from This is a problem of completely dense coupling.

[0123] Parameter settings: Spin number

[0124] ,Pick (Powers of 2, for easier hardware addressing) Sub-block PE quantity

[0125] clock frequency ( ) Threshold retention ratio

[0126] Number of coupling terms between retained sub-blocks

[0127] Computation latency:

[0128]

[0129]

[0130] Approximation error analysis:

[0131] The maximum absolute value of the discarded inter-sub-block coupling terms (Depend on Sure) Approximate error of the feedback signal for each spin

[0132] Compared to the typical feedback signal amplitude ( The relative error is approximately 4.5%. FPGA Implementation: Utilizing a Xilinx Alveo U280 accelerator card (including a 9024 DSP48E2), the 128 PEs only occupy 128 DSPs (1.4%). Coupled matrix storage. 32 MB, using on-chip HBM2 storage.

[0133] Figure 3 This is the overall flowchart of the block feedback calculation method in this embodiment, as follows: Figure 3 As shown, after dividing the blocks into M×M sub-blocks using the coupling matrix, the corresponding calculations are performed on the diagonal and off-diagonal sub-blocks respectively, and the results are summarized to determine whether it is necessary to re-divide the sub-blocks.

[0134] Figure 4 yes Coupling matrix The diagram shows the block structure. After the blocks are divided, the feedback contributions of the diagonal blocks and non-diagonal blocks are calculated separately.

[0135] Figure 5 This is an internal architecture diagram of the parallel computing unit (PE). The data calculated by each unit is processed through multiply-accumulate units, and then partially summed and output.

[0136] Figure 6 It is a flowchart of the dynamic repartitioning mechanism, which uses global consistency to determine whether it is necessary to repartition into sub-blocks and update the hardware coefficient index table.

[0137] Figure 7 This is a top-level architecture diagram based on FPGA, showing the interconnection between the PE array, scheduling controller, reduction tree, HBM2 storage interface, and external interfaces (data interaction with the spin measurement module and feedback application module).

[0138] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0139] This embodiment also provides a block feedback computing device based on the quantum fully connected approximation, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0140] Figure 8 This is a structural block diagram of a block feedback computing device based on the quantum fully connected approximation according to an embodiment of the present invention, as shown below. Figure 8 As shown, the device includes: The partitioning unit 10 is used to perform S1: divide the N×N coupling matrix J corresponding to N spin variables into M×M sub-blocks, each sub-block having B rows and columns, where M=N / B, and M, N, and B are all integers greater than 1. When partitioning the coupling matrix, spin pairs with an absolute coupling strength greater than a preset threshold are assigned to the same sub-block. The computing unit 20 is used to execute S2: perform a complete matrix-vector multiplication calculation on each of the M diagonal sub-blocks to obtain the local field components within each sub-block; Multiplication unit 30 is used to perform S3: for coupling terms in off-diagonal sub-blocks, only retain coupling terms whose absolute value of coupling strength exceeds the threshold θ, and perform sparse matrix-vector multiplication calculation based on the retained coupling terms to obtain local field components between sub-blocks; Summation unit 40 is used to perform S4: summing the local field components within the sub-block and the local field components between the sub-blocks according to the spin index to obtain the feedback signal corresponding to each spin; Solver unit 50 is used to execute S5: update all spin variables according to the feedback signal and complete one round of iterative solution; Update unit 60 is used to execute S6: repeatedly execute steps S2 to S5 to complete multiple rounds of iteration. After each preset iteration interval, the coupling matrix is ​​re-divided into sub-blocks using the same block size and partitioning algorithm as step S1, and the sub-block configuration is updated.

[0141] In this embodiment, the partitioning unit 10 performs S1: dividing the N×N coupling matrix J corresponding to N spin variables into M×M sub-blocks, where the number of rows and columns of each sub-block is B, and M=N / B, where M, N, and B are all integers greater than 1. When partitioning the coupling matrix, spin pairs with an absolute coupling strength greater than a preset threshold are assigned to the same sub-block. The calculation unit 20 performs S2: performing a complete matrix-vector multiplication calculation on each of the M diagonal sub-blocks to obtain the local field components within each diagonal sub-block. The multiplication unit 30 performs S3: for coupling terms in the off-diagonal sub-blocks, only those with an absolute coupling strength exceeding the threshold θ are retained. The coupling terms are calculated, and sparse matrix-vector multiplication is performed based on the retained coupling terms to obtain the local field components between sub-blocks; the summation unit 40 performs S4: summing the local field components within the sub-block and the local field components between sub-blocks according to the spin index to obtain the feedback signal corresponding to each spin; the solution unit 50 performs S5: updating all spin variables according to the feedback signal to complete one round of iterative solution; the update unit 60 performs S6: cyclically executing steps S2 to S5 to complete multiple rounds of iteration. After each preset iteration interval, the coupling matrix is ​​re-divided into sub-blocks using the same block size and partitioning algorithm as in step S1, and the sub-block configuration is updated. This can solve the problem in related technologies where the fixed block division of the coupling matrix leads to a continuous increase in error, thus reducing the optimization effect of the Ising machine, and achieve the effect of dynamically adjusting the block division to improve the computational accuracy of the Ising machine.

[0142] As an optional implementation, the block feedback computing device for the Ising machine in this embodiment includes: P parallel computing units (PEs), each PE including a multiply-accumulate unit, a local memory, a coupling coefficient cache, and a sparse index unit; a scheduling controller for allocating the computing tasks of M sub-blocks to the P PEs and controlling the switching between the computing phase within a sub-block and the sparse computing phase between sub-blocks; a reduction tree module for accumulating the partial sums of each PE to obtain the final feedback signal; and a dynamic repartitioning controller for monitoring the consistency of the internal state of the sub-blocks and triggering repartitioning.

[0143] Furthermore, the device is implemented on an FPGA. The multiply-accumulate unit utilizes the FPGA's DSP48E2 hard core to implement 16-bit fixed-point multiplication and 32-bit accumulation. The local memory and coupling coefficient cache are implemented using the FPGA's BRAM.

[0144] Furthermore, the coupling coefficient cache adopts a ping-pong dual-caching structure, preloading the coupling coefficient data of the next sub-block during the calculation of the current sub-block.

[0145] Furthermore, the sparse index unit uses CSR compressed sparse row format to store the row index, column index, and coupling coefficient values ​​of the overthreshold coupling item.

[0146] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0147] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.

[0148] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0149] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0150] Embodiments of the present invention also provide a non-transitory machine-readable medium storing a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform a method according to an embodiment of the present invention.

[0151] Embodiments of the present invention also provide a computer program product, including a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform the method of an embodiment of the present invention.

[0152] Computer programs for implementing the methods of embodiments of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0153] In the context of embodiments of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable signal medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, or infrared systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, compact optical disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0154] It should be noted that the term "comprising" and its variations used in the embodiments of this invention are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "a plurality" mentioned in the embodiments of this invention are illustrative and not restrictive, and those skilled in the art should understand that unless explicitly indicated otherwise in the context, they should be understood as "one or more".

[0155] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this invention are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0156] The steps described in the method embodiments provided by the present invention can be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of protection of the present invention is not limited in this respect.

[0157] The term "embodiment" in this specification refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily imply the same embodiment, nor does it imply independence or alternativeity from other embodiments. The various embodiments in this specification are described in a related manner, with reference to each other for similar or identical parts. In particular, for apparatus, device, and system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, and relevant details are referred to in the description of the method embodiments.

[0158] The above-described embodiments are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.

Claims

1. A block-feedback computation method based on the quantum fully connected approximation, used for the multiplication of the coupling matrix and spin vector in the Ising machine feedback loop, characterized in that, include: S1: Divide the N×N coupling matrix J corresponding to N spin variables into M×M sub-blocks. The number of rows and columns of each sub-block is B, where M=N / B, and M, N, and B are all integers greater than 1. When dividing the coupling matrix, spin pairs with an absolute value of coupling strength greater than a preset threshold are assigned to the same sub-block. S2: Perform a complete matrix-vector multiplication calculation on each of the M diagonal sub-blocks to obtain the local field components within each sub-block; S3: For coupling terms in off-diagonal sub-blocks, only retain coupling terms whose absolute value of coupling strength exceeds the threshold θ, and perform sparse matrix-vector multiplication calculation based on the retained coupling terms to obtain the local field components between sub-blocks; S4: Summing the local field components within the sub-block and the local field components between the sub-blocks according to the spin index, to obtain the feedback signal corresponding to each spin; S5: Update all spin variables based on the feedback signal to complete one round of iterative solution; S6: Repeat steps S2 to S5 to complete multiple iterations. After each preset iteration interval, the coupling matrix is ​​re-divided into sub-blocks using the same block size and partitioning algorithm as in step S1, and the sub-block configuration is updated.

2. The method according to claim 1, characterized in that, Divide the N×N coupling matrix J corresponding to the N spin variables into M×M sub-blocks, including: Constructing based on the absolute value of coupling strength A weighted graph with edge weights; The weighted graph is partitioned using the K-way equilibrium graph partitioning algorithm, which divides the N nodes representing spin variables into M node clusters with a balanced number of nodes, resulting in M×M sub-blocks. The partitioning optimization objective is to minimize the sum of the absolute values ​​of the weights of the coupling edges between clusters.

3. The method according to claim 1, characterized in that, Coupling terms whose absolute coupling strength exceeds the threshold θ are retained include: For each off-diagonal sub-block, calculate the empirical cumulative distribution function F(x) of the absolute values ​​of all coupling terms in the current off-diagonal sub-block; Set the retention ratio parameter ρ, where 0 < ρ < 1; Solve for F(θ) = 1 The threshold θ of ρ; The coupling terms are filtered, and only those coupling terms with an absolute value of coupling strength greater than θ and in the first ρ quantile are retained, while the remaining weak coupling terms are discarded.

4. The method according to claim 1, characterized in that, The triggering conditions for re-performing sub-block partitioning of the coupling matrix include: Define the consistency index of each sub-block obtained after partitioning at the current iteration time t. It is used to characterize the overall strength of the coupling relationship between all spin variables in the k-th sub-block. The larger the value of the consistency index, the stronger the spin coupling relationship in the corresponding sub-block. Calculate the arithmetic mean of the consistency metrics of all sub-blocks or the weighted sum of the sizes of each sub-block to obtain the global consistency metric I. global (t); When any iteration time t satisfies I global (t)≤α When I0, the coupling matrix is ​​re-partitioned into sub-blocks, where α is a preset re-partitioning sensitivity parameter, 0 < α < 1, and I0 is the initial global consistency index corresponding to the initial completion of sub-block partitioning.

5. The method according to claim 4, characterized in that, For each sub-block The internal consistency index is calculated using the following method: in, Indicates that recently The average value of the spin state in each iteration. To adjust the sliding window size, , For the first The set of spin indices corresponding to each sub-block, σ i σ j These are the i-th and j-th spin variables, respectively.

6. The method according to claim 1, characterized in that, Re-partitioning the coupling matrix and updating the sub-block configuration includes: Using the spin correlation matrix in the current iteration Replacement of original coupling strength |J ij | serves as the basis for edge weights in graph partitioning; Using each spin variable as an independent node in the weighted graph, the weight of the edge connecting node i and node j is |Cij|, thus completing the weighted graph reconstruction; The METIS multi-way balanced graph partitioning algorithm is applied to the reconstructed weighted graph. The partitioning constraint is: all nodes are divided into M node clusters with balanced node sizes. The optimization objective is to minimize the sum of the weights of the connecting edges between different clusters. Each node cluster corresponds to a spin sub-block after the coupling matrix partitioning. The updated sub-block configuration is generated based on the node cluster allocation relationship obtained from the partitioning. Based on the updated sub-block configuration, a sparse index table between sub-blocks is reconstructed to adapt to sparse matrix-vector multiplication operations, where the matrix elements of the spin correlation matrix satisfy... , σ i σ j These are the i-th and j-th spin variables, respectively.

7. The method according to claim 6, characterized in that, The preset iteration interval is determined in the following way: The partition change rate is obtained by obtaining the percentage change of the sub-block number in each of the two adjacent sub-block partitioning results when the sub-block partitioning is re-executed multiple times. If the partition change rate corresponding to L consecutive repartitioning operations is less than the preset lower limit δlow, the preset iteration interval is doubled. If the partition change rate corresponding to a single repartitioning operation is greater than the preset upper limit δhigh, the preset iteration interval will be reduced by half. Where L is the preset number of consecutive decisions, 0 < δlow < δhigh < 1, and δlow, δhigh, and L are all pre-configured based on the type of the Ising problem to be solved.

8. The method according to claim 1, characterized in that, The value of B for the number of rows and columns of the sub-block opt Determined by the following formula: Among them, B min To meet the minimum sub-block size that satisfies the preset maximum approximation error constraint, This indicates the rounding up operation; The total computational delay function is: In the formula, P is the number of parallel computing units, and t mac T is the time taken for a single multiplication-accumulation operation. intra The computational delay for complete dense computation within a sub-block monotonically increases with increasing block size B; T inter Calculate the delay for the sparse coupling term between sub-blocks.

9. A block feedback computing device with quantum fully connected approximation, used to perform multiplication calculations of coupling matrix and spin vector in the Ising machine feedback loop, characterized in that, include: The partitioning unit is used to perform S1: divide the N×N coupling matrix J corresponding to N spin variables into M×M sub-blocks, each sub-block having B rows and columns, where M=N / B, and M, N, and B are all integers greater than 1. When partitioning the coupling matrix, spin pairs with an absolute coupling strength greater than a preset threshold are assigned to the same sub-block. The computing unit is used to execute S2: perform a complete matrix-vector multiplication calculation on each of the M diagonal sub-blocks to obtain the local field components within each sub-block; The multiplication unit is used to perform S3: for coupling terms in off-diagonal sub-blocks, only the coupling terms whose absolute value of coupling strength exceeds the threshold θ are retained, and sparse matrix-vector multiplication is performed based on the retained coupling terms to obtain the local field components between sub-blocks; The summation unit is used to perform S4: summing the local field components within the sub-block and the local field components between the sub-blocks according to the spin index to obtain the feedback signal corresponding to each spin; The solution unit is used to execute S5: update all spin variables according to the feedback signal and complete one round of iterative solution; The update unit is used to execute S6: repeatedly execute steps S2 to S5 to complete multiple rounds of iteration. After each preset iteration interval, the coupling matrix is ​​re-divided into sub-blocks using the same block size and partitioning algorithm as step S1, and the sub-block configuration is updated.

10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method as described in any one of claims 1 to 8.