Code conversion method

CN119487534APending Publication Date: 2025-02-18TDK CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202280098334.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-06-20
Publication Date
2025-02-18

Smart Images

  • Figure CN119487534A_ABST
    Figure CN119487534A_ABST
Patent Text Reader

Abstract

Provided is a transcoding method having a conversion step for converting a first calculation model, which represents an option using a first representation method and can be applied to an Isin model or a QUBO, into a second calculation model, which represents an option using a second representation method and can be applied to an Isin model or a QUBO. And a conversion step for obtaining a partial matrix of Hamiltonian used in the operation of the second calculation model by solving a simultaneous equation in which each component of energy obtained on the basis of the first calculation model and each component of energy obtained on the basis of the second calculation model coincide with each other, the conversion step being capable of being applied to an Isin model or QUBO.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a code conversion method. Background Art

[0002] Attempts are being made to use quantum annealing to find the optimal solution to a combinatorial optimization problem. A combinatorial optimization problem can be treated as a minimization problem, which finds a combination that minimizes an arbitrary objective function.

[0003] In combinatorial optimization problems, multiple options are expressed as combinations of binary variables. Known methods for expressing each option include binary representation, one-hot representation, domain wall representation, and unary representation.

[0004] Patent Document 1 describes a machine learning system that can convert a bit sequence in machine learning to suppress a calculation load.

[0005] Prior art literature

[0006] Patent Literature

[0007] Patent Document 1: Japanese Patent No. 6259946 Summary of the invention

[0008] 1. Technical issues to be resolved

[0009] It is not difficult to change only the representation method of the values ​​corresponding to the options of the combinatorial optimization problem. On the other hand, it is not easy to change the first calculation model expressed by the first representation method to the second calculation model expressed by the second representation method. This is because the components of the Hamiltonian required for the calculation of energy are different depending on the representation method. In the case of changing the representation from the first representation method to the second representation method, it is necessary to rebuild the Hamiltonian from scratch based on the second representation method.

[0010] The present invention has been made in view of the above situation, and an object of the present invention is to provide a code conversion method capable of converting a partial matrix of a Hamiltonian based on a first representation method and easily obtaining a partial matrix of a Hamiltonian based on a second representation method.

[0011] (II) Technical solution

[0012] The present invention provides the following solutions in order to solve the above-mentioned technical problems.

[0013] The code conversion method of the first embodiment includes a conversion step of converting a first calculation model into a second calculation model, wherein the first calculation model represents options using a first representation method and can be applied to an Ising model or QUBO, and the second calculation model represents options using a second representation method and can be applied to an Ising model or QUBO. In the conversion step, simultaneous equations are solved in which each component of energy obtained based on the first calculation model and each component of energy obtained based on the second calculation model are consistent. Then, a partial matrix of the Hamiltonian used for the calculation of the second calculation model is obtained based on the solution.

[0014] In the code conversion method of the above aspect, the partial matrix of the Hamiltonian used for the calculation of the second calculation model can be obtained according to the following formula (1):

[0015]

Number 1

[0016]

[0017] In formula (1), x j 1 、x k 1 is the value assigned the option and expressed in the first representation, H jk 1 is the partial matrix of the Hamiltonian of the first computational model, x j 2 、x k 2 is the value assigned with the option and expressed in the second representation, H jk 2 is the partial matrix of the Hamiltonian of the second computational model.

[0018] In the code conversion method described above, the first representation method may be a binary representation, and the second representation method may be a one-hot representation.

[0019] In the code conversion method described above, the first representation method may be binary representation, and the second representation method may be domain wall representation.

[0020] In the code conversion method described above, the first representation method may be a one-hot representation, and the second representation method may be a binary representation.

[0021] In the code conversion method described above, the first representation method may be one-hot representation, and the second representation method may be domain wall representation.

[0022] In the code conversion method described above, the first representation method may be domain wall representation, and the second representation method may be binary representation.

[0023] In the code conversion method described above, the first representation method may be domain wall representation, and the second representation method may be one-hot representation.

[0024] (III) Beneficial effects

[0025] The code conversion method of the present invention can convert a partial matrix of a Hamiltonian based on a known first representation method and easily obtain a partial matrix of a Hamiltonian based on a second representation method. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is a schematic diagram of the Ising model and QUBO.

