Quantum solving method and device for one-out-of-three form SAT problem, electronic equipment and storage medium
By representing the initial variable in the three-take one-form SAT problem as a linear combination of the target variables, the SAT problem after dimensionality reduction is obtained, and the solution is determined using the target Hamiltonian, the problem of inefficiency of the SAT solver in the prior art is solved. A more efficient solution to SAT problem is achieved.
Patent Information
- Application Number
- CN202411513337.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-18
AI Technical Summary
The lack of SAT solvers in the prior art that can solve all SAT problems in polynomial time leads to inefficient solutions to SAT problems in various scenarios.
By representing the initial variable in the three-take one-form SAT problem as a linear combination of at least one target variable, the SAT problem after dimensionality reduction is obtained, and its corresponding target Hamiltonian is obtained, and the solution to the SAT problem is finally determined based on the target Hamiltonian. .
It effectively reduces the complexity of the SAT problem, accelerates convergence to the ground state, and improves the solution success rate of the three-take one-form SAT problem.
Smart Images

Figure CN119476517A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of quantum Boolean problems, and in particular to a quantum solution method, device, electronic device and storage medium for a SAT problem of the three-out-of-one form. Background Art
[0002] The Boolean Satisfiability Problem, or SAT, has received extensive attention in the fields of computer science, combinatorics, and logic. The N-SAT problem consists of N variables and logical expressions. The 3-SAT problem, as the first problem proved to be nondeterministic polynomial (NP) complete by the Cook-Leven theorem, means that all other NP problems can be converted to the 3-SAT problem in polynomial time. The 3-SAT problem is usually expressed in conjunctive normal form (CNF), with each clause consisting of the conjunction of three literals. Another form of expression is "one-in-three", which requires that exactly one literal in each clause is true. These two forms have been shown to be convertible to each other. The potential of quantum computing has led to the development of a variety of quantum algorithms that convert the 3-SAT problem into a ground state problem and solve it using various quantum ground state solvers.
[0003] Currently, researchers have developed a variety of SAT solvers suitable for solving 3-SAT problems in some scenarios, but there is a lack of SAT solvers that can solve all SAT problems in polynomial time. Therefore, providing a method that can solve SAT problems in various scenarios is an urgent problem to be solved. Summary of the invention
[0004] The present invention provides a quantum solution method, device, electronic device and storage medium for a SAT problem of the three-out-of-one form, which are used to solve the defect in the prior art that there is a lack of a SAT solver that can solve all SAT problems in polynomial time. By reducing the number of initial variables in the SAT problem of the three-out-of-one form, the complexity of the SAT problem is effectively reduced, thereby accelerating the convergence to the ground state and improving the success rate of solving the SAT problem of the three-out-of-one form.
[0005] The present invention provides a quantum solution method for a three-out-of-one SAT problem, comprising the following steps: Representing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a reduced-dimensional SAT problem, wherein the at least one target variable is a variable determined from all the initial variables corresponding to the three-out-of-one SAT problem; Obtaining a target Hamiltonian corresponding to the SAT problem after dimensionality reduction; A solution to the one-out-of-three SAT problem is determined according to the target Hamiltonian.
[0006] According to a quantum solution method for a three-out-of-one SAT problem provided by the present invention, each initial variable in the three-out-of-one SAT problem is expressed as a linear combination of at least one target variable to obtain a reduced-dimensional SAT problem, including: Obtaining a decision chain, the decision chain comprising a target variable set and a series of layers consisting of initial variables, each target variable in the target variable set remains unnumbered, each layer comprises a first part and a second part, the first part comprises variables belonging to the target variable set or appearing in the second part of a previous layer, the second part comprises initial variables numbered in sequence, each initial variable is connected with its corresponding number clause so that the value of each initial variable can be determined in sequence; According to the numbered clauses corresponding to the initial variables and the layer order of the decision chain, the values of the numbered initial variables in the second part of each layer are determined in turn to obtain the SAT problem after dimensionality reduction.
[0007] According to a quantum solution method for a three-out-of-one SAT problem provided by the present invention, the value of the numbered initial variable in the second part of each layer is determined in sequence according to the numbered clauses corresponding to the initial variables and the layer order of the decision chain to obtain the SAT problem after dimensionality reduction, including: Determine, according to the numbered clauses corresponding to the initial variables and the layer order of the decision chain, the relationship between the initial variables and the target variables in the target variable set; According to the relationship between the initial variables and the target variables, the numbered initial variables are represented as linear combinations of the at least one target variable to obtain the reduced-dimensional SAT problem, in which the number of initial variables is reduced relative to the one-out-of-three SAT problem.
[0008] According to a quantum solution method for a three-out-of-one SAT problem provided by the present invention, obtaining a target Hamiltonian corresponding to the SAT problem after dimensionality reduction includes: Determine an initial Hamiltonian according to a linear combination of at least one target variable corresponding to each of the initial variables, wherein the initial Hamiltonian is a Hamiltonian in a quadratic unconstrained binary optimization form, and when the SAT problem after dimensionality reduction has a solution, the ground state energy of the target Hamiltonian is zero; Adding a first target term to a first initial term in the initial Hamiltonian to obtain an updated Hamiltonian, wherein the first initial term is used to indicate a term represented by an unnumbered clause, and the first target term is used to ensure that the first initial term satisfies a condition; A second target term is added to a second initial term in the updated Hamiltonian to obtain the target Hamiltonian, wherein the second initial term is used to indicate a term including variables that are not in the target variable set, and the second target term is used to ensure the legitimacy of the variables that are not in the target variable set.
[0009] According to a quantum solution method for a three-out-of-one SAT problem provided by the present invention, determining a solution to the three-out-of-one SAT problem according to the target Hamiltonian includes: Solving the ground state of the SAT problem after dimensionality reduction according to the target Hamiltonian to obtain a target ground state, wherein the target ground state is used to characterize the ground state or approximate the ground state; Determine whether the target basis state corresponds to a set of target solutions of the one-out-of-three form SAT problem. If so, output the target solution. If not, return to the previous step to solve the target basis state again. If the target solution is not obtained after repeating the preset number of times, determine that the one-out-of-three form SAT problem has no solution.
[0010] According to a quantum solution method for a three-out-of-one SAT problem provided by the present invention, solving the ground state of the SAT problem after dimensionality reduction according to the target Hamiltonian to obtain the target ground state includes: Updating a target parameter in the target Hamiltonian to the square of the target parameter to obtain a modified Hamiltonian, wherein the target parameter is a parameter representing a variable state in the one-out-of-three SAT problem; The modified Hamiltonian is solved by a quantum annealing method to obtain the target ground state.
[0011] According to a quantum solution method for a three-out-of-one SAT problem provided by the present invention, before expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a reduced-dimensional SAT problem, the method further includes: Determine whether the text of all clauses in the three-out-of-one SAT problem is positive, and obtain a target ratio corresponding to the three-out-of-one SAT problem, where the target ratio is a ratio of a first quantity to a second quantity, where the first quantity is used to represent the number of clauses in the three-out-of-one SAT problem, and the second quantity is used to represent the number of initial variables in the three-out-of-one SAT problem; The step of expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a SAT problem after dimensionality reduction includes: When the literals of all clauses in the three-out-of-one SAT problem are positive and the target ratio is greater than 0.5 and less than 0.8, each initial variable in the three-out-of-one SAT problem is represented as a linear combination of at least one target variable to obtain a SAT problem after dimensionality reduction.
[0012] According to a quantum solution method for a three-out-of-one SAT problem provided by the present invention, the difference between the target ratio and 0.626 is not less than a preset threshold, and the not less than the preset threshold is used to characterize that the target ratio significantly deviates from 0.626.
[0013] According to a quantum solution method for a three-out-of-one SAT problem provided by the present invention, the number of the target variables is the difference between the first number and the second number.
[0014] The present invention also provides a quantum solution device for a three-out-of-one SAT problem, comprising the following modules: A variable representation module, used for representing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a SAT problem after dimensionality reduction, wherein the at least one target variable is a variable determined from all the initial variables corresponding to the three-out-of-one SAT problem; An energy acquisition module, used to obtain the target Hamiltonian corresponding to the SAT problem after dimensionality reduction; The problem solving module is used to determine the solution of the one-out-of-three SAT problem according to the target Hamiltonian.
[0015] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the processor implements a quantum solution method for the SAT problem of one-out-of-three form as described above.
[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a quantum solution method for a SAT problem of one-out-of-three form as described above.
[0017] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the quantum solution method for the SAT problem of one-out-of-three form as described above.
[0018] The quantum solution method, device, electronic device and storage medium of the three-out-of-one SAT problem provided by the present invention include expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a reduced-dimensional SAT problem; obtaining a target Hamiltonian corresponding to the reduced-dimensional SAT problem; and determining a solution to the three-out-of-one SAT problem according to the target Hamiltonian. By reducing the number of initial variables in the three-out-of-one SAT problem, the complexity of the SAT problem is effectively reduced, thereby accelerating convergence to the ground state and improving the success rate of solving the three-out-of-one SAT problem. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 It is a flow chart of the quantum solution method of the three-out-of-one SAT problem provided by the present invention.
[0021] Figure 2 It is a flowchart of the method for obtaining the SAT problem after dimensionality reduction provided by the present invention.
[0022] Figure 3 It is a flow chart of the method for obtaining the target Hamiltonian provided by the present invention.
[0023] Figure 4 It is a flow chart of the method for determining the solution of a SAT problem of one-out-of-three form provided by the present invention.
[0024] Figure 5 It is a flow chart of the method for obtaining the target ground state provided by the present invention.
[0025] Figure 6 It is a schematic diagram of the structure of a quantum device for a one-out-of-three SAT problem provided by the present invention.
[0026] Figure 7 It is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] The Boolean Satisfiability Problem, or SAT for short, has received widespread attention in the fields of computer science, combinatorial mathematics, and logic. SAT solvers can be used to verify the correctness of a program by converting the program's specifications into logical expressions. The SAT solver can be used to determine whether there are assignments that satisfy the specifications, thereby verifying whether the program meets the specifications. SAT solvers can also be used in Electronic Design Automation (EDA) design. It can help designers perform tasks such as logic synthesis, circuit layout and routing, and timing analysis. The N-SAT problem consists of N variables and logical expressions. The 3-SAT problem, as the first problem proved to be nondeterministic polynomial (NP) complete by the Cook-Levin theorem, means that all other NP problems can be converted to 3-SAT problems in polynomial time. The 3-SAT problem is usually expressed in conjunctive normal form (CNF), with each clause consisting of the conjunction of three literals. Another form of expression is "one-in-three", which requires that exactly one literal in each clause is true. These two forms have been shown to be convertible into each other. Researchers are committed to developing efficient SAT solvers for all 3-SAT problems. The DPLL solver, as the most famous classical SAT solver, finds solutions by repeatedly guessing, simplifying clauses, and backtracking. On this basis, the CDCL solver identifies the same conflicts caused by multiple guesses in the DPLL solver, derives new clauses through reasoning graphs, and speeds up the solution process. Since the advent of the CDCL solver, many modern SAT solvers have emerged to handle large-scale problems. However, no classical SAT solver can solve all SAT problems in polynomial time. The potential of quantum computing has prompted the development of a variety of quantum algorithms to transform 3-SAT problems into ground state solving problems and solve them using various quantum ground state solvers.
[0029] Currently, researchers have developed a variety of SAT solvers suitable for solving 3-SAT problems in some scenarios, but there is a lack of SAT solvers that can solve all SAT problems in polynomial time. Therefore, providing a method that can solve SAT problems in various scenarios is an urgent problem to be solved.
[0030] In view of this, an embodiment of the present invention provides a quantum solution method for a three-out-of-one SAT problem, by expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable, obtaining a reduced-dimensional SAT problem; obtaining a target Hamiltonian corresponding to the reduced-dimensional SAT problem; and determining a solution to the three-out-of-one SAT problem based on the target Hamiltonian. This method effectively reduces the complexity of the SAT problem by reducing the number of initial variables in the three-out-of-one SAT problem, thereby accelerating convergence to the ground state and improving the success rate of solving the three-out-of-one SAT problem.
[0031] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0032] Figure 1 : is a flow chart of the quantum solution method for the three-out-of-one SAT problem provided by the present invention. The quantum solution method for the three-out-of-one SAT problem can be applied to electronic devices, which can be various types of devices with information processing capabilities during implementation. For example, the electronic device can include a personal computer, a laptop computer, a PDA or a server, etc.; the electronic device can also be a mobile terminal, for example, the mobile terminal can include a mobile phone, a car computer, a tablet computer or a projector, etc. Figure 1 As shown, the method may include the following steps 101 to 103: Step 101: Represent each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a reduced-dimensional SAT problem, wherein the at least one target variable is a variable determined from all initial variables corresponding to the three-out-of-one SAT problem.
[0033] It should be noted that expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable can be by determining at least one target variable from all the initial variables corresponding to the three-out-of-one SAT problem, and then expressing all the variables in the three-out-of-one SAT problem by the at least one target variable.
[0034] It can be understood that the number of initial variables can be reduced by expressing each of all initial variables as a linear combination of at least one target variable, wherein the initial variables refer to the original variables in the three-out-of-one SAT problem.
[0035] Step 102: Obtain the target Hamiltonian corresponding to the SAT problem after dimensionality reduction.
[0036] It should be noted that after obtaining the SAT problem after dimensionality reduction, the Hamiltonian corresponding to the SAT problem after dimensionality reduction, i.e., the Hamiltonian of the simplified problem, can be constructed to obtain the target Hamiltonian. The target Hamiltonian can be obtained by constructing a Hamiltonian in the form of Quadratic Unconstrained Binary Optimization (QUBO).
[0037] For example, the formula of the Hamiltonian in the quadratic unconstrained binary optimization form can be as follows: in, is the linear representation of the i-th initial variable in the p-th clause, and is the linear representation of the ith initial variable. The first summation sign is about all unnumbered clauses, and the second summation sign is about all variables that are not initial variables. of.
[0038] It can be seen that after reducing the dimension of the three-out-of-one SAT problem to obtain the reduced-dimensional SAT problem and adjusting the Hamiltonian in the quantum SAT solver accordingly, the required quantum resources can be significantly reduced and the solution process can be accelerated.
[0039] Step 103: Determine a solution to the one-out-of-three SAT problem according to the target Hamiltonian.
[0040] It should be noted that, taking advantage of the huge potential of quantum computing, many quantum algorithms have been developed to solve the SAT problem. These algorithms transform the original SAT problem into a ground state problem so that it can be solved using a quantum ground state solver, such as quantum annealing, quantum approximate optimization algorithm, etc. Existing quantum SAT solvers mainly solve the SAT problem by minimizing the target Hamiltonian, that is, determining the solution of the three-out-of-one SAT problem.
[0041] Understandably, since it is observed that the characteristics of clauses as independent constraints in current quantum solvers are not fully exploited, in order to optimize quantum SAT solvers and reduce the complexity of the problem, we plan to use these clauses to express all the initial variables of the original one-in-three SAT problem as linear combinations of "target variables" through clauses, and solve the reduced-dimensional SAT problem with the reduced number of initial variables.
[0042] The present invention proposes a method for improving a quantum Boolean problem solver, especially for solving one-in-three SAT problems. Classical dimensionality reduction techniques can be applied to optimize the existing quantum one-in-three SAT solver, that is, firstly reducing the dimensionality of the three-out-of-one SAT problem. This method can effectively reduce the dimensionality of the search space and the complexity of the SAT problem by reducing the number of initial variables in the three-out-of-one SAT problem, thereby accelerating the convergence to the ground state and improving the success rate of solving the three-out-of-one SAT problem.
[0043] In some embodiments, before expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain the reduced-dimensional SAT problem, the method may also include: determining whether the text of all clauses in the three-out-of-one SAT problem is positive, and obtaining a target ratio corresponding to the three-out-of-one SAT problem, wherein the target ratio is a ratio of a first quantity to a second quantity, the first quantity being used to characterize the number of clauses in the three-out-of-one SAT problem, and the second quantity being used to characterize the number of initial variables in the three-out-of-one SAT problem.
[0044] The step of expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain the SAT problem after dimensionality reduction may include: when the literals of all clauses in the three-out-of-one SAT problem are positive and the target ratio is greater than 0.5 and less than 0.8, expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain the SAT problem after dimensionality reduction.
[0045] Furthermore, the difference between the target ratio and 0.626 is not less than a preset threshold, and the difference of not less than the preset threshold is used to indicate that the target ratio significantly deviates from 0.626.
[0046] Furthermore, the number of the target variable is the difference between the first number and the second number.
[0047] It should be noted that we first agree on the notation for one-in-three SAT problems. to indicate the number of clauses and variables in a one-in-three SAT problem. The first The literals and variables are represented as and The corresponding label is Indicates that .make Defined as follows, depending on whether the text is in positive or negative form or , thus ensuring .according to In the form of .
[0048] Among them, in the positive one-in-three SAT problem, when the literals in all clauses are positive, there is a key point, located at =0.626. When the value deviates significantly from 0.626, the probability of at least one solution will be close to 0 or 1, which makes these problems relatively easy to solve. Therefore, our main focus can be The ratio is between 0.5 and 0.8 for positive one-in-three SAT problems. Even better is when The case of significant deviation from 0.626, for example, when If the difference between the ratio and 0.626 is not less than 0.1, it means Significant deviation from 0.626.
[0049] It is understandable that by applying the classical optimization algorithm to reduce dimensionality, the dimension of the search space can be effectively reduced, thereby accelerating the convergence to the ground state and improving the success rate of the solution. Numerical simulation results reveal that when When the ratio is between 0.5 and 0.8, the number of "target variables" is approximately This method can effectively reduce the dimension of the search space and the complexity of the SAT problem by reducing the number of initial variables in the three-out-of-one SAT problem, thereby accelerating the convergence to the ground state and improving the success rate of solving the three-out-of-one SAT problem.
[0050] Figure 2 Schematic diagram of the method for obtaining the SAT problem after dimensionality reduction provided by the present invention. Figure 2 As shown, the step of expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a SAT problem after dimensionality reduction may include: Step 201: Obtain a decision chain, which includes a target variable set and a series of layers consisting of initial variables, each target variable in the target variable set remains unnumbered, and each layer includes a first part and a second part, the first part includes variables belonging to the target variable set or appearing in the second part of the previous layer, and the second part contains initial variables numbered in sequence, and each initial variable is connected with its corresponding numbering clause so that the value of each initial variable can be determined in sequence.
[0051] It should be noted that in the one-in-three SAT problem, exactly one of the three literals in the clause has a true value. Therefore, if the values of two variables in the clause are known, the value of the third variable can be determined by the following formula: Here, (i,j,k) is a permutation of (1,2,3). We can try to repeatedly exploit the relationship between these variables to reduce the number of unknown variables.
[0052] The steps of the classic dimensionality reduction algorithm can be as follows: First, build a "decisive chain" that contains the information needed to solve the reduced SAT problem. This "decisive chain" consists of two parts: a set of "initial variables" and a series of layers consisting of variables. The initial variables are not numbered and remain unnumbered throughout the process. Each layer consists of two parts, called the first part and the second part. The variables in the first part either belong to the target variable set or appear in the second part of the previous layer. The variables in the second part are numbered sequentially and connected to their corresponding numbered terms so that their values can be determined sequentially.
[0053] Step 202: According to the numbered clauses corresponding to the initial variables and the layer order of the decision chain, the values of the numbered initial variables in the second part of each layer are determined in turn to obtain the SAT problem after dimensionality reduction.
[0054] It should be noted that all variables can be represented by linear combinations of the "target variables". In this process, according to the order of the "decision chain", other initial variables are represented as linear combinations of the target variables according to the "decision chain".
[0055] Furthermore, determining the values of the numbered initial variables in the second part of each layer in turn according to the numbered clauses corresponding to the initial variables and the layer order of the decision chain to obtain the SAT problem after dimensionality reduction may include: determining the relationship between the initial variables and the target variables in the target variable set according to the numbered clauses corresponding to the initial variables and the layer order of the decision chain; expressing the numbered initial variables as linear combinations of at least one target variable according to the relationship between the initial variables and the target variables to obtain the SAT problem after dimensionality reduction, wherein the number of initial variables in the SAT problem after dimensionality reduction is reduced relative to that of the three-out-of-one SAT problem.
[0056] It should be noted that each variable can be expressed as a linear combination of the initial variable and the integer coefficient of the constant 1. Among them, the initial variable is updated to a linear combination of the target variable according to the decision chain. This process is carried out by determining the values of the numbered variables in the second part of each layer in the "deterministic chain" in sequence. Since each numbered variable corresponds to a numbered clause, it can be expressed as a linear combination of the other two variables in the clause and 1 using the properties of the decision chain. When the value of the "initial variable" has been determined, the linear combination represented by the initial variable can be determined one by one through such a pattern.
[0057] Throughout the process, the present invention uses clauses to reduce the number of initial variables. In general, a The initial variables and The problem of converting the clauses into a target variable, represents variables and new problem with clauses, where is the number of target variables.
[0058] It can be understood that by expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable, the number of initial variables in the three-out-of-one SAT problem can be reduced, thereby effectively reducing the dimension of the search space, accelerating convergence to the ground state, and improving the success rate of the solution.
[0059] Figure 3 is a flow chart of the method for obtaining the target Hamiltonian provided by the present invention. Figure 3 As shown, obtaining the target Hamiltonian corresponding to the SAT problem after dimensionality reduction may include: Step 301: Determine an initial Hamiltonian according to a linear combination of at least one target variable corresponding to each of the initial variables, wherein the initial Hamiltonian is a Hamiltonian in a quadratic unconstrained binary optimization form, and when the SAT problem has a solution after the dimensionality reduction, the ground state energy of the target Hamiltonian is zero.
[0060] Step 302: Add a first target term to a first initial term in the initial Hamiltonian to obtain an updated Hamiltonian, wherein the first initial term is used to indicate a term represented by an unnumbered clause, and the first target term is used to ensure that the first initial term satisfies a condition.
[0061] Step 303: Add a second target term to the second initial term in the updated Hamiltonian to obtain the target Hamiltonian, wherein the second initial term is used to indicate a term including variables that are not in the target variable set, and the second target term is used to ensure the legitimacy of the variables that are not in the target variable set.
[0062] It should be noted that based on the linear representation of the initial variables, a quadratic Hamiltonian involving only the “target variable” can be constructed. The ground state energy of this Hamiltonian is zero if and only if the SAT problem has a solution.
[0063] The target Hamiltonian consists of two types of terms. First, for terms represented by unnumbered clauses, corresponding terms are added to ensure that they hold. Second, for variables that are not in the initial set of variables, a term needs to be added to ensure the legitimacy of these variables.
[0064] It can be understood that supplementing the initial Hamiltonian with terms in the above manner can improve the accuracy of the obtained target Hamiltonian and lay the foundation for subsequent solutions.
[0065] Figure 4 1 is a flow chart of a method for determining a solution to a three-out-of-one SAT problem provided by the present invention. Figure 4 As shown, determining the solution of the one-out-of-three SAT problem according to the target Hamiltonian may include: Step 401: solving the ground state of the SAT problem after dimensionality reduction according to the target Hamiltonian to obtain a target ground state, where the target ground state is used to characterize the ground state or approximate the ground state.
[0066] It should be noted that there are many methods for solving the ground state of the SAT problem after dimensionality reduction according to the target Hamiltonian to obtain an approximate ground state. For example, the ground state solver of the quantum annealing algorithm (QAA), the variational quantum eigensolver (VQE), or the quantum approximate optimization algorithm (QAOA) can be used to solve it. The present invention does not limit the method for solving the ground state of the SAT problem after dimensionality reduction according to the target Hamiltonian to obtain an approximate ground state.
[0067] Step 402: Determine whether the target basis state corresponds to a set of target solutions of the one-out-of-three form SAT problem. If so, output the target solution. If not, return to the previous step to solve the target basis state again. If the target solution is not obtained after repeating a preset number of times, it is determined that the one-out-of-three form SAT problem has no solution.
[0068] It should be noted that it is determined whether the approximate ground state corresponds to a set of solutions to the original problem. If so, the solution is output. If not, step 401 is repeated until a certain number of repetitions, and then it is determined that the original problem has no solution.
[0069] It can be understood that, by adopting the above method to obtain the target ground state corresponding to the target Hamiltonian, and determining the solution of the one-out-of-three SAT problem according to the approximate ground state, the accuracy of the obtained solution of the one-out-of-three SAT problem can be improved.
[0070] In some embodiments, after obtaining the target Hamiltonian, the solution of the three-out-of-one SAT problem can be determined according to the target Hamiltonian by using an optimized quantum one-in-three SAT solver to obtain an approximate ground state. Specifically, the quantum annealing-based SAT problem solver can be optimized to determine the ground state corresponding to the target Hamiltonian, thereby finding a solution to the one-in-three SAT problem, which is described in detail below.
[0071] Figure 5 FIG. 1 is a flow chart of a method for obtaining a target ground state provided by the present invention. Figure 5 As shown, solving the ground state of the SAT problem after dimensionality reduction according to the target Hamiltonian to obtain the target ground state may include: Step 501: Update the target parameter in the target Hamiltonian to the square of the target parameter to obtain a modified Hamiltonian, wherein the target parameter is a parameter representing the state of the variable in the one-out-of-three SAT problem.
[0072] Step 502: Solve the modified Hamiltonian by a quantum annealing method to obtain the target ground state.
[0073] It should be noted that the quantum annealing (QA) method is very effective for solving the quadratic unconstrained binary optimization (QUBO) problem. In the present invention, the one-in-three SAT problem is transformed into a QUBO problem by expressing each initial variable in the three-out-of-three SAT problem as a linear combination of at least one target variable.
[0074] The Hamiltonian consists of two types of terms. Since the order of both types of terms is at most 2, and since yes The linear combination of and 1, the Hamiltonian that ensures that the SAT problem is true can be expressed as: The formula represents the quadratic term corresponding to the Hamiltonian and the coefficient of the linear term. Can only take the value of 0 or 1, so Therefore, we can use in the Hamiltonian Alternative , and obtain the modified quadratic Hamiltonian:
[0075] ,
[0076] in Ignore the constant , which is the standard form of the Hamiltonian for the QUBO problem. Therefore, we can solve the QUBO problem by repeatedly applying the quantum annealing method.
[0077] It can be understood that the new quantum annealing-based solver of the present invention solves the ground state of the target Hamiltonian in QUBO form, which can improve the accuracy of determining the solution of the one-out-of-three SAT problem.
[0078] It should be added that the ground state solution is not limited to a specific solver. For example, the quantum annealing solver can be used to solve the ground state Hamiltonian, and the coherent alien machine is also an option.
[0079] Based on the quantum solution method for the one-out-of-three SAT problem provided by the present invention, the quantum resources required by the new quantum SAT solver are calculated and compared with the solver without classical reduction. Our results show that the resource requirements of qubits can be reduced in the quantum annealing (QA) based solver. The required gate resources are quadratically related to the problem size, and only increase by a factor n at most compared to its classical counterpart. We also verify the feasibility of the new quantum solver by numerical simulation of randomly generated forward one-in-three SAT problems. By integrating our analytical results and simulation data, we aim to show the potential application prospects of the algorithm in the era of noisy intermediate-scale quantum computing (NISQ).
[0080] Based on the foregoing embodiments, an embodiment of the present invention provides a quantum solution device for a SAT problem of the three-out-of-one form. Each module included in the device and each unit included in each module can be implemented by a processor; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0081] The quantum device for the SAT problem of one-out-of-three form provided by the present invention is described below. The quantum device for the SAT problem of one-out-of-three form described below and the quantum method for the SAT problem of one-out-of-three form described above can be referenced to each other.
[0082] Figure 6 Schematic diagram of the structure of the quantum device for the three-out-of-one SAT problem provided by the present invention. Figure 6 As shown, the device 600 includes a variable representation module 601, an energy acquisition module 602 and a problem solving module 603, wherein: A variable representation module 601 is used to represent each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a reduced-dimensional SAT problem, wherein the at least one target variable is a variable determined from all the initial variables corresponding to the three-out-of-one SAT problem; An energy acquisition module 602 is used to obtain a target Hamiltonian corresponding to the SAT problem after dimensionality reduction; The problem solving module 603 is used to determine a solution to the one-out-of-three SAT problem according to the target Hamiltonian.
[0083] In some embodiments, the variable representation module 601 includes a first acquisition unit and a question acquisition unit, wherein:
[0084] The first acquisition unit is used to acquire a decision chain, the decision chain includes a target variable set and a series of layers consisting of initial variables, each target variable in the target variable set remains in an unnumbered state, each layer includes a first part and a second part, the first part includes variables belonging to the target variable set or appearing in the second part of a previous layer, and the second part includes initial variables numbered in sequence, and each initial variable is connected with its corresponding number clause so that the value of each initial variable can be determined in sequence; The problem acquisition unit is used to determine the values of the numbered initial variables in the second part of each layer in turn according to the numbered clauses corresponding to the initial variables and the layer order of the decision chain, so as to obtain the SAT problem after dimensionality reduction.
[0085] In some embodiments, the problem acquisition unit is specifically used to: determine the relationship between each initial variable and each target variable in the target variable set according to the numbered clauses corresponding to each initial variable and the layer order of the decision chain; based on the relationship between each initial variable and each target variable, represent the numbered initial variables as a linear combination of at least one target variable to obtain the reduced-dimensionality SAT problem, wherein the number of initial variables in the reduced-dimensionality SAT problem is reduced relative to that in the three-out-of-one SAT problem.
[0086] In some embodiments, the energy acquisition module 602 is specifically used to: determine an initial Hamiltonian based on a linear combination of at least one target variable corresponding to each initial variable, the initial Hamiltonian is a Hamiltonian in a quadratic unconstrained binary optimization form, and when the SAT problem has a solution after the dimensionality reduction, the ground state energy of the target Hamiltonian is zero; add a first target term to the first initial term in the initial Hamiltonian to obtain an updated Hamiltonian, the first initial term is used to indicate the term represented by an unnumbered clause, and the first target term is used to ensure that the first initial term satisfies a condition; add a second target term to the second initial term in the updated Hamiltonian to obtain the target Hamiltonian, the second initial term is used to indicate the term including variables that are not in the target variable set, and the second target term is used to ensure the legitimacy of the variables that are not in the target variable set.
[0087] In some embodiments, the problem solving module 603 includes a base state acquisition unit and a solution determination unit, wherein:
[0088] The ground state acquisition unit is used to solve the ground state of the SAT problem after dimensionality reduction according to the target Hamiltonian to obtain a target ground state, where the target ground state is used to characterize the ground state or the approximate ground state; The solution judgment unit is used to judge whether the target basis state corresponds to a set of target solutions of the three-out-of-one SAT problem. If so, the target solution is output; if not, it returns to the previous step to solve the target basis state again. If the target solution is not obtained after repeating a preset number of times, it is determined that the three-out-of-one SAT problem has no solution.
[0089] In some embodiments, the ground state acquisition unit is specifically used to: update the target parameter in the target Hamiltonian to the square of the target parameter to obtain a modified Hamiltonian, wherein the target parameter is a parameter representing the state of the variable in the three-out-of-one SAT problem; and solve the modified Hamiltonian by a quantum annealing method to obtain the target ground state.
[0090] In some embodiments, the device further includes a problem determination module, the problem determination module being used to: determine whether the text of all clauses in the three-out-of-one SAT problem is positive, and obtain a target ratio corresponding to the three-out-of-one SAT problem, the target ratio being a ratio of a first quantity to a second quantity, the first quantity being used to characterize the number of clauses in the three-out-of-one SAT problem, and the second quantity being used to characterize the number of initial variables in the three-out-of-one SAT problem; The variable representation module 601 is also used for: when the text of all clauses in the three-out-of-one SAT problem is positive and the target ratio is greater than 0.5 and less than 0.8, each initial variable in the three-out-of-one SAT problem is represented as a linear combination of at least one target variable to obtain a SAT problem after dimensionality reduction.
[0091] In some embodiments, the difference between the target ratio and 0.626 is not less than a preset threshold, and the difference of not less than the preset threshold is used to indicate that the target ratio significantly deviates from 0.626.
[0092] In some embodiments, the quantity of the target variable is the difference between the first quantity and the second quantity.
[0093] In an embodiment of the present invention, by reducing the number of initial variables in the three-out-of-one SAT problem, the complexity of the SAT problem is effectively reduced, thereby accelerating convergence to the ground state and improving the success rate of solving the three-out-of-one SAT problem.
[0094] Figure 7 Schematic diagram of the physical structure of the electronic device provided by the present invention. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute a quantum solution method for a three-out-of-one SAT problem, the method comprising: expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a reduced-dimensional SAT problem, wherein the at least one target variable is a variable determined from all initial variables corresponding to the three-out-of-one SAT problem; obtaining a target Hamiltonian corresponding to the reduced-dimensional SAT problem; and determining a solution to the three-out-of-one SAT problem according to the target Hamiltonian.
[0095] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0096] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the quantum solution method for the three-out-of-one SAT problem provided by the above methods, and the method includes: expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a reduced-dimensional SAT problem, wherein the at least one target variable is a variable determined from all initial variables corresponding to the three-out-of-one SAT problem; obtaining a target Hamiltonian corresponding to the reduced-dimensional SAT problem; and determining a solution to the three-out-of-one SAT problem based on the target Hamiltonian.
[0097] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0098] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the quantum solution method for the three-out-of-one SAT problem provided by the above methods, the method comprising: expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a reduced-dimensional SAT problem, wherein the at least one target variable is a variable determined from all initial variables corresponding to the three-out-of-one SAT problem; obtaining a target Hamiltonian corresponding to the reduced-dimensional SAT problem; and determining a solution to the three-out-of-one SAT problem based on the target Hamiltonian.
[0099] The above-mentioned computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0100] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0101] The program code embodied on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
[0102] Computer program code for performing the operations of the present specification may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0103] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A quantum solution method for a three-out-of-one SAT problem, characterized in that: include: Representing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a reduced-dimensional SAT problem, wherein the at least one target variable is a variable determined from all the initial variables corresponding to the three-out-of-one SAT problem; Obtaining a target Hamiltonian corresponding to the SAT problem after dimensionality reduction; A solution to the one-out-of-three SAT problem is determined according to the target Hamiltonian.
2. The quantum solution method for the three-out-of-one SAT problem according to claim 1 is characterized in that: The step of expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a SAT problem after dimensionality reduction includes: Obtaining a decision chain, the decision chain comprising a target variable set and a series of layers consisting of initial variables, each target variable in the target variable set remains unnumbered, each layer comprises a first part and a second part, the first part comprises variables belonging to the target variable set or appearing in the second part of a previous layer, the second part comprises initial variables numbered in sequence, each initial variable is connected with its corresponding number clause so that the value of each initial variable can be determined in sequence; According to the numbered clauses corresponding to the initial variables and the layer order of the decision chain, the values of the numbered initial variables in the second part of each layer are determined in turn to obtain the SAT problem after dimensionality reduction.
3. The quantum solution method for the three-out-of-one SAT problem according to claim 2 is characterized in that: The step of determining the values of the numbered initial variables in the second part of each layer in sequence according to the numbered clauses corresponding to the initial variables and the layer order of the decision chain to obtain the SAT problem after dimensionality reduction includes: Determine, according to the numbered clauses corresponding to the initial variables and the layer order of the decision chain, the relationship between the initial variables and the target variables in the target variable set; According to the relationship between the initial variables and the target variables, the numbered initial variables are represented as linear combinations of the at least one target variable to obtain the reduced-dimensional SAT problem, in which the number of initial variables is reduced relative to the one-out-of-three SAT problem.
4. The quantum solution method for the three-out-of-one SAT problem according to claim 2 is characterized in that: The obtaining of the target Hamiltonian corresponding to the SAT problem after dimensionality reduction includes: Determine an initial Hamiltonian according to a linear combination of at least one target variable corresponding to each of the initial variables, wherein the initial Hamiltonian is a Hamiltonian in a quadratic unconstrained binary optimization form, and when the SAT problem after dimensionality reduction has a solution, the ground state energy of the target Hamiltonian is zero; Adding a first target term to a first initial term in the initial Hamiltonian to obtain an updated Hamiltonian, wherein the first initial term is used to indicate a term represented by an unnumbered clause, and the first target term is used to ensure that the first initial term satisfies a condition; A second target term is added to a second initial term in the updated Hamiltonian to obtain the target Hamiltonian, wherein the second initial term is used to indicate a term including variables that are not in the target variable set, and the second target term is used to ensure the legitimacy of the variables that are not in the target variable set.
5. The quantum solution method for the three-out-of-one SAT problem according to claim 1 is characterized in that: Determining a solution to the one-out-of-three SAT problem according to the target Hamiltonian includes: Solving the ground state of the SAT problem after dimensionality reduction according to the target Hamiltonian to obtain a target ground state, wherein the target ground state is used to characterize the ground state or approximate the ground state; Determine whether the target basis state corresponds to a set of target solutions of the one-out-of-three form SAT problem. If so, output the target solution. If not, return to the previous step to solve the target basis state again. If the target solution is not obtained after repeating the preset number of times, determine that the one-out-of-three form SAT problem has no solution.
6. The quantum solution method of the three-out-of-one SAT problem according to claim 5 is characterized in that: Solving the ground state of the SAT problem after dimensionality reduction according to the target Hamiltonian to obtain the target ground state includes: Updating a target parameter in the target Hamiltonian to the square of the target parameter to obtain a modified Hamiltonian, wherein the target parameter is a parameter representing a variable state in the one-out-of-three SAT problem; The modified Hamiltonian is solved by a quantum annealing method to obtain the target ground state.
7. The quantum solution method for the three-out-of-one SAT problem according to claim 1 is characterized in that: Before expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a SAT problem after dimensionality reduction, the method further includes: Determine whether the text of all clauses in the three-out-of-one SAT problem is positive, and obtain a target ratio corresponding to the three-out-of-one SAT problem, where the target ratio is a ratio of a first quantity to a second quantity, where the first quantity is used to represent the number of clauses in the three-out-of-one SAT problem, and the second quantity is used to represent the number of initial variables in the three-out-of-one SAT problem; The step of expressing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a SAT problem after dimensionality reduction includes: When the literals of all clauses in the three-out-of-one SAT problem are positive and the target ratio is greater than 0.5 and less than 0.8, each initial variable in the three-out-of-one SAT problem is represented as a linear combination of at least one target variable to obtain a SAT problem after dimensionality reduction.
8. The quantum solution method of the three-out-of-one SAT problem according to claim 7 is characterized in that: The difference between the target ratio and 0.626 is not less than a preset threshold, and the not less than the preset threshold is used to indicate that the target ratio significantly deviates from 0.
626.
9. The quantum solution method of the three-out-of-one SAT problem according to claim 8 is characterized in that: The quantity of the target variable is the difference between the first quantity and the second quantity.
10. A quantum solution device for a three-out-of-one SAT problem, characterized in that: include: A variable representation module, used for representing each initial variable in the three-out-of-one SAT problem as a linear combination of at least one target variable to obtain a SAT problem after dimensionality reduction, wherein the at least one target variable is a variable determined from all the initial variables corresponding to the three-out-of-one SAT problem; An energy acquisition module, used to obtain the target Hamiltonian corresponding to the SAT problem after dimensionality reduction; The problem solving module is used to determine the solution of the one-out-of-three SAT problem according to the target Hamiltonian.
11. 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 computer program, the quantum solution method for the one-out-of-three SAT problem as claimed in any one of claims 1 to 9 is implemented.
12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the quantum solution method for the SAT problem of the one-out-of-three form as claimed in any one of claims 1 to 9 is implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the quantum solution method for the SAT problem of the one-out-of-three form as claimed in any one of claims 1 to 9 is implemented.