Data structure for polynomial storage, QUBO matrix generation method, QUBO matrix generation device, and program
The QUBO matrix generation method optimizes memory usage and processing speed by storing low-order term data in fixed-length arrays and using pointers for higher-order terms, addressing inefficiencies in existing methods and enhancing Ising machine capabilities.
Patent Information
- Application Number
- PCT/JP2024/003840
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2025-08-14
AI Technical Summary
Existing methods for generating QUBO matrices for Ising machines are inefficient in terms of processing speed and memory usage, limiting the scale and accuracy of optimization problems that can be solved, and increasing costs due to prolonged processing times and memory consumption.
A QUBO matrix generation method that stores subscript data directly in fixed-length arrays for low-order terms and uses pointers for higher-order terms, reducing memory usage and improving processing speed by eliminating dynamic memory allocation and cache misses.
Enables the handling of larger optimization problems with reduced memory consumption and faster processing times, expanding the applicability of Ising machines and reducing project costs by ensuring timely and accurate solutions.
Smart Images

Figure JP2024003840_14082025_PF_FP_ABST
Abstract
Description
Data structure for storing polynomials, QUBO matrix generation method, QUBO matrix generation device, and program
[0001] The disclosed technology relates to a computer known as an Ising machine, and in particular to a technology for automatically generating matrix data called "QUBO matrices" that can be processed by an Ising machine, with high speed and memory efficiency using a CPU.
[0002] [Ising Machines and QUBO] Ising machines are computers specialized for solving combinatorial optimization problems. They are expected to be able to calculate solutions to optimization problems more efficiently than conventional computers. This article explains what kind of optimization problems Ising machines can solve.
[0003] First, let us consider N optimization variables x → ={x1, x2,…,x N Each variable can only take two values: 0 or 1 (i.e., x i ∈{0,1}, i=1,…,N). In this case, the Ising machine solves the optimization problem of the following form: However, Q is a matrix, Q ij represents the element, represents the set of all sequences of N 0s or 1s, {{0,…,0},{0,…,0,1},…,{1,…,1}}, and the elements of the set are 2 N The optimization problem in the form of equation (1) is called the QUBO (Quadratic Unconstrained Binary Optimization) model, where Q = {Q ij} is a matrix that indicates information about the optimization problem. Q is a real N × N square matrix. In this specification, Q is called a QUBO matrix. Equation (1) is defined as "Given Q = {Q ij}, x that minimizes → ={x1, x2,…,x N} is a problem of finding
[0004] The QUBO model has the following characteristics: (i) The function to be optimized is a quadratic function (Quadratic). (ii) There are no explicit constraints (Unconstrained). If you want to handle constraints, convert the constraints into the optimization function form of equation (1) using an appropriate method so that it can be handled as a QUBO model. (iii) Variables take only two values, 0 and 1 (Binary). (iv) It includes adjustable parameters (although it may not).
[0005] We will reiterate two important terms in the disclosed technology. QUBO model: An optimization problem in the form of Equation (1). QUBO matrix: The matrix Q in the QUBO model of Equation (1). Ising machines can only solve optimization problems of the QUBO model. In other words, an Ising machine cannot be run without preparing a QUBO matrix. However, general combinatorial optimization problems cannot necessarily be expressed using a QUBO model. Therefore, when using an Ising machine, it is important to efficiently generate a QUBO matrix (in terms of processing time and memory efficiency) from the contents of an arbitrary combinatorial optimization problem. The importance of this will be discussed in the next section. Note that once the QUBO matrix is determined, the QUBO model is uniquely determined. Therefore, in this paper, building a QUBO model and generating a QUBO matrix are treated as synonymous.
[0006] [Importance of Efficiently Generating QUBO Matrix Q] In order to discuss the importance of efficiently generating a QUBO matrix, a workflow for solving a practical optimization problem is shown. FIG. 1 is a functional block diagram showing an example configuration of an optimal solution search device 1. The optimal solution search device 1 includes a PUBO model input unit 11, a PUBO model storage unit 15, a QUBO matrix generation unit 12, a QUBO matrix storage unit 16, an Ising machine 13, and a verification unit 14. FIG. 2 is a flowchart explaining the flow of solving an optimization problem using the optimal solution search device 1.
[0007] Consider the following combinatorial optimization problem P: "There are four units of product A, which is worth $2 and weighs 1 kg, and four units of product B, which is worth $1 and weighs 3 kg. Suppose you want to choose from these and put them into a bag that can hold up to 7 kg in total. In this case, how many units of A and B should you put into the bag to maximize the total value of the products?"
[0008] First, a human constructs a mathematical model of the problem based on the "human language" (step S201). Letting the number of A be a and the number of B be b, the optimization problem P is converted into, for example, the following mathematical model P1: "Let a and b be integers. Minimize -(2a+b) under the constraints 0≦a≦4, 0≦b≦4, a+3b≦7."
[0009] This mathematical model P1 is an optimization problem of integer variables. Because it is not in the form of equation (1), it cannot be directly solved by an Ising machine. To bring it closer to a form that an Ising machine can solve, a process of "human conversion into PUBO model" is first carried out (step S202). PUBO stands for Polynomial Unconstrained Binary Optimization. Then, the mathematical model P1 is transformed into the following PUBO model P2: "Minimize the following equation. However, x i ∈{0,1},y i ∈{0,1},r i ∈{0,1}, where λ is a tunable parameter.
[0010] The optimization function of the PUBO model has the following characteristics: (i) The function to be optimized is a polynomial (Polynomial). (ii) There are no explicit constraints (Unconstrained). If you want to handle constraints, convert the constraints in an appropriate way so that they can be handled as a PUBO model. (iii) Variables take only two values, 0 and 1 (Binary). (iv) They contain adjustable parameters (although they may not). The symbol "λ" in equation (5) refers to the parameter. The parameter is a weighting coefficient used when converting a constraint into a PUBO model. In equation (5), the constraints "0≦a≦4, 0≦b≦4, a+3b≦7" are expressed as follows: This is converted into a polynomial of the PUBO model.
[0011] Equation (5) has the above four features. The PUBO model input by the PUBO model input unit 11 is stored in the PUBO model storage unit 15.
[0012] Next, in order to generate a QUBO matrix from the PUBO model, the following is performed on the function of the PUBO model: (a) degree reduction (when the function of the PUBO model contains third-order or higher terms, a method is used to convert them into second-order terms. Details will not be discussed in this specification), (b) parameter values are substituted, and (c) the formula is expanded and rearranged, and the result is summarized in the form of equation (1). This is performed automatically by the CPU (QUBO matrix generation unit 12) (step S203). In the case of the above PUBO model P2, where the matrix Q is a matrix obtained by expanding and rearranging the equation (5).
[0013] The parameters are adjustable. Changing the parameter values will generate different QUBO matrices, even if the problem in human terms is the same. Therefore, the execution results of the Ising machine will also differ. Therefore, even for the same problem, changing the parameter values will result in a different optimized solution being calculated. Therefore, the parameter values affect the accuracy of the optimized solution.
[0014] The QUBO matrix generated by the QUBO matrix generation unit 12 is stored in the QUBO matrix storage unit 16.
[0015] Next, the Ising machine 13 performs optimization based on the QUBO matrix and outputs a solution A (step S204). For example, the following solution is output. Next, the verification unit 14 verifies the accuracy and validity of solution A (step S205). If the accuracy and validity are sufficient, solution A is adopted as the optimal solution.
[0016] If the accuracy and / or validity is insufficient, the parameter values are changed (step S206[1], step S207) or the conversion method to the PUBO model is changed (step S206[2], step S208). Then, another QUBO matrix is generated again (step S203) and solution A is calculated again (step S204). If the accuracy / validity of the new solution A is again insufficient, another QUBO matrix is created and solution A is calculated. This cycle (recalculation cycle of steps S205 → S206 → S207 / S208 → S203 → S204) is repeated until the accuracy / validity of solution A reaches a certain standard.
[0017] Here, processing speed and memory efficiency become important in the recalculation cycle when generating the QUBO matrix. This is explained below. <Importance of Processing Speed> The recalculation cycle in Figure 2 is a process that is repeated many times, and each time, the "QUBO matrix generation unit generates the QUBO matrix" part is executed. Therefore, if it takes a long time to generate the QUBO matrix, it will cause a delay in the overall time required for the recalculation cycle. This creates a problem when using Ising machines. In businesses using Ising machines, if the project period is set, it is necessary to generate a highly accurate solution within the specified period. However, if the recalculation cycle takes a long time, it may become necessary to terminate the recalculation cycle due to time constraints, even if the solution is not accurate enough, which will reduce the quality of the results. Alternatively, even if the project period is extended in order to achieve a more accurate solution, the labor costs and costs of using the Ising machine for the project will increase accordingly.
[0018] <The Importance of Memory Efficiency> QUBO matrices are generated using the CPU. The data temporarily created during the QUBO matrix generation process, as well as the final QUBO matrix, must be stored in memory connected to the CPU. Therefore, the larger the QUBO matrix data size (proportional to the number of non-zero elements in the matrix), the greater the memory consumption required for the matrix generation process. However, because memory capacity is finite, the processable size of the QUBO matrix is limited by memory capacity. Limiting the size of the QUBO matrix implies a limit on the scale of the optimization problem to be solved. If memory is wasted during the QUBO matrix generation process, it becomes impossible to handle problems of the scale that could have been handled. This narrows the scale of optimization problems that can be solved using an Ising machine and also narrows the range of applications for Ising machines. Therefore, a highly memory-efficient QUBO matrix generation method is needed.
[0019] Note that the part in Figure 2 where "the Ising machine performs optimization based on the QUBO matrix" is also a process that requires processing time and memory consumption. Therefore, both the part where the CPU generates the QUBO matrix and the part where the Ising machine performs optimization require high processing performance. The disclosed technology targets the part where the QUBO matrix is generated.
[0020] For these reasons, when developing an automatic QUBO matrix generation tool, it is necessary to consider achieving high processing speed and memory efficiency. In the next section, we discuss conventional techniques for generating QUBO matrices and the challenges they pose in terms of processing speed and memory efficiency.
[0021] [PyQUBO] PyQUBO is software for performing step S203 in FIG. 2 (the QUBO matrix generator generates a QUBO matrix), and can be executed on a CPU using Python. As a simple example, (However, x i Table 1 shows the code to automatically expand and rearrange the equation and generate the QUBO matrix Q by substituting λ = 3.0 for ∈{0,1}, λ is a parameter).
[0022] The second line of the code defines the variables x1, x2, and x3 using the Binary class (a class of variables that take the values 0 and 1). The third line defines a class of adjustable parameters. As shown in line 4, the mathematical model (= the function to be optimized) can be defined in an intuitive manner. In line 5, the parameter values are assigned and the formula is automatically expanded and rearranged. As a result, the QUBO matrix Q is generated. When the print statement for Q on line 6 is executed, Q is displayed in the form {('x1','x2'):6.0,('x1','x3'):-3.0,('x2','x2'):5.0,('x1','x1'):3.0,('x3','x3'):-1.0}. Q can be written explicitly in matrix form as follows: In this specification, we will refer to the PyQUBO internal processing method as the "conventional method." In the next section, we will explain in particular the data structure of the formula data in lines 4 and 5 of Table 1.
[0023] [Data structure of mathematical formulas in conventional methods] In order to calculate formulas using a program such as that shown in Table 1, the formulas must be stored as data in memory. For example, Consider the following expression. In the conventional method, this expression takes the data structure shown in Figure 3 in memory (assuming a program written in C++ on Linux (registered trademark) on an x64 / amd64 architecture processor).
[0024] The data of the formula is managed as a fixed-length array (R1...R8 in Figure 3) with the data of each term as an element. Each element consists of areas C1...C6, with C1 and C2 each being 4 bytes (int type), C3 being 8 bytes (int* type), C4 and C5 being 8 bytes (size_t type), and C6 being 24 bytes. C1 stores the value of the subscript of the first-order variable, C2 stores the value of the subscript of the second-order variable, and C3 stores a pointer to the value of the subscript of the third-order variable and beyond. In Figure 3, 31 indicates that the value "6" is located at address 0xff43ac in memory space, 32 indicates that the value "3" is located at address 0xffb480, and the value "4" is located at the adjacent address 0xffb484. C4 stores the degree of the term, C5 stores the value of n when memory for n variable subscripts is allocated (n must be greater than or equal to the degree of the term), and C6 stores other data such as the coefficients of the terms (details will not be provided as they are outside the scope of the disclosed technology).
[0025] For example, for the data of the term "4x4x5x6" stored in R4, C1: The subscript value of variable x4 is "4". C2: The subscript value of variable x5 is "5". C3: A pointer to the address where the subscript value of variable x6, "6", is stored. C4: The degree of the term (= the number of variables in the term) is "3". C5: The value of the memory allocated to store the subscript data, in units of 4B, is "3". C6: Data such as coefficients.
[0026] As mentioned above, for terms of degree 3 or higher, the subscript data from the third onwards is managed via a pointer. Note that since QUBO matrices are two-dimensional matrices, terms of degree 3 or higher cannot be handled directly. Therefore, when a formula contains terms of degree 3 or higher, a special process is performed to reduce the degree to terms of degree 2 or lower during the QUBO matrix generation process. This is performed in the "f.compile()" part on the fifth line in Table 1.
[0027] [Characteristics of the conventional method] The above data structure has the following two advantages: In the following, the computational complexity of an algorithm that can be executed with a number of steps that is independent of the number of data n, regardless of its size, is expressed as O(1), and the computational complexity of an algorithm whose number of steps increases by n times in proportion to the number of data n is expressed as O(n).
[0028] <(i) The time complexity of accessing term data is O(1)> This is because the subscript data from cubic onwards is managed using pointers (fixed at 8 bytes), allowing the data in an expression to be managed as a fixed-length array. For example, in Figure 3, consider accessing the data (R4) for the term 4x4x5x6. The data for this term is the third from the top of the array (the term x1 is considered to be the zeroth term). With modern RAM (Random Access Memory), accessing an element of a fixed-length array can be performed in O(1) time complexity, regardless of the element's position. (Strictly speaking, this means that accessing data at any address in memory is O(1). When accessing the mth element of a fixed-length array, each element of which is s bytes, the starting address of that element can be found by calculating "the starting address of the zeroth element of the array + ms" once. Because both the address calculation and address access are O(1), the overall computational complexity is O(1).)
[0029] If the subscript data were stored directly in the array without using a pointer, accessing the mth element would require O(m) computation time. This is because the data size of the array elements varies depending on the order of the terms. If the data size varies, the starting address of the mth element = (starting address of the 0th element) + (data size of the 0th element) + (data size of the 1st element) + ... + (data size of the m-1th element), and the data sizes of the 0th to (m-1)th elements must be checked. This requires O(m) checks, and the time complexity of accessing the mth element also becomes O(m). When adding or multiplying expressions, it is usually necessary to access all the terms in the expression. Therefore, whether the computational complexity of accessing a single term is O(m) or O(1) affects the processing speed of the program.
[0030] <(ii) For one term, access to the first two subscript data is fast> The "first two subscript data" here refers to 4 and 5 in the cubic term 4x4x5x6, for example. Ising machines often handle terms up to the second order, for the following reasons.
[0031] <Background> The QUBO model cannot directly handle quadratic or higher terms. If a PUQO model before generating a QUBO matrix contains cubic or higher terms, a degree reduction process is performed to reduce the equation to quadratic. In the disclosed technology, the degree reduction process is performed automatically by the CPU, but the processing time increases as the degree of the PUBO model increases. Therefore, in the processes of step S201 (human conversion to mathematical model) and step S202 (human conversion to PUBO model) in Figure 2, efforts are often made to ensure that the degree of the converted PUBO model is close to (or even equal to) quadratic. Such efforts reduce the processing time required for automatic generation of QUBO matrices. Therefore, in automatic QUBO generation programs, subscript data for up to two terms is frequently accessed. Therefore, conventional methods store the subscript values for the first two subscripts directly in an array. This prevents a slowdown in data access up to the second subscript. On the other hand, subscripts from the third subscript onward are managed via a pointer, as shown in the figure. Therefore, to access the subscript data, it is necessary to first access the pointer. However, as mentioned above, the advantage remains that accessing term data requires O(1) time complexity by managing it via pointers.
[0032] As described above, the conventional method is characterized by the benefit of having the time complexity of accessing term data being O(1) and the fast data access speed for frequently performed terms up to the second degree.
[0033] M. Zaman et al., "PyQUBO: Python Library for Mapping Combinatorial Optimization Problems to QUBO Form", IEEE Transactions on Computers, vol. 71, no. 4, pp. 838-850, April 2022.
[0034] Although the features of the conventional method have been described above, there are still issues remaining with the conventional method. In particular, there are issues in both memory efficiency and processing speed. Below, we will explain the remaining issues in terms of [memory efficiency issues] and [processing speed issues], and also explain the [troubles that memory / processing speed issues cause in practical situations].
[0035] [Memory Efficiency Issues] Conventional data structures consume unnecessary memory for variable subscripts. Consider the terms in Figure 3 as an example. Excluding "other data such as term coefficients," the memory usage essentially required for each term is 4n bytes (n is the degree of the term), specifically: x1 → "1" - 4 bytes; x2x3 → "2,3" - 8 bytes in total; x4x5x6 → "4,5,6" - 12 bytes in total; x1x2x3x4 → "1,2,3,4" - 16 bytes in total. However, in reality, each term uses at least 4B+4B+8B+8B+8B = 32 bytes of memory (C1 to C5 in Figure 3). In an Ising machine, when the number of terms is 10 8 Pieces and 10 9 We may deal with optimization problems with more than 10 terms. For example, if the problem has all quadratic terms and the number of terms is 10, 9 If there are 8 bytes of data, excluding C6 (coefficients of terms and other data), the information required is 8 bytes x 10 9 = 8 GB, while the memory usage of the conventional technology is 32 bytes x 10 9 = 32 GB, resulting in a four-fold difference in memory usage. Note that while the data for C6 is 24 bytes in the conventional method, the essentially required information is 8 bytes representing the double-precision floating-point value of the coefficient (details on this are outside the scope of the disclosed technology and will not be discussed here). Therefore, if C6 is included in the previous example, the essentially required information is (8 + 8) bytes x 10 9 = 16GB, while the conventional method uses (32+8) bytes x 10 9The difference in memory consumption between 100GB and 40GB will widen further. Wasteful memory usage creates the problem of limiting the scale of problems users want to solve. Therefore, technology is needed to keep memory usage to what is essentially necessary as much as possible. This specification discloses technology for reducing the amount of wasted memory consumption in the C1 to C5 portions of C1 to C6 in Figure 3.
[0036] [Issues with processing speed] In the latter half of the section above on [Characteristics of the conventional method], it was explained that the data structure of the conventional method takes processing speed into consideration, but there are still issues that remain. Here, we will list two areas that need to be improved in terms of processing speed.
[0037] The first issue is the handling of cubic and higher order terms via pointers. Let's take Figure 3 again as an example. Suppose we want to add a new term, x1x2x3, to the equation (x1+2x2x3+4x4x5x6+6x1x2x3x4) in Figure 3. In this case, we write the subscript data for x1x2x3 and any other necessary data in the blank data area in the diagram. Because this term is a cubic term, the subscript "3" for the third variable, x3, is stored via a pointer. This requires dynamic memory allocation for the pointer (specifically, using the standard C malloc function or the C++ new operator). This dynamic memory allocation slows processing compared to not using pointers. Furthermore, when accessing data via a pointer, processing delays occur due to the overhead of accessing the pointer itself. Furthermore, when accessing data via a pointer, data access spans discontinuous memory areas. This can cause CPU cache misses and slow processing speeds.
[0038] The second problem is that the data size of a single term is larger than necessary. As mentioned above in [Memory Efficiency Issues], for example, the essential data size required for a quadratic term is 8 bytes, but the conventional method requires a minimum of 32 bytes. When writing the contents of a new term into empty data, writing 8 bytes takes longer than writing 32 bytes.
[0039] The above two issues appear to be resolved by "abolishing management via pointers and writing cubic and higher level subscript data directly to empty data." As explained in <(i) The time complexity of accessing term data is O(1)> in [Characteristics of the conventional method], if the term data is not managed via pointers, it will become variable length, and the benefit of the processing speed of a fixed-length array will be lost.
[0040] [Troubles caused by memory / processing speed issues in practical use] Although some of this overlaps with the above [Importance of efficiently generating the QUBO matrix Q], it is an important matter so will be explained again. The issues with the conventional method described above in [Memory efficiency issues] and [Processing speed issues] cause the following troubles when using Ising machines in practice.
[0041] <The bottleneck in memory efficiency limits the scale of optimization problems that can be handled> The data size of the optimization formula indicates the scale of the optimization problem. In practical applications, there is a demand for solving optimization problems with a larger number of variables and terms. Meanwhile, the data size of the formula that a CPU can handle is limited by the capacity of the main memory around the CPU. Therefore, if there is unnecessary memory consumption in the formula data, problems will arise such as the inability to handle optimization problems of a scale that should have been possible due to memory constraints. This places limits on the problems that Ising machine users want to solve, narrowing the range of applications of Ising machines.
[0042] As mentioned above in [The importance of efficiently generating the QUBO matrix Q], the generation of a QUBO matrix is repeated multiple times to solve the same optimization problem (in human language). Through this repetition, the accuracy of the optimization solution improves. Therefore, if it takes a long time to generate a QUBO matrix each time, the time and effort required to improve the accuracy of the solution increases. This can lead to problems such as "in businesses using Ising machines, a solution with satisfactory accuracy cannot be obtained by the project deadline" and "extension of the project period results in increased labor costs and Ising machine usage fees."
[0043] To solve the above problem, a QUBO matrix generation device according to the disclosed technology generates a QUBO matrix from a polynomial and includes n arrays-k (k = 1, 2, ..., n) and a QUBO matrix generation unit. m is a natural number, and each term of the polynomial consists of a single variable or a product of m unique variables and a coefficient. A term with m variables is called an m-th term. The QUBO matrix generation unit generates n arrays-k (k = 1, 2, ..., n) (n is a natural number). Array-k has one or more array elements. Each array element of array-k is an area for storing identification information for the variable of the k-th term, and includes k identifier areas in which the identification information is stored only in that area. The QUBO matrix generation unit stores the k-th term of the polynomial in array-k and generates a QUBO matrix using array-k (k = 1, 2, ..., n).
[0044] By reducing memory usage, it becomes possible to handle optimization problems of a scale that could not be handled with conventional methods. This means that the issues mentioned above in <The importance of memory efficiency> and the issues mentioned in <The size of optimization problems that can be handled is limited due to bottlenecks in memory efficiency> are alleviated, contributing to the expansion of the range of applications of Ising machines. By improving processing speed, businesses that solve optimization problems with Ising machines can obtain better solutions in the same period of time. It also makes it possible to prevent cost increases due to the prolongation of businesses. This means that the issues mentioned above in <The importance of processing speed> and the issues mentioned in <The accuracy of optimal solutions solved by Ising machines decreases due to bottlenecks in processing speed> are alleviated.
[0045] 1 is a functional block diagram of an optimal solution search device 1 according to a conventional method. FIG. 2 is a flowchart explaining the operation of the optimal solution search device 1. FIG. 3 is a diagram explaining a data structure for storing polynomials according to a conventional method. FIG. 4 is a diagram explaining a data structure for low-order terms used in the disclosed technology. FIG. 5 is a diagram explaining a data structure for low-order terms and a data structure for high-order terms used in the disclosed technology. FIG. 6 is a functional block diagram of a QUBO matrix generation device 60 according to the first embodiment. FIG. 7 is a flowchart explaining an example of the operation of the QUBO matrix generation device 60 (additional storage of terms). FIG. 8 is a diagram explaining additional storage of terms and data structures, comparing the conventional method with the disclosed technology. FIG. 9 is a diagram explaining processing when calculation element numbers collide in additional storage of terms. FIG. 10 is a flowchart explaining an example of the operation of the QUBO matrix generation device 60 (addition of polynomials). FIG. 11 is a diagram explaining the polynomial addition process using a data structure for low-order terms. FIG. 12 is a flowchart explaining an example of the operation of the QUBO matrix generation device 60 (multiplication of polynomials). FIG. 13 is a diagram explaining polynomial multiplication processing using a data structure for low-order terms and a data structure for high-order terms. FIG. 14 is a diagram showing an example of the functional configuration of a computer.
[0046] Hereinafter, embodiments of the disclosed technology will be described in detail. Note that components having the same functions are assigned the same numbers, and duplicated descriptions will be omitted.
[0047] [First Embodiment] The first embodiment describes a QUBO matrix generation method / device. In conventional technology, first- and second-order term data (subscript information) are stored in fixed-length arrays of the same design. However, in the disclosed technology, for terms of lower orders below a predetermined order, all term data (subscript information) is stored in fixed-length arrays designed for each order. For terms of orders higher than a predetermined order, term data is stored using fixed-length arrays and pointers, similar to terms of orders 3 or higher in the conventional method. Below, we first explain the "data structure for low-order terms," and then explain in detail the operation of a QUBO matrix generation device using the data structure for low-order terms, using examples of "updating polynomial data by adding a term," "updating polynomial data by adding a polynomial," and "multiplying polynomials."
[0048] [Data Structure for Low-Order Terms] The disclosed technology's data structure for low-order terms has two key points. <Point [1]> Subscript data is stored directly in the array, not managed via pointers. Conventional methods manage subscript data from the third order onward via pointers, with terms of all orders managed in the same array. This consumes a total of 24 bytes: 8 bytes for the pointer itself (C3 in Figure 4), 8 bytes representing the order of the term (C4 in Figure 4), and 8 bytes for the number of subscript data allocated in memory (C5 in Figure 4). In contrast, the disclosed technology's data structure for low-order terms stores all subscript data of all orders directly in the array (not via pointers). This saves the 8 bytes for the pointer itself. Furthermore, as explained in detail in <Point [2]> and Figure 5, the disclosed technology uses independent arrays for each order of term. This unifies the order of terms in the same array, eliminating the need to include the 8 bytes representing the order of the term. Similarly, the memory size used for the term subscripts is self-evident, so the "8 bytes for the number of subscript data for which memory is allocated" is also unnecessary. As a result, the disclosed technology saves 24 bytes per term compared to conventional methods. Furthermore, as the data size of the terms is reduced, the data processed by the QUBO matrix generation device / program is also reduced, thereby improving the processing speed of the device / program. In addition, in terms of processing speed, there are benefits such as "eliminating pointers means there is no need for dynamic memory allocation, and processing speed can be improved by the time required for dynamic memory allocation," and "there is no data access via pointers, so the CPU cache hit rate when accessing subscript data is improved, thereby improving processing speed."
[0049] <Point [2]> Focusing only on the data of low-order terms (first to third orders in Figure 5), an independent array is prepared for each order. For higher-order data (fourth order or higher in Figure 5), the same data structure as the conventional method is used, and the data is managed collectively in a single array. Ideally, to utilize the benefits of Point [1] for data of all orders, an infinite number of independent arrays would need to be prepared in advance. However, this is not realistic. Therefore, when representing formula data using the disclosed technology, high-order data is managed collectively using the conventional method. As a result, the benefits of Point [1] are only realized for low-order terms. However, this is not a major problem in the practical use of Ising machines. This is because, in practical applications of Ising machines, the "human conversion to mathematical model" and "human conversion to PUBO model" processes in Figure 2 are often devised so that the converted PUBO model contains only low-order terms. If the PUBO model contains high-order terms, an order reduction process is required to convert the high-order terms into quadratic terms when generating the QUBO matrix. The higher the degree of the PUBO model, the longer the processing time required for degree reduction processing. To reduce this processing time, humans devise ways to prevent high-order terms from appearing at the PUBO model stage (or to ensure that the PUBO model stage already contains only quadratic or cubic terms). As a result, the formula data that appears in the QUBO matrix generation program often contains only low-order terms, and even if the disclosed technology is applied only to low-order terms, the strengths of point [1] of the disclosed technology are demonstrated in many Ising machine use cases. This point [2] can be said to be a feature unique to Ising machines, and is a point that should be emphasized in the disclosed technology.
[0050] This concludes the explanation of the data structure for low-order terms.
[0051] [Updating Polynomial Data by Adding Terms] Fig. 6 is a functional block diagram showing an example configuration of a QUBO matrix generation device 60 according to embodiment 1. The QUBO matrix generation device 60 includes a QUBO matrix generation unit 12, a hash value calculation unit 61, and a sorting unit 62, and is responsible for generating a QUBO matrix in the optimal solution search device 6. Fig. 7 is a flowchart explaining an example of the operation of the QUBO matrix generation device 60. Below, the operation of the data structure for low-order terms will be explained using Figs. 6 and 7.
[0052] <Example of adding a unique term to polynomial data> In this section, we will look at an example of adding a new term, 2x1x3x4, to the equation x1x2x3+8x2x3x5. Following the code writing method in Table 1, this example assumes the following program. Figure 8 compares the flow of addition with the conventional method. In the "Disclosed Technology" section of Figure 8, arrays of data of other orders are also present as null data, but these are omitted in Figure 8. The flow of addition of new terms (additional terms) is as follows:
[0053] First, it is determined whether the added term should be stored in the data structure for low-order terms or in the data structure of the conventional method (step S701). Step S701 indicates the determination that if the degree of the added term is n or less, it is stored in the data structure for low-order terms, and if it is greater than n, it is stored in the data structure of the conventional method. In the following explanation, n = 3. If the degree of the added term is greater than n (Yes in step S701), the added term is stored in the data structure of the conventional method (step S702). Because 2x1x3x4 is a cubic term (No in step S701), it is decided to insert the data into a cubic fixed-length array (step S703).
[0054] Next, the element of the destination array into which the additional term should be stored is determined using the following procedure. The hash value calculation unit 61 calculates a hash value hash([1,3,4]) from the 2x1x3x4 subscript integer sequence [1,3,4]. The hash value is a 64-bit unsigned integer (type uint64_t in C++). The details of the algorithm for calculating a hash value from an integer sequence are outside the scope of the disclosed technology, so they will not be discussed in detail. The hash value calculation unit 61 calculates the remainder when the obtained hash value is divided by the length N of the destination array. That is, it calculates e = hash([1,3,4]) mod N (step S704). In FIG. 8, since N = 4, e takes the value 0, 1, 2, or 3. Here, it is assumed that e = 1. The value of e varies depending on the algorithm used to calculate the hash value.
[0055] If the e-th (currently the first) of the fixed-length array to be inserted is empty data as shown in FIG. 8 (Yes in step S705), the QUBO matrix generation unit 12 inserts the data of the term 2x1x3x4 into the empty data area (step S706).
[0056] <Example 1 with overlapping terms> Figure 9 shows the processing when element number 1 is not null. Figure 9(a) shows an example of adding the term 2x2x3x5. Assume that "hash([2,3,5]) mod N" is 2. Then, the original formula contains the term 8x2x3x5, so data exists in element number 2 (No in step S705). However, the terms 2x2x3x5 and 8x2x3x5 have the same set of subscripts (Yes in step S707). In this case, all that is required is to add the coefficients, so the coefficient of the existing term is simply rewritten from 8 to 10 (step S708).
[0057] <Example 2 with Duplicate Terms> Figure 9(b) shows an example of adding the term 3x4x5x6. Let's assume that "hash([4,5,6]) mod N" also happens to be 2. Another term already exists for element number 2 (No in step S705), and the subscript set is different (No in step S707). In this case, some method must be used to find nearby null data and write the data for the term 3x4x5x6 there. For example, the next element can be checked in order until null data is found. In the example of Figure 9(b), element number 3 was null (step S709), so data was inserted there (step S710). There are other algorithms for finding null data, but these are outside the scope of the disclosed technology and will not be discussed in detail.
[0058] This concludes the explanation of "Updating polynomial data by adding terms."
[0059] [Updating Polynomial Data by Adding a Polynomial] Figure 10 is a flowchart explaining another operation of the QUBO matrix generation device 60. Step S1002 is the flow (Figure 7) explained in [Updating Polynomial Data by Adding a Term]. This section shows an example of adding two mathematical expressions. As an example, consider adding the term x4 + 2x2x4 + 3x1x2x3 to the polynomial 7x1 + 2x3 + 5x1x3 + 4x2x4 + x5x7 + 8x2x3x5 (see Figure 11). Following the code writing style of Table 1, this example assumes the following program.
[0060] As mentioned above, fixed-length arrays are prepared for the data up to the nth degree. In Figure 11, n=3. Data from the fourth degree onwards is not shown, but actually exists as empty data. A list of the data for the i-th degree of polynomial data A is i where i=1,2,...,n,n+1. As an exception, A n+1indicates a list of term data from the (n+1)th order onwards (data managed in the same way as the conventional method). For example, in the case of 7x1+2x3+5x1x3+4x2x4+x5x7+8x2x3x5 in Figure 11, A1=[7x1, 2x3], A2=[5x1x3, 4x2x4, x5x7], A3=[8x2x3x5], A4=[], etc. A4=[] means that there is no term data from the fourth order onwards, making it empty. Based on the above, the flow of addition between equations is shown below.
[0061] Polynomial data A to be added is obtained (step S1001). For all terms belonging to each Ai (i=1, 2, . . . , n+1), "term additional storage" is performed according to the flow of FIG. 7 (step S1002).
[0062] This concludes the explanation of "Updating polynomial data by adding a polynomial".
[0063] [Multiplication of Polynomials] Fig. 12 is a flowchart explaining another operation of the QUBO matrix generation device 60. Step S1206 is the flow explained in [Updating Polynomial Data by Adding Terms] (Fig. 7). In this section, we will explain how multiplication of mathematical expressions is performed. As an example, In multiplication, the variable can only take the values 0 and 1, so x i 2 =x i Following the code writing method in Table 1, this example assumes the following program.
[0064] In Figures 12 and 13, operations such as Union and Sort(Union([],[])) appear, which are the following operations. For two integer sequences P and Q, Sort(Union(P, Q)) is an integer sequence obtained by sorting the union of P and Q in ascending order. For example, Sort(Union([4,5],[1])) = [1,4,5], and Sort(Union([9,10],[9,11]) = [9,10,11]. As before, fixed-length arrays are prepared individually for the term data up to the nth degree. In Figure 13, n = 3. Also, although the third and subsequent degrees of data are not shown in the "formula to be multiplied" on the left side of Figure 13, they actually exist as null data. Also, A i is a list of the ith-order term data of polynomial data A, with the exception that A n+1 indicates a list of term data from degree n+1 onwards (data managed in the same way as the conventional method). Based on the above, the flow of multiplication of polynomial data is shown below.
[0065] First, polynomial data A and B are obtained (step 1201). Then, the following steps S1202 to S1206 are performed for all terms belonging to each Ai (i=1, 2, ..., n+1) and all terms belonging to each Bj (j=1, 2, ..., n+1).
[0066] The QUBO matrix generation unit 12 is i term belonging to A and B i term belonging to B (Step S1202). The QUBO matrix generation unit 12 multiplies the coefficient of term A Let idx be the integer sequence of the variable subscripts. A (Step S1203). The QUBO matrix generation unit 12 substitutes term B Let idx be the integer sequence of the variable subscripts. B (step S1204). The sorting unit 62 substitutes the result of Sort(Union(idx A , idx B )) and multiply the result by idx C(Step S1205). The QUBO matrix generation unit 12 performs "additional storage of terms" according to the flow of FIG. 7 based on the coefficients obtained in step S1202 and the integer sequence obtained in step S1205 (Step S1206).
[0067] This concludes the explanation of polynomial multiplication.
[0068] The above is the description of the first embodiment.
[0069] [Supplementary Note] In the above embodiment, the information for identifying a variable is described as a "subscript," but the information for identifying a variable is not limited to a subscript, and any information that can identify a variable may be used. In the above embodiment, the hash value calculation unit performs hash value calculation and remainder calculation, and the sorting unit performs union calculation of integer sequences and ascending sorting, but the functions of the hash value calculation unit and sorting unit may be performed by the QUBO matrix generation unit.
[0070] [Program, Recording Medium] The functions realized by the components described in this specification may be implemented in circuitry or processing circuitry, including general-purpose processors, application-specific processors, integrated circuits, ASICs (Application Specific Integrated Circuits), CPUs (Central Processing Units), conventional circuits, and / or combinations thereof, programmed to realize the described functions. A processor includes transistors and other circuits and is considered to be circuitry or processing circuitry. A processor may be a programmed processor that executes a program stored in a memory.
[0071] In this specification, a circuitry, unit, or means is hardware that is programmed to realize or performs the described functions, which may be any hardware disclosed herein or any hardware known to be programmed to realize or perform the described functions.
[0072] If the hardware is a processor considered to be a type of circuitry, the circuitry, means, or unit is a combination of the hardware and software used to configure the hardware and / or processor.
[0073] The various processes described above can be implemented by loading a program that executes each step of the above method into the recording unit 2020 of the computer 2000 shown in Figure 14, and operating the control unit 2010, input unit 2030, output unit 2040, display unit 2050, etc.
[0074] The program describing the processing contents can be recorded on a computer-readable recording medium, which may be, for example, a magnetic recording device, an optical disk, a magneto-optical recording medium, a semiconductor memory, or any other suitable recording medium.
[0075] The program may be distributed by, for example, selling, transferring, lending, etc. portable recording media such as DVDs and CD-ROMs on which the program is recorded. Furthermore, the program may be stored in a storage device of a server computer, and then transferred from the server computer to other computers via a network, thereby distributing the program.
[0076] A computer that executes such a program may first temporarily store the program recorded on a portable recording medium or transferred from a server computer in its own storage device. Then, when executing a process, the computer reads the program stored on its own recording medium and executes the process in accordance with the read program. Alternatively, the computer may read the program directly from a portable recording medium and execute the process in accordance with the program. Furthermore, the computer may execute the process in accordance with the program each time a program is transferred from a server computer to the computer. Alternatively, the server computer may not transfer the program to the computer, but may instead execute the process through a so-called ASP (Application Service Provider) service, which realizes the processing function by issuing an execution instruction and obtaining the results. Furthermore, the server computer may execute the process at the terminal using a so-called SaaS (Software as a Service) service, which allows users to use part of a server computer along with the program. In this embodiment, the program includes information used for processing by an electronic computer that is equivalent to a program (such as data that is not a direct instruction to a computer but has properties that dictate computer processing).
[0077] Furthermore, in this embodiment, the device is configured by executing a predetermined program on a computer, but at least a part of the processing contents may be realized by hardware.
[0078] 1, 6 Optimal solution search device 11 PUBO model input unit 12 QUBO matrix generation unit 13 Ising machine 14 Verification unit 15 PUBO model storage unit 16 QUBO matrix storage unit 60 QUBO matrix generation device 61 Hash value calculation unit 62 Sorting unit 2000 Computer 2010 Control unit 2020 Recording unit 2030 Input unit 2040 Output unit 2050 Display unit
Claims
1. A data structure for storing polynomials used to generate QUBO matrices, wherein m is a natural number, and each term of the polynomial consists of a coefficient and a product of one variable or m unique variables, and a term with m variables is called an m-th term, and the data structure for storing polynomials consists of n (n is a natural number) array-k (k=1, 2, ..., n), wherein the array-k has one or more array elements, and the array elements of the array-k are areas for storing identification information of the variables of the k-th term, and the array elements include k identifier areas in which the identification information is stored only in those areas.
2. A data structure for storing polynomials according to claim 1, wherein n=2 or 3.
3. A method for generating a QUBO matrix from a polynomial, wherein m is a natural number, each term of the polynomial consists of a coefficient and a single variable or a product of m unique variables, and a term with m variables is called an m-th order term, wherein the QUBO matrix generation unit generates n (n is a natural number) array-k (k=1, 2, ..., n), stores the k-th order term of the polynomial in the array-k, and generates a QUBO matrix using the array-k (k=1, 2, ..., n), wherein the array-k has one or more array elements, and the array elements of the array-k are areas for storing identification information of the variables of the k-th order terms, and include k identifier areas in which the identification information is stored only in those areas.
4. The QUBO matrix generation method according to claim 3, wherein n = 2 or 3.
5. A device for generating a QUBO matrix from a polynomial, wherein m is a natural number, and each term of the polynomial consists of a coefficient and a product of one variable or m unique variables, and a term with m variables is called an m-th term, the device includes a QUBO matrix generation unit that generates n (n is a natural number) array-k (k=1, 2, ..., n), stores the k-th term of the polynomial in the array-k, and generates a QUBO matrix using the array-k (k=1, 2, ..., n), where m is a natural number, and each array element of the array-k is an area for storing identification information of the variable of the k-th term, and includes k identifier areas in which the identification information is stored only in that area.
6. A QUBO matrix generation device according to claim 5, wherein n = 2 or 3.
7. A program for causing a computer to execute the method according to claim 3 or 4.
Citation Information
Patent Citations
Heuristic methods of converting higher order to quadratic polynomials in binary spaces
JP2021005363A
Polynomial transformation device, polynomial transformation method, and program
WO2022219769A1