[0027] Figure 2 This is an example of using one-hot representation to represent four values.

[0028] Figure 3 This is an example of representing four values ​​using binary notation.

[0029] Figure 4 This is an example of expressing four values ​​using domain wall representation.

[0030] Figure 5 This is an example of using unary notation to represent four values.

[0031] Figure 6 This is an example of a case where a value expressed using a first representation method is re-represented using a second representation method. DETAILED DESCRIPTION

[0032] The present embodiment will be described in detail below with appropriate reference to the accompanying drawings. The accompanying drawings used in the following description may sometimes enlarge the features of the present embodiment for convenience in order to make the features of the present embodiment easier to understand, and the dimensional ratios of the components may sometimes differ from the actual situation. The materials, dimensions, etc. exemplified in the following description are examples, and the present invention is not limited thereto, and can be implemented by appropriate changes within the scope of the subject matter.

[0033] The code conversion method of this embodiment includes a conversion step of converting a first calculation model into a second calculation model.

[0034] The first calculation model and the second calculation model are calculation models that can be applied to the Ising model or QUBO. The calculation model is used for quantum annealing. Quantum annealing is an algorithm for finding the state (ground state) with the minimum energy according to the calculation model.

[0035] The Ising model is a model that predicts an overall stable state when a plurality of factors interact with each other and a coercive force is exerted on each factor.

[0036] Figure 1This is a schematic diagram of the Ising model. The Ising model has a plurality of bits b that interact with each other through a coercive force F. Each bit b is composed of a spin s. Spin s represents either an upward or downward state. Bits b are expressed by variables representing binary states. By setting the coercive force F, the state in which adjacent spins s are balanced becomes a stable state, or the state in which they are antiparallel becomes a stable state. The coercive force F is called an interaction parameter.

[0037] The Ising model is expressed by the following energy function (cost function).

[0038]

Number 2

[0039]

[0040] In equation (2), σ i , σ j is the input variable. i , σ j It is a binary variable of +1 or -1. i , σ j Corresponds to Figure 1 The state of spin s in J ij is the interaction parameter. ij Corresponds to Figure 1 The force F in h i is a parameter imposed on each bit b by an external factor, for example, a magnetic field parameter. The magnetic field parameter can be regarded as a weighting of each bit b. α is a constant.

[0041] QUBO (Quadratic Unconstrained Binary Optimization) is a computational model that can be equivalently converted to the Ising model. In the Ising model, each bit b is expressed as a binary variable of +1 or -1, whereas in QUBO, each bit b is expressed as a binary variable of 0 or 1. QUBO is expressed in the same way as the Ising model using the first computational model. In QUBO, σ i , σ j It is a binary variable of 0 or 1.

[0042] The Ising model and QUBO can be applied to integer programming problems. Integer programming problems are problems in which each element of the solution vector is limited to an integer. The Ising model and QUBO can be applied to combinatorial optimization problems, for example. Combinatorial optimization problems are examples of integer programming problems in which the objects to be combined are discrete relations. Examples of combinatorial optimization problems include the traveling salesman problem, the knapsack problem, the schedule optimization problem, and the distribution planning problem.

[0043] In the Ising model and QUBO, multiple options in the combinatorial optimization problem are represented by binary variables σi , σ j The binary variable σ i , σ j In the case of the Ising model, they are "+1" and "-1", and in the case of QUBO, they are "1" and "0".

[0044] As a representation method of options, there are, for example, binary representation, one-hot representation, domain wall representation, and unary representation.

[0045] Figure 2 This is an example of using binary notation to represent four values ​​a1 to a4. Values ​​a1 to a4 are respectively the combination variables σ i A collection of variables. Here, an example with four values ​​is given, but the number of values ​​is arbitrary. The options in the combinatorial optimization problem are assigned to values ​​a1 to a4. That is, values ​​a1 to a4 are values ​​to which multiple options of the combinatorial optimization problem are assigned, and are values ​​that can be taken by a combination of more than one binary variable. The method of assigning options to values ​​a1 to a4 is free. By assigning options to values ​​a1 to a4, the options and values ​​a1 to a4 correspond. The options in the combinatorial optimization problem are expressed as values ​​a1 to a4 in the calculation formula.

