A method and apparatus for simulated annealing based on controllable probabilistic devices
Patent Information
- Application Number
- CN202410830702.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2044-06-25
AI Technical Summary
[0004]本发明提供一种基于可控概率器件的模拟退火方法及装置,用以解决现有技术中计算组合优化问题时由于参数数量巨大导致计算成本高昂的缺陷,实现对组合优化问题快速求解的同时降低计算成本的目的
[0024] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the simulated annealing method based on a controllable probabilistic device as described above.
Smart Images

Figure CN118821916B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of simulation computing technology, and in particular to a simulated annealing method and apparatus based on controllable probabilistic devices. Background Technology
[0002] Combinatorial optimization problems are a class of problems that seek the optimal object from a finite set of discrete objects, such as the Traveling Salesman Problem (TSP), the Partition Problem, the Graph Coloring Problem, and the Flight Scheduling Problem. These problems are classified as nondeterministic polynomial (NP) difficult problems and are very important in operations research and theoretical computer science.
[0003] Because the solution space of combinatorial optimization problems grows explosively with the number of variables, and because Von Neumann architecture processors inherently operate in a serial manner, they struggle to solve combinatorial optimization problems quickly. The Ising model describes the stochastic process of phase transitions in matter through a group of interconnected spins, and most combinatorial optimization problems can be mapped to the Ising model; that is, solving the Ising model yields the optimal solution to the combinatorial optimization problem. Simulated annealing, derived from the principle of solid-state annealing, is a general optimization algorithm capable of effectively solving the Ising model. Quantum annealing processors utilize superconducting flux qubits to solve combinatorial optimization problems, exhibiting excellent accuracy and extremely fast solution speed. However, quantum annealing processors have very high requirements for the operating environment, and each computation incurs high costs. These drawbacks limit their practical application. Summary of the Invention
[0004] This invention provides a simulated annealing method and apparatus based on controllable probabilistic devices to solve the problem of high computational cost caused by the huge number of parameters when calculating combinatorial optimization problems in the prior art, thereby achieving the goal of quickly solving combinatorial optimization problems while reducing computational cost.
[0005] This invention provides a simulated annealing method based on a controllable probability device. The controllable probability device includes multiple controllable probability units arranged in an array. Each controllable probability unit flips its corresponding probability according to the magnitude of the level signal when it receives a level signal. The method includes the following steps.
[0006] The system receives computational data for the problem to be computed; obtains the QUBO matrix corresponding to the computational data; obtains the analog level value based on the QUBO matrix and the spin states of each controllable probability unit in the controllable probability device stored locally within the previous N set periods after the start of solving the problem; the spin states include: flipped and not flipped; N is a positive integer; if the number of parameters in the computational data is greater than the first total number of rows or columns of multiple controllable probability units in the controllable probability device, obtains the spin matrix based on the number of parameters; the second total number of rows and columns of the spin matrix are equal to the number of parameters; multiplexes the controllable probability device based on each matrix element in the spin matrix; the multiplexing includes: randomly selecting a target matrix element in the spin matrix; determining the target controllable probability unit corresponding to the target matrix element in the controllable probability device based on the first row and first column number of the target matrix element in the spin matrix; and inputting the analog level signal corresponding to the analog level value into the target controllable probability unit; the target matrix element is the spin... The spin state is any one of all elements in the spin matrix; the target controllable probability unit is any one of multiple controllable probability units; the spin state of the target controllable probability unit in the controllable probability device is cached every set period, and after caching for N set periods, the cached spin state of the target controllable probability unit and the position of the target matrix element are stored locally; based on the spin states of all controllable probability units in the controllable probability device in the current N set periods and the previous N set periods stored locally, it is determined whether the spin energy of all controllable probability units in the controllable probability device no longer changes; if it is determined that the spin energy has changed, the controllable probability device is reused according to each matrix element in the spin matrix and the subsequent steps are re-executed; if it is determined that the spin energy no longer changes, the spin state array corresponding to the spin matrix is output according to the spin state of the target controllable probability unit corresponding to each matrix element in the spin matrix and the position of each matrix element obtained based on the position of the target matrix element stored each time; the solution to the problem to be calculated is obtained according to the spin state array.
[0007] According to the present invention, a simulated annealing method based on a controllable probabilistic device determines the target controllable probabilistic unit corresponding to the target matrix element in the controllable probabilistic device based on the first row and first column number of the target matrix element in the spin matrix, including: Obtain the first remainder result when the number of the first row is divided by the number of the first total rows, and the second remainder result when the number of the first column is divided by the number of the first total columns; wherein, if the first remainder result is zero, the number of the first total rows is taken as the first remainder result; and if the second remainder result is zero, the number of the first total columns is taken as the second remainder result. The first remainder result is used as the second row number, and the second remainder result is used as the second column number. The controllable probability unit corresponding to the second row number and the second column number is located in the controllable probability device as the target controllable probability unit.
[0008] According to the present invention, a simulated annealing method based on a controllable probabilistic device is provided, where the problem to be calculated is a combinatorial optimization problem.
[0009] The present invention also provides a simulated annealing device based on a controllable probability device, wherein the controllable probability device includes multiple controllable probability units arranged in an array, and each of the multiple controllable probability units flips according to the magnitude of the level signal when receiving a level signal. The device includes the following modules.
[0010] The receiving module is used to receive the computational data for the problem to be calculated.
[0011] The QUBO matrix calculation module is used to obtain the QUBO matrix corresponding to the calculated data.
[0012] The level value calculation module is used to obtain the analog level value based on the QUBO matrix and the spin state of each controllable probability unit in the controllable probability device within the previous N set periods stored locally after the start of solving the problem to be calculated; the spin state includes: flipped and not flipped; N is a positive integer.
[0013] The spin matrix acquisition module is used to obtain the spin matrix based on the number of parameters when the number of parameters in the calculation data is greater than the first total number of rows or the first total number of columns of multiple controllable probability units in the controllable probability device; the second total number of rows and the second total number of columns of the spin matrix are both equal to the number of parameters.
[0014] The multiplexing module is used to multiplex controllable probability devices based on the matrix elements in the spin matrix. The multiplexing includes: randomly selecting a target matrix element from the spin matrix; determining the target controllable probability unit corresponding to the target matrix element in the controllable probability device based on the first row and first column number of the target matrix element in the spin matrix; and inputting the analog level signal corresponding to the analog level value into the target controllable probability unit. The target matrix element is any one of all matrix elements in the spin matrix; the target controllable probability unit is any one of multiple controllable probability units.
[0015] The caching module is used to cache the spin state of the target controllable probability unit in the controllable probability device at set intervals, and to store the cached spin state of the target controllable probability unit locally after caching for N set intervals.
[0016] The storage module is used to store the spin states of each controllable probability unit in the controllable probability device within N set periods from the cache module.
[0017] The judgment module is used to determine whether the spin energy of all controllable probability units in the controllable probability device no longer changes, based on the spin states of all controllable probability units in the controllable probability device within the current N setting cycles and the previous N setting cycles stored locally.
[0018] The processing module is used to re-execute the functions of the multiplexing module, which randomly selects target matrix elements in the spin matrix and the subsequent modules, when it is determined that the spin energy has changed.
[0019] The processing module is used to output the spin state array corresponding to the spin matrix, based on the spin state of the target controllable probability unit corresponding to each matrix element in the spin matrix and the position of each matrix element obtained based on the position of the target matrix element stored each time, when it is determined that the spin energy no longer changes.
[0020] The solver module is used to obtain the solution to the problem to be calculated based on the self-spinning state array.
[0021] The present invention also provides a simulated annealing apparatus, comprising: a controllable probability device and a simulated annealing apparatus based on the controllable probability device as described above. The controllable probability device includes a plurality of controllable probability units arranged in an array, each of the plurality of controllable probability units flipping its probability according to the magnitude of the level signal when a level signal is received.
[0022] According to the simulated annealing apparatus provided by the present invention, in the multiple controllable probability units arranged in an array of multiple controllable probability units, the number of controllable probability units in each row and the number of controllable probability units in each column are both n, where n is a positive integer and n is greater than or equal to 2.
[0023] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the simulated annealing method based on a controllable probabilistic device as described above.
[0024] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the simulated annealing method based on a controllable probabilistic device as described above.
[0025] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the simulated annealing method based on a controllable probabilistic device as described above.
[0026] The present invention provides a simulated annealing method and apparatus based on a controllable probabilistic device, which involves receiving computational data of a problem to be computed; obtaining a QUBO matrix corresponding to the computational data; obtaining an analog level value based on the QUBO matrix and the spin states of each controllable probability unit in the controllable probabilistic device stored locally for the previous N set periods after the start of solving the problem; the spin states include: flipped and not flipped; N is a positive integer; when the number of parameters in the computational data is greater than the first total number of rows or columns of multiple controllable probability units in the controllable probabilistic device, a spin matrix is obtained based on the number of parameters; the second total number of rows and columns of the spin matrix are equal to the number of parameters; the controllable probabilistic device is multiplexed based on each matrix element in the spin matrix; the multiplexing includes: randomly selecting a target matrix element in the spin matrix; determining the target controllable probability unit corresponding to the target matrix element in the controllable probabilistic device based on the first row and first column number of the target matrix element in the spin matrix; and inputting the analog level signal corresponding to the analog level value into the target controllable device. The system consists of several components: a probability unit, a target matrix element (any element of the spin matrix), a target controllable probability unit (any one of multiple controllable probability units), a cache of the spin state of the target controllable probability unit in the controllable probability device at set intervals, and a local storage of the cached spin state of the target controllable probability unit and the position of the target matrix element after N set intervals. Based on the locally stored spin states of all controllable probability units in the controllable probability device during the current N set intervals and the previous N set intervals, the system determines whether the spin energy of all controllable probability units in the controllable probability device no longer changes. If the spin energy changes, the system re-executes the reuse of the controllable probability device based on each matrix element in the spin matrix and subsequent steps. If the spin energy no longer changes, the system outputs the spin state array corresponding to the spin matrix based on the spin state of the target controllable probability unit corresponding to each matrix element in the spin matrix and the positions of each matrix element obtained based on the position of the target matrix element stored each time. Finally, the solution to the problem to be calculated is obtained based on the spin state array. This invention, based on a reuse strategy of controllable probabilistic devices, requires only a small number of controllable probabilistic units within the device to calculate spin matrices with a large number of parameters, ultimately obtaining the solution to the problem. Therefore, this invention overcomes the high computational cost caused by the large number of parameters in existing technologies for solving combinatorial optimization problems, achieving rapid solutions while reducing computational costs. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0028] Figure 1 This is a flowchart illustrating the simulated annealing method based on controllable probabilistic devices provided by the present invention.
[0029] Figure 2 This is a schematic diagram of the controllable probability device provided by the present invention.
[0030] Figure 3 This is a circuit structure diagram of any controllable probability unit in the controllable probability device provided by the present invention.
[0031] Figure 4 This is a diagram illustrating the output characteristics of the controllable probability device provided by the present invention under different bias voltages.
[0032] Figure 5 This is a schematic diagram of the spin matrix in the simulated annealing method based on controllable probabilistic devices provided by the present invention.
[0033] Figure 6 This is a schematic diagram of the reuse of controllable probability devices in the simulated annealing method based on controllable probability devices provided by the present invention.
[0034] Figure 7 This is a schematic diagram of the simulated annealing device based on a controllable probability device provided by the present invention.
[0035] Figure 8 This is one of the structural schematic diagrams of the simulated annealing device provided by the present invention.
[0036] Figure 9 This is the second schematic diagram of the simulated annealing device provided by the present invention.
[0037] Figure 10 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0039] In related technologies, simulated annealing methods involve novel devices. A magnetic tunnel junction (MTJ) is a sandwich-structure device comprising, from top to bottom, a reference layer, a tunneling barrier layer, and a free layer. The free layer and the fixed layer are two magnetic thin films, forming a nanomagnet; the insulating layer is an oxide film that acts as a tunneling barrier, isolating electron migration between the free layer and the fixed layer. By applying an external electromagnetic field, the magnetic moment direction of the free layer can be switched to be parallel or antiparallel to the fixed layer. In the parallel state, the MTJ has a lower resistance, while in the antiparallel state, the resistance is higher, thus allowing the difference in resistance to be used as a logic state distinction. When the tunneling barrier in the MTJ is low, the parallel and antiparallel states exhibit random jumping phenomena due to thermal noise, resulting in random output characteristics.
[0040] The following is combined Figures 1-6 The simulated annealing method for the controllable probability device of the present invention is described.
[0041] Figure 1 This is one of the flowcharts of the simulated annealing method based on controllable probabilistic devices provided by the present invention, such as... Figure 1 As shown, the method includes the following steps S101 to S111.
[0042] S101: Receive the calculation data for the problem to be calculated.
[0043] The problem to be computed is a combinatorial optimization problem, such as any of the following: Satisfiability Problem (SAT), Zero-one Integer Programming, Clique Problem, Vertex Covering Problem, Set Packing Problem, Set Covering Problem (SCP), Feedback Node Set Problem, Feedback Arc Set Problem, Directed Hamiltonian Cycle Problem, Undirected Hamiltonian Cycle Problem, Directed Hamiltonian Path Problem, Undirected Hamiltonian Path Problem, Exact Cover by 3-Sets (X3C), 3-Dimensional Matching (3DM), Subset Sum Problem, Partition Problem, Knapsack Problem. Problems include the Job Sequencing Problem, the Traveling Salesman Problem, the Rectilinear Steiner Tree Problem, and the Graph Coloring Problem. Alternatively, the problem to be computed can be, for example, the flight scheduling problem.
[0044] S102: Obtain the QUBO matrix corresponding to the calculated data.
[0045] For the problem to be computed, a quadratic unconstrained binary optimization (QUBO) model corresponding to the problem is created, and the QUBO matrix in the QUBO model is obtained.
[0046] S103: Obtain the analog level value based on the QUBO matrix and the spin state of each controllable probability unit in the controllable probability device within the previous N set periods stored locally after the start of solving the problem to be calculated; the spin state includes: flipping and not flipping; N is a positive integer.
[0047] Before introducing S103, the controllable probability device in the embodiments of the present invention will be introduced first.
[0048] like Figure 2 As shown, the controllable probability device 100 includes a plurality of controllable probability units 200 arranged in an array. Each of the plurality of controllable probability units 200 flips according to the magnitude of the level signal with a corresponding probability when a level signal is received.
[0049] The flipping probability of controllable probability unit 200 follows the formula below: s (i,t+1) =s (i,t) ·sgn[rand(0,1)+tanh(V) (i,t) )).
[0050] Where i represents the position of the controllable probability unit, t represents the set period, and s (i,t) The initial spin state, with a value of 1 or -1, where 1 indicates a spin flip and -1 indicates no spin flip; s (i,t+1) The spin state after a set period, taking the value 1 or -1; sgn is the sign function, V (i,t) Let V be the analog level value at time t, and tanh be the hyperbolic tangent function. From the above equation, it can be seen that V... (i,t) The larger the value, the more the output probability of the controllable probability unit is biased towards 1, meaning the greater the probability of a flip. (i,t) The smaller the value, the closer the output probability of the controllable probability unit is to 0, and the lower the probability of a flip.
[0051] The size of the set period can be set by those skilled in the art according to the actual situation, and the embodiments of the present invention do not limit this.
[0052] In some embodiments, such as Figure 2 As shown, the array of multiple controllable probability units 200 can be n×n controllable probability units, with n being the number of controllable probability units in each row and the number of controllable probability units in each column, where n is a positive integer and n is greater than or equal to 2.
[0053] Of course, it is understandable that the array of multiple controllable probability units 200 can also be n×m controllable probability units, where m is a positive integer and m is greater than or equal to 2, and m≠n.
[0054] m and n can be set by those skilled in the art according to the actual situation, and the embodiments of the present invention do not limit this.
[0055] In some embodiments, see Figure 2 n can be 4, and the array can be arranged into 4×4 controllable probability units. The number of controllable probability units in each row and the number of controllable probability units in each column are both 4. Figure 2 The middle arrow indicates the orientation of the magnetization direction.
[0056] In some embodiments, such as Figure 3 As shown, the controllable probability unit 200 includes: a resistor 201, a transistor 202, a magnetic tunnel junction 203, a positive voltage power supply terminal 204, a negative voltage power supply terminal 205, a comparator 206, and a reference voltage terminal 207.
[0057] Please continue reading Figure 3 One end of resistor 201 is connected to the positive power supply terminal 204, and the other end of resistor 201 is connected to the collector of transistor 202. The top electrode of magnetic tunnel junction 203 (the electrode connected to the reference layer of magnetic tunnel junction 203) is connected to the emitter of transistor 202, and the bottom electrode of magnetic tunnel junction 203 is connected to the negative power supply terminal 204. The first input terminal 2061 of comparator 206 is connected to the collector of transistor 202, and the second input terminal 2062 of comparator 206 is connected to the reference voltage terminal 207. The base of transistor 202 is the input terminal of controllable probability unit 200, and the output terminal of comparator 206 is the output terminal of controllable probability unit 200.
[0058] In some embodiments, transistor 202 may be an NMOS transistor.
[0059] Compared to the reference voltage on the external circuit input reference voltage terminal 207, the voltage provided by the positive voltage supply terminal 204 (corresponding to) Figure 3 The voltage at the middle VDD1 is higher than the reference voltage at the reference voltage terminal 207. The negative voltage supply terminal 205 (corresponding to...) Figure 3 The voltage supplied by the VDD1 terminal is lower than the reference voltage at the reference voltage terminal 207.
[0060] See Figure 3 When the input voltage at the input terminal of the controllable probability unit 200 deviates more negatively from the reference voltage, the output terminal of the controllable probability unit 200 is more likely to output a low-level signal; when the input voltage at the input terminal of the controllable probability unit 200 deviates more positively from the reference voltage, the output terminal of the controllable probability unit 200 is more likely to output a high-level signal.
[0061] The circuit structure in the controllable probability unit 200 of this invention can still achieve self-oscillation by relying on the magnetic tunnel junction 203 without external triggering conditions, which can completely solve the problem of data errors caused by trigger signal mismatch.
[0062] Based on the controllable probability unit 200 provided above, the output characteristics under different bias voltages are as follows: Figure 4 As shown.
[0063] See Figure 4 When the input voltage is relatively small, the average value of the output probabilistic pulse is 0.22 (see [reference]). Figure 4 In part (a), as the input voltage increases, the average value of the output probabilistic pulses rises from 0.22 to 0.49 (see Part (a)). Figure 4 In part (b), as the input voltage further increases, the average value of the output probabilistic pulse rises to 0.75 (see Part (b)). Figure 4 (Part (c))
[0064] It should be noted that, Figure 4 The values shown are the average values of the probabilistic pulses over a 100μs sampling time. Figure 4 The vertical axis represents the normalized values.
[0065] S103 is described below. After the problem to be calculated begins to be solved, before an over-level signal is input to the controllable probability device 100, the spin state of each controllable probability unit 200 in the controllable probability device 100 is the initial spin state. In some embodiments, the initial rotation state of the controllable probability unit 200 is assumed to be that no flip has occurred, that is, the initial rotation state of 200 can be recorded as -1.
[0066] After starting to solve the problem to be calculated, if an over-level signal has been input into the controllable probability device 100, the spin state of each controllable probability unit in the controllable probability device within the previous N set periods is directly obtained.
[0067] For example, in a controllable probability device, each controllable probability unit may or may not have flipped after receiving a level signal in the previous instance. When a controllable probability unit 200 flips, its spin state is recorded as 1; when it does not flip, its spin state is recorded as -1.
[0068] In this embodiment of the invention, when obtaining the analog level value based on the QUBO matrix and the spin states of each controllable probability unit in the controllable probability device stored locally within the previous N set periods after the start of solving the traveling salesman problem, the analog level value V can be obtained using the following formula. in .
[0069]
[0070] Where i and j represent the positions of the controllable probability units, t represents the aforementioned set period, and s (i,t) and s (j,t) J has two spin states. ij J is the element in the i-th row and j-th column of the QUBO matrix. ij s (i,t) and s (j,t) The coupling coefficient between them; A is the level adaptation factor, and the value of A is adapted to the design and manufacturing process of the specific device.
[0071] S104: When the number of parameters in the calculated data is greater than the first total number of rows or columns of multiple controllable probability units in the controllable probability device, the spin matrix is obtained based on the number of parameters; the second total number of rows and the second total number of columns of the spin matrix are both equal to the number of parameters.
[0072] For example, the number of parameters in the calculation data is 8, meaning the calculation data contains a total of 8 parameters. The first total number of rows in the controllable probability device is 4, and the first total number of columns is also 4. In this case, since 8 is greater than 4, it meets the condition that the number of parameters in the calculation data is greater than the first total number of rows or columns in the controllable probability device. Based on the number of parameters of 8, the following is obtained: Figure 5 The spin matrix 500 shown has a second total number of rows and a second total number of columns, both having a parameter count of 8. Figure 5 Each box in the diagram corresponds to a matrix element.
[0073] S105: Multiplexing the controllable probability device according to each matrix element in the spin matrix; wherein, the multiplexing includes: randomly selecting a target matrix element in the spin matrix; determining the target controllable probability unit corresponding to the target matrix element in the controllable probability device according to the first row and first column number of the target matrix element in the spin matrix; and inputting the analog level signal corresponding to the analog level value into the target controllable probability unit; the target matrix element is any one of all matrix elements in the spin matrix; the target controllable probability unit is any one of multiple controllable probability units.
[0074] In some embodiments, when determining the target controllable probability unit corresponding to the target matrix element in the controllable probability device based on the first row number and the first column number of the target matrix element in the spin matrix, a first remainder result of taking the first row number as a remainder of the first total row number, and a second remainder result of taking the first column number as a remainder of the first total column number can be obtained firstly; wherein, if the first remainder result is zero, the first total row number is taken as the first remainder result; and if the second remainder result is zero, the first total column number is taken as the second remainder result.
[0075] For example, such as Figure 6 As shown, the target matrix element J xy In the spin matrix, the first row number x = 7 and the first column number y = 8. In this case, the first modulo result and the second region result can be obtained using the following formula: Where i and j represent the positions of the target controllable probability units, and T is the first total number of rows and the first total number of columns of multiple controllable probability units in the controllable probability device.
[0076] by Figure 6 For example, according to the above formula, substituting x = 7, y = 8, and T = 4 into the formula, we get i = mod(7, 4) = 3 and j = mod(8, 4) = 0. When j is 0, taking the first total column number 4 as the value of j, we get j = 4.
[0077] After obtaining the first remainder result and the second remainder result, the first remainder result is used as the second row number and the second remainder result is used as the second column number. The controllable probability unit corresponding to the second row number and the second column number is located in the controllable probability device as the target controllable probability unit.
[0078] by Figure 6 For example, please continue to see Figure 6 The second row number i = 3, the second column number j = 4, thus the controllable probability unit corresponding to row number 3 and column number 4 can be located in the controllable probability device. Figure 6 The position (i, j) in the middle is used as the target controllable probability unit.
[0079] In practical implementation, the controllable probability unit corresponding to the second row and second column number in the controllable probability device can be located as the target controllable probability unit using the following formula: Using the above reuse strategy, large-scale spin matrix calculations can be completed with multiple controllable probability units of a relatively small scale.
[0080] For example, the size of multiple controllable probability units is 4×4, and the size of the spin matrix is 1024×1024. The size of the spin matrix is much larger than the size of multiple controllable probability units, but the above reuse strategy can still achieve the goal of calculating a large-scale spin matrix with multiple controllable probability units of a smaller scale.
[0081] S106: Cache the spin state of the target controllable probability unit in the controllable probability device every set period. After caching for N set periods, store the cached spin state of the target controllable probability unit and the position of the target matrix element locally.
[0082] In some embodiments, N is greater than or equal to 16 to ensure the rationality and sufficiency of the statistical process.
[0083] The spin state of each controllable probability unit in a controllable probability device can be calculated using the following formula: Among them, s (i,t=0) The initial spin state of a randomly selected controllable probability unit is denoted by s, and its value is ±1. (i,t=N+1) The spin state output by a randomly selected controllable probability unit after being judged is ±1.
[0084] S107: Based on the spin states of all controllable probability units in the controllable probability device stored locally for the current N setting cycles and the previous N setting cycles, determine whether the spin energy of all controllable probability units in the controllable probability device no longer changes.
[0085] In some embodiments, the first spin energy can be calculated based on the spin state of each controllable probability unit within the current N set periods, and the second spin energy can be calculated based on the spin state of each controllable probability unit in the previous N set periods.
[0086] The calculation methods for the first spin energy and the second spin energy can be set by those skilled in the art according to the actual situation, and the embodiments of the present invention do not limit this.
[0087] When the first spin energy is equal to the second spin energy, it is determined that the spin energy no longer changes; and when the first spin energy is not equal to the second spin energy, it is determined that the spin energy changes.
[0088] Of course, it is understandable that a preset difference could be set. If the absolute value of the difference between the first spin energy and the second spin energy is less than the preset difference, it is determined that the spin energy no longer changes; otherwise, it is determined that the spin energy has changed.
[0089] The preset difference can be set by those skilled in the art according to the actual situation, and the embodiments of the present invention do not limit this.
[0090] If it is determined that the spin energy has changed, repeat step S105 and its subsequent steps.
[0091] If it is determined that the spin energy no longer changes, execute S108.
[0092] S108: Based on the spin state of the target controllable probability unit corresponding to each element in the spin matrix and the position of each element obtained based on the position of the target matrix element stored each time, output the spin state array corresponding to the spin matrix.
[0093] S109: Obtain the solution to the problem to be calculated based on the self-spinning state array.
[0094] The simulated annealing method based on controllable probabilistic devices provided in this invention can calculate the spin matrix obtained from a large number of parameters by designing only a small number of controllable probabilistic units within the controllable probabilistic devices, based on a reuse strategy of the controllable probabilistic devices, and finally obtain the solution to the problem to be calculated. Therefore, this invention can solve the problem of high computational cost caused by the huge number of parameters when calculating combinatorial optimization problems in the prior art, achieving the goal of quickly solving combinatorial optimization problems while reducing computational cost.
[0095] The present invention provides a simulated annealing method based on a controllable probabilistic device, which involves receiving computational data of a problem to be computed; obtaining a QUBO matrix corresponding to the computational data; obtaining a simulated level value based on the QUBO matrix and the spin states of each controllable probability unit in the controllable probabilistic device stored locally for the previous N set periods after the start of solving the problem; the spin states include: flipped and not flipped; N is a positive integer; when the number of parameters in the computational data is greater than the first total number of rows or columns of multiple controllable probability units in the controllable probabilistic device, a spin matrix is obtained based on the number of parameters; the second total number of rows and columns of the spin matrix are equal to the number of parameters; the controllable probabilistic device is multiplexed based on each matrix element in the spin matrix; the multiplexing includes: randomly selecting a target matrix element in the spin matrix; determining the target controllable probability unit corresponding to the target matrix element in the controllable probabilistic device based on the first row and first column number of the target matrix element in the spin matrix; and inputting the simulated level signal corresponding to the simulated level value into the target controllable probability unit. The target matrix element is any one of all elements in the spin matrix; the target controllable probability unit is any one of multiple controllable probability units; the spin state of the target controllable probability unit in the controllable probability device is cached every set period, and after caching for N set periods, the cached spin state of the target controllable probability unit and the position of the target matrix element are stored locally; based on the spin states of all controllable probability units in the controllable probability device in the current N set periods and the previous N set periods stored locally, it is determined whether the spin energy of all controllable probability units in the controllable probability device no longer changes; if it is determined that the spin energy has changed, the controllable probability device is reused according to each matrix element in the spin matrix and subsequent steps are re-executed; if it is determined that the spin energy no longer changes, the spin state array corresponding to the spin matrix is output according to the spin state of the target controllable probability unit corresponding to each matrix element in the spin matrix and the position of each matrix element obtained based on the position of the target matrix element stored each time; the solution to the problem to be calculated is obtained based on the spin state array. This invention, based on a reuse strategy of controllable probabilistic devices, requires only a small number of controllable probabilistic units within the device to calculate spin matrices with a large number of parameters, ultimately obtaining the solution to the problem. Therefore, the embodiments of this invention address the high computational cost caused by the large number of parameters in existing technologies for calculating combinatorial optimization problems, achieving rapid solutions while reducing computational costs.
[0096] The simulated annealing apparatus based on a controllable probabilistic device provided by the present invention will be described below. The simulated annealing apparatus based on a controllable probabilistic device described below and the simulated annealing method based on a controllable probabilistic device described above can be referred to in correspondence with each other.
[0097] Figure 7 This is a schematic diagram of the simulated annealing apparatus based on a controllable probabilistic device provided by the present invention. The controllable probabilistic device includes multiple controllable probabilistic units arranged in an array. Each controllable probabilistic unit, upon receiving a voltage level signal, flips its probability according to the magnitude of the voltage level signal. Figure 7 As shown, the simulated annealing apparatus 700 based on a controllable probabilistic device includes: The receiving module 701 is used to receive the calculation data of the problem to be calculated.
[0098] The QUBO matrix calculation module 702 is used to obtain the QUBO matrix corresponding to the calculated data.
[0099] The level value calculation module 703 is used to obtain the analog level value based on the QUBO matrix and the spin state of each controllable probability unit in the controllable probability device within the previous N set periods stored locally after the start of solving the problem to be calculated; the spin state includes: flipping and not flipping; N is a positive integer.
[0100] Spin matrix acquisition module 704 is used to obtain a spin matrix based on the number of parameters when the number of parameters in the calculation data is greater than the first total number of rows or the first total number of columns of multiple controllable probability units in the controllable probability device; the second total number of rows and the second total number of columns of the spin matrix are both equal to the number of parameters.
[0101] The multiplexing module 705 is used to multiplex controllable probability devices based on the matrix elements in the spin matrix. The multiplexing includes: randomly selecting a target matrix element from the spin matrix; determining the target controllable probability unit corresponding to the target matrix element in the controllable probability device based on the first row and first column number of the target matrix element in the spin matrix; and inputting the analog level signal corresponding to the analog level value into the target controllable probability unit. The target matrix element is any one of all matrix elements in the spin matrix; the target controllable probability unit is any one of multiple controllable probability units.
[0102] The cache module 706 is used to cache the spin state of the target controllable probability unit in the controllable probability device at set intervals, and to store the cached spin state of the target controllable probability unit locally after caching for N set intervals.
[0103] Storage module 707 is used to store the spin state of each controllable probability unit in the controllable probability device within N set periods from the cache module.
[0104] The judgment module 708 is used to determine whether the spin energy of all controllable probability units in the controllable probability device no longer changes, based on the spin states of all controllable probability units in the controllable probability device within the current N setting cycles and the previous N setting cycles stored locally.
[0105] The processing module 709 is used to re-execute the functions of the multiplexing module 705 in randomly selecting target matrix elements in the spin matrix and the subsequent modules (caching module 706, storage module 707 and judgment module 708) when it is determined that the spin energy has changed.
[0106] The processing module 709 is used to output the spin state array corresponding to the spin matrix based on the spin state of the target controllable probability unit corresponding to each matrix element in the spin matrix and the position of each matrix element obtained based on the position of the target matrix element stored each time, when it is determined that the spin energy no longer changes.
[0107] The solver module 710 is used to obtain the solution to the problem to be calculated based on the self-spinning state array.
[0108] Understandably, in practice, it may be necessary to merge some of the above-mentioned functional modules or divide one functional module into multiple functional modules, etc., as long as the corresponding functions can be achieved.
[0109] Figure 8 This is a schematic diagram of the simulated annealing apparatus provided in an embodiment of the present invention. Figure 8 As shown, the simulated annealing apparatus 800 includes: a controllable probability device, and the aforementioned simulated annealing apparatus 700 based on the controllable probability device.
[0110] The controllable probability device includes: multiple controllable probability units arranged in an array, each of the multiple controllable probability units flipping according to the magnitude of the level signal with a corresponding probability when a level signal is received.
[0111] For the specific circuit structure of the controllable probability unit in the controllable probability device, please refer to the above introduction of the controllable probability unit 200, which will not be repeated here.
[0112] In some embodiments, the functions of the functional modules of the simulated annealing apparatus 700 based on a controllable probability device are redefined to obtain, as follows: Figure 9 The simulated annealing apparatus 900 shown is shown.
[0113] See Figure 9The simulated annealing device 900 includes: a main arithmetic unit 901, a data input module 902, a spin state storage module 903, an input / output module 904, an analog level generation module 905, a position selection module 906, a spin matrix 907, and a spin buffer module 908.
[0114] The main arithmetic unit 901 is used to generate a multiplexing strategy for multiplexing controllable probability devices. Based on the multiplexing strategy, a QUBO matrix is obtained from the QUBO matrix module, and the spin states of each controllable probability unit in the controllable probability device within the previous N set periods, stored locally, are obtained from the spin state storage module 903. Based on the obtained QUBO matrix and the spin states of each controllable probability unit in the controllable probability device within the previous N set periods obtained from the spin state storage module, the analog level value is obtained.
[0115] The specific calculation process for obtaining the analog level value can be found in the corresponding description in the method embodiment, and will not be repeated here.
[0116] J matrix storage module 902 is used to convert the calculation data into a QUBO problem parameter matrix J (i.e., a QUBO matrix) based on the calculation data of the problem to be calculated, and send matrix J to the main arithmetic unit after receiving the first read request from the main arithmetic unit.
[0117] The spin state storage module 903 is used to store the spin state of each controllable probability unit in the controllable probability device, and sends the spin state to the main arithmetic unit after receiving the second read request from the main arithmetic unit 901.
[0118] The input / output module 904 is specifically used to send the analog level value calculated by the main arithmetic unit 901 to the analog level generation module 905, send the position of the controllable probability unit (i.e. the target controllable probability unit) randomly generated by the main arithmetic unit 901 to the position selection module 906, and send the spin state cached in the spin buffer module 908 to the spin state storage module 903.
[0119] In the implementation of a Field-Programmable Gate Array (FPGA), the input / output module 904 can be selected as an AXI (Advanced eXtensible Interface) high-speed interface module.
[0120] The analog level generation module 905 is used to receive the analog level value calculated by the main arithmetic unit 901 and convert the analog level value into an analog level signal.
[0121] The position selection module 906 is used to receive the position of the target controllable probability unit randomly generated by the main arithmetic unit 901, and input the analog level signal generated by the analog level generation module into the input terminal of the randomly generated target controllable probability unit.
[0122] The controllable probability device 907 contains n×n controllable probability units, which are used to control the controllable probability units randomly selected by the main arithmetic unit 901 to perform probability flipping under the regulation of the analog level signal provided by the analog level generation module; and to send the spin state of each controllable probability unit in the controllable probability device within N set periods to the spin buffer module 908.
[0123] The position selection module 906 is also used to receive the position of the target matrix element from the main arithmetic unit 901. When the spin state of each controllable probability unit in the controllable probability device 907 within N set periods is sent to the spin buffer module 908, the position selection module 906 sends the position of the target matrix element to 908. The target matrix element corresponds to the target controllable probability unit in the controllable probability device 907 that has an analog level signal input.
[0124] The spin buffer module 908 is specifically used to buffer the spin states of each controllable probability unit in the spin matrix within N set periods, and to send the buffered spin states of each controllable probability unit in the spin matrix within N set periods to the spin state storage module 903 through the input / output module 904.
[0125] The present invention provides a simulated annealing device based on a controllable probabilistic device, which receives computational data of a problem to be computed; obtains a QUBO matrix corresponding to the computational data; obtains a simulated level value based on the QUBO matrix and the spin states of each controllable probability unit in the controllable probability device within the previous N set periods stored locally after the start of solving the problem; the spin states include: flipped and not flipped; N is a positive integer; when the number of parameters in the computational data is greater than the first total number of rows or columns of multiple controllable probability units in the controllable probability device, a spin matrix is obtained based on the number of parameters; the second total number of rows and columns of the spin matrix are equal to the number of parameters; the controllable probability device is multiplexed based on each matrix element in the spin matrix; wherein, the multiplexing includes: randomly selecting a target matrix element in the spin matrix; determining the target controllable probability unit corresponding to the target matrix element in the controllable probability device based on the first row and first column number of the target matrix element in the spin matrix; and inputting the simulated level signal corresponding to the simulated level value into the target controllable probability unit. The target matrix element is any one of all elements in the spin matrix; the target controllable probability unit is any one of multiple controllable probability units; the spin state of the target controllable probability unit in the controllable probability device is cached every set period, and after caching for N set periods, the cached spin state of the target controllable probability unit and the position of the target matrix element are stored locally; based on the spin states of all controllable probability units in the controllable probability device in the current N set periods and the previous N set periods stored locally, it is determined whether the spin energy of all controllable probability units in the controllable probability device no longer changes; if it is determined that the spin energy has changed, the controllable probability device is reused according to each matrix element in the spin matrix and subsequent steps are re-executed; if it is determined that the spin energy no longer changes, the spin state array corresponding to the spin matrix is output according to the spin state of the target controllable probability unit corresponding to each matrix element in the spin matrix and the position of each matrix element obtained based on the position of the target matrix element stored each time; the solution to the problem to be calculated is obtained based on the spin state array. This invention, based on a reuse strategy of controllable probabilistic devices, requires only a small number of controllable probabilistic units within the device to calculate spin matrices with a large number of parameters, ultimately obtaining the solution to the problem. Therefore, the embodiments of this invention address the high computational cost caused by the large number of parameters in existing technologies for calculating combinatorial optimization problems, achieving rapid solutions while reducing computational costs.
[0126] Figure 10 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 10As shown, the electronic device may include: a processor 1010, a communications interface 1020, a memory 1030, and a communications bus 1040, wherein the processor 1010, the communications interface 1020, and the memory 1030 communicate with each other through the communications bus 1040. The processor 1010 can call logic instructions in the memory 1030 to execute a simulated annealing method based on a controllable probabilistic device. This method includes: receiving computational data of a problem to be computed; obtaining a QUBO matrix corresponding to the computational data; obtaining analog level values based on the QUBO matrix and the spin states of each controllable probability unit in the controllable probabilistic device stored locally for the previous N set periods after the start of solving the problem; the spin states include: flipped and not flipped; N is a positive integer; if the number of parameters in the computational data is greater than the first total number of rows or columns of multiple controllable probability units in the controllable probabilistic device, obtaining a spin matrix based on the number of parameters; the second total number of rows and columns of the spin matrix are equal to the number of parameters; multiplexing the controllable probabilistic device based on each matrix element in the spin matrix; wherein, multiplexing includes: randomly selecting a target matrix element in the spin matrix; and determining the target controllable probability unit corresponding to the target matrix element in the controllable probabilistic device based on the first row and first column number of the target matrix element in the spin matrix; and converting the analog level values to the target controllable probability unit in the controllable probabilistic device. The analog level signal is input to the target controllable probability unit; the target matrix element is any one of all matrix elements of the spin matrix; the target controllable probability unit is any one of multiple controllable probability units; the spin state of the target controllable probability unit in the controllable probability device is cached every set period, and after caching for N set periods, the cached spin state of the target controllable probability unit and the position of the target matrix element are stored locally; based on the spin states of all controllable probability units in the controllable probability device in the current N set periods and the previous N set periods stored locally, it is determined whether the spin energy of all controllable probability units in the controllable probability device no longer changes; if it is determined that the spin energy has changed, the controllable probability device is reused according to each matrix element in the spin matrix and subsequent steps are re-executed; if it is determined that the spin energy no longer changes, the spin state array corresponding to the spin matrix is output according to the spin state of the target controllable probability unit corresponding to each matrix element in the spin matrix and the position of each matrix element obtained based on the position of the target matrix element stored each time; the solution to the problem to be calculated is obtained based on the spin state array.
[0127] Furthermore, the logical instructions in the aforementioned memory 1030 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0128] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the simulated annealing method based on controllable probabilistic devices provided by the above methods. The method includes: receiving computational data of a problem to be computed; obtaining a QUBO matrix corresponding to the computational data; and obtaining a simulated electrical... Average value; Spin states include: flipped and not flipped; N is a positive integer; When the number of parameters in the calculated data is greater than the first total number of rows or columns of multiple controllable probability units in the controllable probability device, the spin matrix is obtained based on the number of parameters; The second total number of rows and columns of the spin matrix are both equal to the number of parameters; The controllable probability device is reused based on each matrix element in the spin matrix; Wherein, reuse includes: randomly selecting target matrix elements in the spin matrix; and determining the controllable probability device based on the first row and first column number of the target matrix element in the spin matrix. The target matrix element corresponds to the target controllable probability unit; and the analog level signal corresponding to the analog level value is input to the target controllable probability unit; the target matrix element is any one of all matrix elements of the spin matrix; the target controllable probability unit is any one of multiple controllable probability units; the spin state of the target controllable probability unit in the controllable probability device is cached every set period, and after caching N set periods, the cached spin state of the target controllable probability unit and the position of the target matrix element are stored locally; based on the spin state of all controllable probability units in the controllable probability device in the current N set periods and the previous N set periods stored locally, it is determined whether the spin energy of all controllable probability units in the controllable probability device no longer changes; if it is determined that the spin energy has changed, the controllable probability device is reused according to each matrix element in the spin matrix and the subsequent steps are re-executed; if it is determined that the spin energy no longer changes, the spin state array corresponding to the spin matrix is output according to the spin state of the target controllable probability unit corresponding to each matrix element in the spin matrix and the position of each matrix element obtained based on the position of the target matrix element stored each time; the solution to the problem to be calculated is obtained according to the spin state array.
[0129] In another aspect, the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the simulated annealing method based on a controllable probabilistic device provided by the above methods. The method includes: receiving computational data of a problem to be computed; obtaining a QUBO matrix corresponding to the computational data; and obtaining an analog level value based on the QUBO matrix and the spin states of each controllable probabilistic unit in the controllable probabilistic device stored locally for the previous N set periods after the start of solving the problem to be computed. The spin states include: flipped and not flipped. N is a positive integer; when the number of parameters in the calculation data is greater than the first total number of rows or columns of multiple controllable probability units in the controllable probability device, the spin matrix is obtained based on the number of parameters; the second total number of rows and columns of the spin matrix are both equal to the number of parameters; the controllable probability device is reused based on each matrix element in the spin matrix; wherein, the reuse includes: randomly selecting target matrix elements in the spin matrix; and determining the target controllable probability corresponding to the target matrix element in the controllable probability device based on the first row and first column number of the target matrix element in the spin matrix. The system employs a rate unit; and inputs the analog level signal corresponding to the analog level value into the target controllable probability unit; the target matrix element is any one of all matrix elements of the spin matrix; the target controllable probability unit is any one of multiple controllable probability units; the spin state of the target controllable probability unit in the controllable probability device is cached every set period, and after caching N set periods, the cached spin state of the target controllable probability unit and the position of the target matrix element are stored locally; based on the spin states of all controllable probability units in the controllable probability device in the current N set periods and the previous N set periods stored locally, it is determined whether the spin energy of all controllable probability units in the controllable probability device no longer changes; if it is determined that the spin energy has changed, the controllable probability device is reused according to each matrix element in the spin matrix and subsequent steps are re-executed; if it is determined that the spin energy no longer changes, the spin state array corresponding to the spin matrix is output according to the spin state of the target controllable probability unit corresponding to each matrix element in the spin matrix and the position of each matrix element obtained based on the position of the target matrix element stored each time; the solution to the problem to be calculated is obtained based on the spin state array.
[0130] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0131] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, 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 can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A simulated annealing method based on controllable probabilistic devices, characterized in that, The controllable probability device includes multiple controllable probability units arranged in an array. Each of the multiple controllable probability units flips its probability according to the magnitude of the received level signal. The method includes: Receive computational data for the problem to be calculated; Obtain the QUBO matrix corresponding to the calculated data; Based on the QUBO matrix and the spin states of each controllable probability unit in the controllable probability device stored locally within the previous N set periods after the start of solving the problem to be calculated, the analog level value is obtained; the spin states include: flipped and not flipped; N is a positive integer; If the number of parameters in the calculated data is greater than the first total number of rows or the first total number of columns of the plurality of controllable probability units in the controllable probability device, a spin matrix is obtained based on the number of parameters; the second total number of rows and the second total number of columns of the spin matrix are both equal to the number of parameters. The controllable probability device is multiplexed according to each element in the spin matrix; wherein, the multiplexing includes: randomly selecting a target matrix element in the spin matrix; determining a target controllable probability unit in the controllable probability device based on the first row and first column number of the target matrix element in the spin matrix; and inputting an analog level signal corresponding to the analog level value into the target controllable probability unit; wherein the target matrix element is any one of all matrix elements in the spin matrix; and the target controllable probability unit is any one of the plurality of controllable probability units; The spin state of the target controllable probability unit in the controllable probability device is cached every set period. After caching for N set periods, the cached spin state of the target controllable probability unit and the position of the target matrix element are stored locally. Based on the spin states of all controllable probability units in the controllable probability device stored locally for the current N set periods and the previous N set periods, it is determined whether the spin energy of all controllable probability units in the controllable probability device no longer changes. If it is determined that the spin energy has changed, the process of reusing the controllable probability device and subsequent steps based on each element of the spin matrix is repeated. When it is determined that the spin energy no longer changes, the spin state array corresponding to the spin matrix is output according to the spin state of the target controllable probability unit corresponding to each matrix element in the spin matrix and the position of each matrix element obtained based on the position of the target matrix element stored each time. The solution to the problem to be calculated is obtained based on the self-spinning state array.
2. The simulated annealing method based on a controllable probabilistic device according to claim 1, characterized in that, The step of determining the target controllable probability unit corresponding to the target matrix element in the controllable probability device based on the first row and first column number of the target matrix element in the spin matrix includes: Obtain a first remainder result when the first row number is divided by the first total row number, and a second remainder result when the first column number is divided by the first total column number; wherein, if the first remainder result is zero, the first total row number is taken as the first remainder result; and if the second remainder result is zero, the first total column number is taken as the second remainder result. Using the first remainder result as the second row number and the second remainder result as the second column number, the controllable probability unit corresponding to the second row number and the second column number is located in the controllable probability device as the target controllable probability unit.
3. The simulated annealing method for a controllable probabilistic device according to claim 1, characterized in that, The problem to be calculated is a combinatorial optimization problem.
4. A simulated annealing apparatus based on a controllable probabilistic device, characterized in that, The controllable probability device includes multiple controllable probability units arranged in an array. Each of the multiple controllable probability units flips its probability according to the magnitude of the received level signal. The device includes: The receiving module is used to receive the calculation data of the problem to be calculated; The QUBO matrix calculation module is used to obtain the QUBO matrix corresponding to the calculated data. The level value calculation module is used to obtain the analog level value based on the QUBO matrix and the spin state of each controllable probability unit in the controllable probability device within the previous N set periods stored locally after the start of solving the problem to be calculated; the spin state includes: flipped and not flipped; N is a positive integer; The spin matrix acquisition module is used to obtain a spin matrix based on the number of parameters when the number of parameters in the calculated data is greater than the first total number of rows or the first total number of columns of the plurality of controllable probability units in the controllable probability device; the second total number of rows and the second total number of columns of the spin matrix are both equal to the number of parameters. A multiplexing module is used to multiplex the controllable probability device according to each matrix element in the spin matrix; wherein, the multiplexing includes: randomly selecting a target matrix element in the spin matrix; determining a target controllable probability unit in the controllable probability device according to the first row and first column number of the target matrix element in the spin matrix; and inputting an analog level signal corresponding to the analog level value into the target controllable probability unit; wherein the target matrix element is any one of all matrix elements in the spin matrix; and the target controllable probability unit is any one of the plurality of controllable probability units; A caching module is used to cache the spin state of the target controllable probability unit in the controllable probability device at set intervals, and to store the cached spin state of the target controllable probability unit locally after caching for N set intervals; a storage module is used to store the spin state of each controllable probability unit in the controllable probability device within N set intervals from the caching module. The judgment module is used to determine whether the spin energy of all the controllable probability units in the controllable probability device no longer changes, based on the spin states of all the controllable probability units in the controllable probability device in the current N set periods and the previous N set periods stored locally. The processing module is used to re-execute the function of the multiplexing module in randomly selecting target matrix elements in the spin matrix and each module in the subsequent modules when it is determined that the spin energy has changed; The processing module is used to output a spin state array corresponding to the spin matrix based on the spin state of the target controllable probability unit corresponding to each matrix element in the spin matrix and the position of each matrix element obtained based on the position of the target matrix element stored each time, when it is determined that the spin energy no longer changes. The solution module is used to obtain the solution to the problem to be calculated based on the self-rotating state array.
5. A simulated annealing apparatus, characterized in that, include: Controllable probability device and simulated annealing apparatus based on controllable probability device as described in claim 4; The controllable probability device includes multiple controllable probability units arranged in an array. Each of the multiple controllable probability units flips according to the magnitude of the level signal when it receives a level signal.
6. The simulated annealing apparatus according to claim 5, characterized in that, In the array of multiple controllable probability units, the number of controllable probability units in each row and the number of controllable probability units in each column are both n, where n is a positive integer and n is greater than or equal to 2.
7. The simulated annealing apparatus according to claim 6, characterized in that, The value of n is 4.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the simulated annealing method based on a controllable probabilistic device as described in any one of claims 1 to 3.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the simulated annealing method based on a controllable probabilistic device as described in any one of claims 1 to 3.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the simulated annealing method based on a controllable probabilistic device as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Circuit for processing combinatorial optimization problem
CN114626536A
Combined optimization problem processing circuit based on improved simulated annealing algorithm
CN115858999A