[0046] Binary representation is a method of representing N types of information using binary numbers. In the case of binary representation, each variable σ that allows the value a1 to a4 to be represented i At the same time, it is "1". Binary representation can use fewer variables σ i Indicates more states.

[0047] Figure 3 This is an example of using one-hot representation to represent four values ​​a1 to a4. One-hot representation is a method of representing N types of information using N variables. One-hot representation can also represent N types of information using more than N variables. In the case of one-hot representation, only one of the N variables is "1", and the other variables are all "-1" in the case of the Ising model and "0" in the case of QUBO. One-hot representation only requires a variable σ equal to the number of options. i , but even if the variable σ i Even if one of them is rewritten due to noise, it will not express other states, and has strong noise resistance.

[0048] Figure 4 This is an example of using domain wall representation to represent four values ​​a1 to a4. Domain wall representation is a method of representing N types of information using the position of boundaries, where the boundaries are set at positions where adjacent values ​​are different. In the case of domain wall representation, multiple variables σ i It is sandwiched between two fixed values ​​z1 and z2. One fixed value z2 is fixed to "1", and the other fixed value z1 is fixed to "-1" in the case of the Ising model and fixed to "0" in the case of QUBO.

[0049] Figure 5 This is an example of using unary representation to represent four values ​​a1 to a4. Unary representation is a method of representing N types of information using the sum of variables.

[0050] The first calculation model is a calculation model that represents the options using a first representation method. The first representation method is, for example, any one of the above-mentioned one-hot representation, binary representation, domain wall representation, and unary representation.

[0051] For example, the first calculation model can be expressed by the following equation (3). j 1 、x k 1 The option is assigned to indicate the value of the option. j 1 、x k 1 Expressed using the first representation method. jk 1 is the partial matrix of the Hamiltonian of the first computational model. 1 (x) is the energy function based on the first calculation model.

[0052]

Number 3

[0053]

[0054] Here, for example, when n=3 and m=3, if the above-mentioned equation (3) is expanded, the following equation (4) is established.

[0055]

Number 4

[0056]

[0057] Each matrix component of the above equation can be decomposed as shown in the following equation (5).

[0058]

Number 5

[0059]

[0060] The above equation (5) corresponds to a part of the energy function (cost function) of the Ising model. The equation (5) expresses a part of the locality of the energy function, which can be called, for example, local energy.

[0061] The second calculation model is a calculation model that represents the options using a second representation method. The second representation method is, for example, any of the above-mentioned binary representation, one-hot representation, domain wall representation, and unary representation, and is a representation method different from the first representation method.

[0062] For example, the second calculation model can be expressed by the following equation (6). j2 、x k 2 The option is assigned to indicate the value of the option. j 2 、x k 2 Expressed using the second representation method. jk 2 is the partial matrix of the Hamiltonian of the second computational model. E 2 (x) is an energy function based on the second calculation model. Formula (6) can also be expanded in the same way as Formula (4).

[0063]

Number 6

[0064]

[0065] It is not difficult to re-express a value expressed in the first representation in the second representation. Figure 6 This is an example of a case where a value expressed using a first representation method is re-represented using a second representation method. Figure 6 This is an example of a case where there are two options in the first group, four options in the second group, and four options in the third group. The options in the first group are assigned values ​​b1 and b2, respectively, the options in the second group are assigned values ​​a1 to a4, respectively, and the options in the third group are assigned values ​​c1 to c4, respectively.

[0066] For example, we select one option from each group and choose the combination (b1, a3, c4). If we express the values ​​b1, a3, c4 in binary, we can use the binary variable σ i The combination of is expressed as (1, 11, 10). In contrast, if the values ​​b1, a3, and c4 are expressed using one-hot representation, they can be expressed using a binary variable σ i The combination of is expressed as (01, 0100, 1000). In this way, the change of the value representation method follows the rules.

[0067] On the other hand, a method for converting the energy function of the first calculation model expressed by equation (3) into the energy function of the second calculation model expressed by equation (4) is unknown. jk 1 The partial matrix H of the Hamiltonian of the second calculation model jk 2 The correspondence is unclear and it is difficult to first calculate the partial matrix H of the Hamiltonian of the model jk 1 The partial matrix H of the Hamiltonian of the second computational model is linearly transformed jk 2 .

[0068] In this embodiment, the following method is proposed: based on the calculation result of the energy function of the first calculation model expressed by equation (3), the partial matrix H of the Hamiltonian of the second calculation model expressed by equation (4) is obtained. jk 2 .

[0069] For example, if the first calculation model is calculated using the Ising machine, the value (option, combination of values) that minimizes the energy of the energy function based on the first calculation model is obtained. This is because, by using the operation of the first calculation model, the value (combination of variables) represented by the first calculation model is optimized and the value is determined. That is, if the first calculation model is calculated using the Ising machine, the energy expressed by formula (3) and the combination of the value assigned to it are obtained.

[0070] Similarly, for example, if the second calculation model is calculated using the Ising machine, a combination of values ​​that minimize the energy of the energy function based on the second calculation model is obtained. This is because, by using the calculation of the second calculation model, the value (combination of variables) represented by the second calculation model is optimized and the value is determined. That is, if the second calculation model is calculated using the Ising machine, the energy expressed by formula (6) and the combination of the value assigned to it are obtained.

[0071] As described above, the combination of formula (3) and the values ​​assigned thereto and the combination of formula (6) and the values ​​assigned thereto can be independently calculated. However, these operations are different operations. That is, when the representation method is changed, it is necessary to construct the partial matrix of the Hamiltonian according to each representation method. Currently, a method is being sought that can effectively perform the following operations: even when the representation method is changed, there is no need to rebuild the partial matrix of the Hamiltonian, and the partial matrix H of the Hamiltonian of the second calculation model can be calculated only by following the conversion rules. jk 2 .

[0072] Therefore, items that cannot change between the case where calculation is performed using the first calculation model and the case where calculation is performed using the second calculation model are extracted.

[0073] One is the combination of values ​​that minimize the energy of the energy function. This is because the optimal solution cannot be different due to different value representation methods.

[0074] The other is the relationship between the energy values ​​obtained by each calculation model. The energy value obtained by the first calculation model and the energy value obtained by the second calculation model should be consistent. For example, in the first calculation model, the energy value (E 1 (x1)) is greater than the energy value (E 1(x2)) is large. In this case, in the second calculation model, the energy value (E 2 (x1)) should also be higher than the energy value (E 2 (x2)). For example, in the traveling salesman problem, the fact that the cost (time and expense) of traveling in the order A→B→C is higher than the cost of traveling in the order B→A→C does not change depending on how the values ​​are expressed.

[0075] Therefore, in the code conversion method of this embodiment, it is assumed that the energy (E 1 (x)) and the energy (E 2 The components of (x) are consistent.

[0076] Based on the energy (E 1 The components of (x) are not necessarily the same as the energy (E 2 However, if the energy (E 1 (x)) and the energy (E 2 (x)) is consistent, the condition that the items that do not change when the calculation is performed by the first calculation model and the calculation is performed by the second calculation model does not change. Therefore, even if the above assumption is made, the energy function calculated based on the second calculation model should not become inappropriate.

[0077] If the above assumptions are met, the following equation (1) holds.

[0078]

Number 7

[0079]

[0080] Here, as described above, if the first calculation model is calculated, x j 1 、x k 1 , H jk 1 In addition, since the combination of values ​​that lead to the optimal solution cannot be changed, x j 2 、x k 2 Satisfy x j 1 =x j 2 、x k 1 =x k2 That is, in equation (1), only the partial matrix H of the Hamiltonian jk 2 Therefore, by solving the simultaneous equations after expanding equation (1), we can find the partial matrix H of the Hamiltonian jk 2 .

[0081] As a specific example, the following example is shown: For example, when j=k=3, the partial matrix H of the Hamiltonian is obtained. jk 2 . Set x 1 Express the four options in binary notation. 1 Can use x1 1 =(0,0)、x2 1 =(1,0)、x3 1 =(0,1)、x4 1 = (1, 1) expression. In addition, set x 2 Use one-hot representation to express the four options. 2 Can use x1 2 =(1,0,0,0)、x2 2 =(0,1,0,0)、x3 2 =(0,0,1,0)、x4 2 =(0, 0, 0, 1) expression.

[0082] In addition, set H 11 1 and H 11 2 For the following relationship.

[0083]

Number 8

[0084]

[0085] If calculation is performed based on the above relationship, the following equation (8) holds.

[0086]

Number 9

[0087]

[0088] For H jk 2 The same calculations as above are performed for j = 1 to 3 and k = 1 to 3, respectively, so that the partial matrix H of the Hamiltonian can be obtained. jk 2 .

[0089] As described above, the code conversion method of this embodiment does not need to reconstruct the calculation model according to the changed representation method even when the representation method is changed. The code conversion method of this embodiment uses the calculation model in the specific representation method that has been calculated, and converts the calculation model after the representation method is changed according to the rules, so the calculation efficiency is excellent. Therefore, the code conversion method of this embodiment can easily change the representation method of the value according to the required use.

[0090] By using the code conversion method of this embodiment, it is possible to change the representation method of the calculation model from binary representation to any one of one-hot representation, domain wall representation, and unary representation, for example.

[0091] Furthermore, by using the code conversion method of the present embodiment, it is possible to change the representation method of the calculation model from, for example, one-hot representation to any one of binary representation, domain wall representation, and unary representation.

[0092] By using the code conversion method of this embodiment, it is possible to change the representation method of the calculation model from, for example, domain wall representation to any one of binary representation, one-hot representation, and unary representation.

[0093] Furthermore, by using the code conversion method of the present embodiment, it is possible to change the representation method of the calculation model from, for example, a unary representation to any one of a binary representation, a one-hot representation, and a domain wall representation.

[0094] Here, conversion among binary representation, one-hot representation, domain wall representation, and unary representation is presented as an example, but the convertible representation method is not limited to this.

[0095] This computational model can be applied to an Ising machine dedicated to the calculation of the Ising model and QUBO, for example. The computational model is stored in the Ising machine as a computational program, for example. The computational program sends instructions to the processor, causing the processor to perform processing according to the above computational model. For example, quantum annealing machines (D-wave, NEC), coherent Ising machines (NTT), analog bifurcation machines (Toshiba), digital annealers (Fujitsu), CMOS annealing machines (Hitachi) and other machines are examples of Ising machines.

[0096] The Ising machine may also be a quantum gate computer. If, for example, QAOA (Quantum Approximate Optimization Algorithm) is used, the Ising model and QUBO can be calculated by a quantum gate computer.

[0097] The embodiments of the present invention are described in detail above with reference to the drawings, but each structure of each embodiment and their combination are merely examples, and addition, omission, replacement and other changes of structures can be made without departing from the gist of the present invention.

[0098] Description of Reference Numerals

[0099] B: position; s: spin; F: force.

Claims

1. A code conversion method, comprising a conversion step of converting a first calculation model into a second calculation model, wherein: The first computing model uses a first representation method to represent options, which can be applied to the Ising model or QUBO, and the second computing model uses a second representation method to represent options, which can be applied to the Ising model or QUBO. In the conversion step, simultaneous equations are solved for each component of energy obtained based on the first calculation model and each component of energy obtained based on the second calculation model to obtain a partial matrix of the Hamiltonian used for calculation of the second calculation model.

2. The code conversion method according to claim 1, characterized in that The partial matrix of the Hamiltonian used for the calculation of the second calculation model is obtained according to equation (1): 【Number 1】 In formula (1), x j 1 、x k 1 is the value assigned the option and expressed in the first representation, H jk 1 is the partial matrix of the Hamiltonian of the first computational model, x j 2 、x k 2 is the value assigned with the option and expressed in the second representation, H jk 2 is the partial matrix of the Hamiltonian of the second computational model.

3. The code conversion method according to claim 1, characterized in that: The first representation method is binary representation, The second representation method is one-hot representation.

4. The code conversion method according to claim 1, characterized in that: The first representation method is binary representation, The second representation method is domain wall representation.

5. The code conversion method according to claim 1, characterized in that: The first representation method is one-hot representation, The second representation method is binary representation.

6. The code conversion method according to claim 1, characterized in that: The first representation method is one-hot representation, The second representation method is domain wall representation.

7. The code conversion method according to claim 1, characterized in that: The first representation method is domain wall representation, The second representation method is binary representation.

8. The code conversion method according to claim 1, characterized in that: The first representation method is domain wall representation, The second representation method is one-hot representation.

Citation Information

Patent Citations

  • Photosensitive resin composition

    JP1987059946A