Quantum solution methods, devices, electronic equipment, and storage media for the one-out-of-three SAT problem.
By transforming the one-out-of-three SAT problem into an objective 2-SAT problem and using quantum computing methods to solve for the ground state of the Hamiltonian, the problem of not being able to solve the SAT problem in polynomial time in existing technologies is solved, thus improving the success rate of the solution.
Patent Information
- Application Number
- CN202411513313.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2044-10-28
AI Technical Summary
Current technology lacks SAT solvers capable of solving all SAT problems in polynomial time, especially 3-SAT problems.
By updating the solution space of the three-choice SAT problem to the target solution space, it is transformed into a target 2-SAT problem. The constraints are relaxed, the target Hamiltonian is obtained, and the ground state of the target Hamiltonian is solved using quantum computing methods, thereby reducing the complexity of the problem.
It effectively reduces the dimensionality of the search space, improves the success rate of solving the one-out-of-three SAT problem, and can solve the SAT problem in polynomial time.
Smart Images

Figure CN119476516B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quantum computer technology, and in particular to a quantum solution method, apparatus, electronic device, and storage medium for the one-out-of-three SAT problem. Background Technology
[0002] The Boolean Satisfiability Problem (SAT) has garnered significant attention in computer science, combinatorics, and logic. The N-SAT problem consists of N variables and a logical expression. The 3-SAT problem, the first problem proven by the Cook-Levin theorem to be nondeterministic polynomial (NP) complete, implies that all other NP problems can be transformed into 3-SAT problems in polynomial time. The 3-SAT problem is typically represented in conjunctive normal form (CNF), where each clause consists of the conjunction of three literals. Another representation is the "one-in-three" form, requiring exactly one literal in each clause to be true. These two forms have been proven to be interconvertible. The potential of quantum computing has spurred the development of various quantum algorithms to transform the 3-SAT problem into a ground-state solution problem, which can then be solved using various quantum ground-state solvers.
[0003] Researchers have developed various SAT solvers suitable for solving 3-SAT problems in certain scenarios, but a SAT solver capable of solving all SAT problems in polynomial time is lacking. Therefore, providing a method capable of solving SAT problems in various scenarios is a pressing issue. Summary of the Invention
[0004] This invention provides a quantum solution method, apparatus, electronic device, and storage medium for the one-out-of-three SAT problem, which addresses the deficiency in the prior art of lacking a SAT solver capable of solving all SAT problems in polynomial time. By effectively reducing the dimensionality of the search space, the complexity of the SAT problem is reduced, thereby accelerating convergence to the ground state and improving the success rate of solving the one-out-of-three SAT problem.
[0005] This invention provides a quantum solution method for the one-out-of-three SAT problem, comprising the following steps:
[0006] The solution space of the three-choice SAT problem is updated to the target solution space to obtain the target 2-SAT problem. The target solution space corresponds to the solution space of the relaxed problem, which includes clauses that relax constraints.
[0007] Obtain the target Hamiltonian corresponding to the objective 2-SAT problem;
[0008] The solution to the one-out-of-three SAT problem is determined based on the target Hamiltonian.
[0009] According to the present invention, a quantum solution method for the 3-out-of-1 SAT problem is provided, wherein updating the solution space of the 3-out-of-1 SAT problem to a target solution space to obtain the target 2-SAT problem includes:
[0010] The constraints of the clauses in the three-out-of-three SAT problem are updated from the initial conditions to the target conditions to obtain relaxed clauses. The initial condition is that if only one of the three variables in a clause is 1, then the clause is considered to satisfy the condition. The target condition is that if the number of 1s in the three variables in a clause is odd, then the clause is considered to satisfy the condition.
[0011] By adding restrictions to the relaxed clause, the objective 2-SAT problem is obtained, wherein the restrictions include that two problems in the same clause cannot be true at the same time.
[0012] According to the quantum solution method for the three-out-of-three SAT problem provided by the present invention, the relaxed clause Represented as:
[0013] ,in This indicates three clauses;
[0014] The solution to the relaxation problem is expressed as:
[0015] ,in, Let A represent the initial 0-1 clause matrix determined by the one-out-of-three SAT problem. This indicates that the vector is selected as an arbitrary n-dimensional 0-1 vector. It is the initial clause matrix The rank of a is equal to the number of independent clauses modulo 2. This indicates an additional offset or correction.
[0016] According to the present invention, a quantum solution method for the one-out-of-three SAT problem is provided, wherein determining the solution to the one-out-of-three SAT problem based on the target Hamiltonian includes:
[0017] The ground state of the objective 2-SAT problem is obtained by solving the objective Hamiltonian, and the objective ground state is used to characterize the ground state or an approximate ground state.
[0018] Determine whether the target ground state corresponds to a set of target solutions for the three-out-of-three SAT problem. If yes, output the target solution. If not, return to the previous step and solve the target ground state again. If the target solution is not obtained after repeating the process a preset number of times, it is determined that the three-out-of-three SAT problem has no solution.
[0019] According to the present invention, a quantum solution method for a three-out-of-three SAT problem is provided, wherein the step of solving the ground state of the target 2-SAT problem based on the target Hamiltonian to obtain the target ground state includes:
[0020] Obtain a quantum circuit, wherein all quantum states represented by the quantum circuit lie within the solution space of the relaxed problem;
[0021] When both literals in the clause of the relaxed problem are true, the target Hamiltonian is determined to include a penalty term, which is used to ensure that cases where the clause is not satisfied are penalized in terms of energy.
[0022] The target ground state corresponding to the target Hamiltonian is obtained by minimizing the energy of the target Hamiltonian.
[0023] According to the present invention, a quantum solution method for a three-out-of-three SAT problem is provided, wherein the step of solving the ground state of the target 2-SAT problem based on the target Hamiltonian to obtain the target ground state includes:
[0024] Determine the target Hamiltonian, which is the negative value of the Hamiltonian in the variable quantum feature solver;
[0025] The target ground state is determined by evaluating whether the maximum eigenvalue of the target Hamiltonian is equal to zero, and the target ground state tends to the maximum eigenvalue of the target Hamiltonian.
[0026] According to the quantum solution method for the one-out-of-three SAT problem provided by the present invention, the step of determining the target ground state by evaluating whether the largest eigenvalue of the target Hamiltonian is equal to zero includes:
[0027] A first quantum circuit is obtained, which is composed of alternating sequences of first and second quantum gates;
[0028] The target ground state is determined based on the first quantum gate sequence and the second quantum gate sequence.
[0029] According to the quantum solution method for the one-out-of-three SAT problem provided by the present invention, the step of determining the target ground state by evaluating whether the largest eigenvalue of the target Hamiltonian is equal to zero includes:
[0030] Obtain a second quantum circuit, wherein the number of layers of the target solver corresponding to the second quantum circuit is lower than a preset layer threshold;
[0031] By optimizing the number of parameters of the objective solver, an objective function is obtained, which is to maximize the objective Hamiltonian, and the number of objectives is twice the number of layers;
[0032] The target ground state is obtained by measuring the states of all qubits of the output state of the second quantum circuit using the target solver.
[0033] According to the quantum solution method for the 3-out-of-1 SAT problem provided by the present invention, before updating the solution space of the 3-out-of-1 SAT problem to the target solution space to obtain the target 2-SAT problem, the method further includes:
[0034] Determine whether all clauses in the three-out-of-one SAT problem are positive, and obtain the target ratio corresponding to the three-out-of-one SAT problem. The target ratio is the ratio of a first quantity to a second quantity. 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 variables in the three-out-of-one SAT problem.
[0035] The process of updating the solution space of the one-out-of-three SAT problem to the target solution space, resulting in the target 2-SAT problem, includes:
[0036] In the three-choice SAT problem, if all clauses are positive and the target ratio is greater than 0.5 and less than 0.8, the solution space of the three-choice SAT problem is updated to the target solution space, resulting in the target 2-SAT problem.
[0037] According to the quantum solution method for the three-out-of-three 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 difference is used to characterize that the target ratio deviates significantly from 0.626.
[0038] According to the present invention, a quantum solution method for the SAT problem in the form of a three-out-of-three choice is provided, wherein the dimension of the target solution space is 2 raised to the third power, and the third power is equal to the difference between the second power and the first power.
[0039] The present invention also provides a quantum solution device for the one-out-of-three SAT problem, comprising the following modules:
[0040] The problem dimensionality reduction module is used to update the solution space of the three-choice SAT problem to the target solution space, thereby obtaining the target 2-SAT problem. The target solution space corresponds to the solution space of the relaxed problem, which includes clauses that relax constraints.
[0041] The energy acquisition module is used to acquire the target Hamiltonian corresponding to the target 2-SAT problem;
[0042] The solution determination module is used to determine the solution to the one-out-of-three SAT problem based on the target Hamiltonian.
[0043] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a quantum solution method for the one-out-of-three SAT problem as described above.
[0044] The present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a quantum solution method for the one-out-of-three SAT problem as described above.
[0045] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a quantum solution method for the one-out-of-three SAT problem as described above.
[0046] The quantum solution method, apparatus, electronic device, and storage medium for the one-out-of-three SAT problem provided by this invention reduce the complexity of the SAT problem by effectively reducing the dimensionality of the search space, thereby accelerating convergence to the ground state and improving the success rate of solving the one-out-of-three SAT problem. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0048] Figure 1 This is a flowchart illustrating the quantum solution method for the SAT problem in the form of the three-out-of-three choice provided by this invention.
[0049] Figure 2 This is a flowchart illustrating the method for obtaining the target 2-SAT problem provided by the present invention.
[0050] Figure 3 This is a flowchart illustrating the method for determining the solution to the SAT problem in the form of a three-out-of-three choice, provided by the present invention.
[0051] Figure 4 This is one of the flowcharts illustrating the method for obtaining an approximate ground state provided by the present invention.
[0052] Figure 5 This is the second schematic flowchart of the method for obtaining an approximate ground state provided by the present invention.
[0053] Figure 6 This is the third flowchart of the method for obtaining an approximate ground state provided by the present invention.
[0054] Figure 7 This is a schematic diagram of the quantum solution device for the three-out-of-three SAT problem provided by the present invention.
[0055] Figure 8 This is a schematic diagram of the physical structure of the electronic device provided by the present invention. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0057] The Boolean Satisfiability Problem (SAT) is widely studied in computer science, combinatorics, and logic. SAT solvers can be used to verify the correctness of programs by converting program specifications into logical expressions. The SAT solver determines whether there are assignments that satisfy the specifications, thus verifying whether the program meets the requirements. SAT solvers can also be used in Electronic Design Automation (EDA) design. They can assist designers in logic synthesis, circuit placement and routing, and timing analysis. N-SAT problems consist of N variables and logical expressions. The 3-SAT problem, as the first problem proven by the Cook-Levin theorem to be nondeterministic polynomial (NP) complete, means that all other NP problems can be transformed into 3-SAT problems in polynomial time. 3-SAT problems are typically represented using conjunctive normal form (CNF), where each clause consists of the conjunction of three literals. Another representation is "one-in-three," requiring that exactly one literal in each clause is true. These two forms have been proven to be interconvertible. Researchers are dedicated to developing efficient SAT solvers applicable to all 3-SAT problems. The DPLL solver, the most famous classical SAT solver, finds solutions through iterative guessing, clause simplification, and backtracking. The CDCL solver builds upon this by identifying the same conflicts caused by multiple guesses in the DPLL solver and deriving new clauses through a reasoning graph, thus accelerating the solution process. Since the advent of the CDCL solver, numerous modern SAT solvers have emerged to handle large-scale problems. However, to date, no classical SAT solver can solve all SAT problems in polynomial time. The potential of quantum computing has spurred the development of various quantum algorithms that transform 3-SAT problems into ground-state problem-solving problems, utilizing various quantum ground-state solvers.
[0058] Researchers have developed various SAT solvers suitable for solving 3-SAT problems in certain scenarios, but a SAT solver capable of solving all SAT problems in polynomial time is lacking. Therefore, providing a method capable of solving SAT problems in various scenarios is a pressing issue.
[0059] In view of this, embodiments of the present invention provide a quantum solution method for the one-out-of-three SAT problem. This method involves updating the solution space of the one-out-of-three SAT problem to a target solution space, thereby obtaining a target 2-SAT problem. The target solution space corresponds to the solution space of a relaxed problem, which includes clauses that relax constraints. The method then obtains the target Hamiltonian corresponding to the target 2-SAT problem and determines the solution to the one-out-of-three SAT problem based on the target Hamiltonian. This method effectively reduces the dimensionality of the search space, lowers the complexity of the SAT problem, accelerates convergence to the ground state, and improves the success rate of solving the one-out-of-three SAT problem.
[0060] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention.
[0061] Figure 1 This is a flowchart illustrating the quantum solution method for the one-out-of-three SAT problem provided by this invention. The quantum solution method for the one-out-of-three SAT problem can be applied to electronic devices, which can be various types of devices with information processing capabilities. For example, the electronic device may include a personal computer, laptop, handheld computer, or server; the electronic device may also be a mobile terminal, such as a mobile phone, in-vehicle computer, tablet computer, or projector. Figure 1 As shown, the method may include the following steps 101 to 103:
[0062] Step 101: Update the solution space of the three-choice SAT problem to the target solution space to obtain the target 2-SAT problem. The target solution space corresponds to the solution space of the relaxed problem, which includes clauses that relax constraints.
[0063] It should be noted that updating the solution space of the three-choice SAT problem to the target solution space and obtaining the target 2-SAT problem can be done by relaxing the constraints of the relaxation clause to obtain the relaxation clause, obtaining the relaxation problem from the relaxation clause, and determining the solution space corresponding to the relaxation problem as the target solution space.
[0064] It is understandable that setting the solution space to the solution space of the "relaxed problem" is equivalent to performing a classic dimensionality reduction on the one-in-three SAT problem in the form of a three-choice problem, resulting in a 2-SAT problem.
[0065] Step 102: Obtain the target Hamiltonian corresponding to the target 2-SAT problem.
[0066] It should be noted that after obtaining the objective 2-SAT problem, the Hamiltonian corresponding to the objective 2-SAT problem generated after dimensionality reduction can be constructed.
[0067] For example, the formula for the Hamiltonian corresponding to the Objective 2-SAT problem can be as follows:
[0068]
[0069]
[0070] .
[0071] in, Let be the label of the i-th variable in the p-th rule, and Whether the i-th character of the p-th rule is a positive or negative variable is determined by this. For pauli Z observable measurement.
[0072] It is evident that by reducing the dimensionality of the three-out-of-three SAT problem to obtain the objective 2-SAT problem, and by adjusting the Hamiltonian in the quantum SAT solver accordingly, the required quantum resources can be significantly reduced and the solution process can be accelerated.
[0073] Step 103: Determine the solution to the one-out-of-three SAT problem based on the target Hamiltonian.
[0074] It should be noted that, leveraging the enormous potential of quantum computing, many quantum algorithms have been developed to solve the 2-SAT problem. These algorithms transform the original SAT problem into a ground-state problem, which can then be solved using quantum ground-state solvers, such as quantum annealing and quantum approximation optimization algorithms. Existing quantum SAT solvers primarily solve the 2-SAT problem by minimizing the aforementioned Hamiltonian.
[0075] Understandably, the property of clauses as independent constraints in current quantum solvers is not fully exploited. To optimize the quantum SAT solver and reduce problem complexity, we plan to utilize these clauses to transform the original one-in-three SAT problem into solving a 2-SAT problem in the solution space of a "relaxed problem".
[0076] This invention proposes an improved method for solving quantum Boolean problems, particularly for solving one-in-three SAT problems. Classical dimensionality reduction techniques can be applied to optimize existing quantum one-in-three SAT solvers. Specifically, the dimensionality of the one-in-three SAT problem is first reduced. This method effectively reduces the dimension of the search space, lowers the complexity of the SAT problem, accelerates convergence to the ground state, and improves the success rate of solving the one-in-three SAT problem.
[0077] In some embodiments, before updating the solution space of the one-out-of-three SAT problem to the target solution space to obtain the target 2-SAT problem, the method may further include: determining whether the literals of all clauses in the one-out-of-three SAT problem are positive, and obtaining the target ratio corresponding to the one-out-of-three SAT problem, wherein the target ratio is the ratio of a first quantity to a second quantity, the first quantity being used to characterize the number of clauses in the one-out-of-three SAT problem, and the second quantity being used to characterize the number of variables in the one-out-of-three SAT problem.
[0078] The step of updating the solution space of the one-out-of-three SAT problem to the target solution space to obtain the target 2-SAT problem may include: when all clauses in the one-out-of-three SAT problem are positive and the target ratio is greater than 0.5 and less than 0.8, the solution space of the one-out-of-three SAT problem is updated to the target solution space to obtain the target 2-SAT problem.
[0079] Furthermore, 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 deviates significantly from 0.626.
[0080] Furthermore, the dimension of the target solution space is 2 raised to the third power, and the third power is equal to the difference between the second power and the first power.
[0081] It should be noted that, firstly, a notation for one-in-three SAT questions should be agreed upon. Variables should be used. This represents the number of clauses and variables in a one-in-three SAT question. The first clause Each character and variable is represented as follows: and The corresponding tags are... It means that, among them .make Defined based on whether the text is in positive or negative form. or Thus ensuring .according to From the form, we can derive .
[0082] In the positive one-in-three SAT questions, when all clauses contain positive literals, there is a key point located at... =0.626. When When the value deviates significantly from 0.626, the probability of at least one solution approaches 0 or 1, making these problems relatively easy to solve. Therefore, our main focus can be... A positive one-in-three SAT question with a ratio between 0.5 and 0.8. Even better is when... A significant deviation from 0.626, for example, when If the difference between the ratio and 0.626 is not less than 0.1, then it indicates... Significant deviation from 0.626.
[0083] It is understandable that by applying classical optimization algorithms to reduce dimensionality, the dimensionality of the search space can be effectively reduced, thereby accelerating convergence to the ground state and improving the success rate of solving the problem. Numerical simulation results reveal that when When the ratio is between 0.5 and 0.8, the dimension of the solution space of the "relaxation problem" is approximately This method can effectively reduce the dimensionality of the search space, decrease the complexity of the SAT problem, thereby accelerating convergence to the ground state and improving the success rate of solving the one-out-of-three SAT problem.
[0084] Figure 2 This is a flowchart illustrating the method for obtaining the target 2-SAT problem provided by the present invention. Figure 2 As shown, updating the solution space of the one-out-of-three SAT problem to the target solution space to obtain the target 2-SAT problem may include:
[0085] Step 201: Update the constraints of the clauses in the three-out-of-three SAT problem from the initial conditions to the target conditions to obtain relaxed clauses. The initial condition is that if only one of the three variables in a clause is 1, then the clause is considered to satisfy the condition. The target condition is that if the number of 1s in the three variables in a clause is odd, then the clause is considered to satisfy the condition.
[0086] It's important to clarify that the first step is to relax the constraints of the clause. The condition is expanded from "one-in-three" to "odd in three" where there are an odd number of 1s or three 1s. This means that if all three variables in a clause are 1, then this "relaxed clause" is also considered to satisfy the condition. We call problems containing these relaxed clauses "relaxed problems."
[0087] Furthermore, the relaxed clause It can be represented as:
[0088] ,in This indicates three clauses;
[0089] The solution to the relaxation problem can be expressed as:
[0090] ,in, Let A represent the initial 0-1 clause matrix determined by the one-out-of-three SAT problem. This indicates that the vector is selected as an arbitrary n-dimensional 0-1 vector. It is the initial clause matrix The rank of a is equal to the number of independent clauses modulo 2. This indicates an additional offset or correction.
[0091] Step 202: Add restrictions to the relaxed clause to obtain the target 2-SAT problem. The restrictions include that two problems in the same clause cannot be true at the same time.
[0092] It should be noted that the following restriction can be imposed: two literals in the same clause cannot both be true. The solution to the "relaxed problem" is also a solution to the original One-in-Three SAT problem if and only if this constraint is satisfied. In this way, the problem can be simplified to solving a 2-SAT problem within the solution space of the "relaxed problem," where the dimension of this solution space is... .
[0093] It is understandable that by updating the constraints of the clauses in the three-choice SAT problem from the initial conditions to the target conditions, a relaxed clause is obtained, and the constraints of the relaxed clause are added to obtain the target 2-SAT problem. This can effectively reduce the dimensionality of the search space, thereby accelerating convergence to the ground state and improving the success rate of solving the problem.
[0094] Figure 3 This is a flowchart illustrating the method for determining the solution to a SAT problem in a three-out-of-three format, as provided by this invention. Figure 3 As shown, determining the solution to the one-out-of-three SAT problem based on the target Hamiltonian may include:
[0095] Step 301: Solve the ground state of the objective 2-SAT problem based on the objective Hamiltonian to obtain the approximate ground state.
[0096] It should be noted that there are many methods to obtain an approximate ground state by solving the ground state of the objective 2-SAT problem based on the objective Hamiltonian. For example, it can be obtained by using a variable quantum characteristic solver (VQE), or a quantum ground state solver of quantum annealing algorithm (QAA) and quantum approximation optimization algorithm (QAOA). This invention does not limit the method for obtaining an approximate ground state by solving the ground state of the objective 2-SAT problem based on the objective Hamiltonian.
[0097] Step 302: Determine whether the target ground state corresponds to a set of target solutions to the three-out-of-three SAT problem. If yes, output the target solution. If not, return to the previous step to solve the target ground state again. If the target solution is not obtained after repeating the preset number of times, it is determined that the three-out-of-three SAT problem has no solution.
[0098] It should be noted that the process involves determining whether the approximate ground state corresponds to a solution to the original problem. If so, the solution is output. If not, step 301 is repeated a certain number of times, and then it is determined that the original problem has no solution.
[0099] It can be understood that by obtaining the target ground state corresponding to the target Hamiltonian in the above manner, and determining the solution of the three-out-of-three SAT problem based on the approximate ground state, the accuracy of the obtained solution of the three-out-of-three SAT problem can be improved.
[0100] In some embodiments, after obtaining the target Hamiltonian, the solution to the one-out-of-three SAT problem can be determined by using an optimized quantum one-in-three SAT solver to obtain an approximate ground state. Specifically, a quantum ground state solver based on a variational quantum characteristic solver (VQE), quantum annealing algorithm (QAA), and quantum approximation optimization algorithm (QAOA) can be optimized to determine the ground state corresponding to the target Hamiltonian, thereby finding the solution to the one-in-three SAT problem. This will be explained in detail below.
[0101] First, the new solver based on variable quantum circuits is explained.
[0102] Figure 4 This is one of the flowcharts illustrating the method for obtaining an approximate ground state provided by the present invention. For example... Figure 4 As shown, the step of solving the ground state of the objective 2-SAT problem based on the objective Hamiltonian to obtain the objective ground state may include:
[0103] Step 401: Obtain a quantum circuit, wherein all quantum states represented by the quantum circuit are located in the solution space of the relaxed problem.
[0104] Step 402: When both literals in the clause of the relaxed problem are true, determine that the target Hamiltonian includes a penalty term, which is used to ensure that the case of not satisfying the clause is penalized in terms of energy.
[0105] Step 403: Obtain the target ground state corresponding to the target Hamiltonian by minimizing the energy of the target Hamiltonian.
[0106] It should be noted that in the optimization of the SAT problem solver based on the variational quantum algorithm, the qubit corresponds to the variable in the following way:
[0107]
[0108] Among them, let It can be noted that: in, In this equation, ⊕ represents addition modulo 2. Therefore, exist Indicates the reversal of the middle. One qubit. In other words, it is for The first in the representation Apply an "X" gate to each qubit. Parameterize the quantum gate. :
[0109] First, a quantum circuit is constructed that ensures all quantum states represented by this circuit lie within the solution space of the "relaxed problem". Furthermore, if we ignore the constant phase, this quantum circuit can represent all states denoted by S. Therefore, the solution to any problem can be precisely represented by a set of parameters.
[0110] Secondly, when both literals in the clause are true, the Hamiltonian should include a penalty term, expressed as follows:
[0111] ,
[0112] in and It can be freely replaced with The state with zero energy corresponds precisely to a solution to the original SAT problem. Therefore, by minimizing the energy using classical optimization techniques, we can determine whether a solution to the original SAT problem exists.
[0113] It is understandable that by using a novel solver based on variable quantum circuits—that is, constructing quantum circuits to keep the quantum state within the solution space of the relaxed problem, and then using classical optimization to minimize the energy—the target ground state corresponding to the target Hamiltonian can be obtained, thus determining whether a solution exists for the one-in-three SAT problem. This improves the accuracy of determining the solution to the one-in-three SAT problem. Furthermore, it has been demonstrated that the solver based on variable quantum computation can avoid the plateau phenomenon when handling one-in-three SAT problems. These characteristics highlight the broad prospects of the algorithm provided by this invention in the era of noisy medium-scale quantum (NISQ) devices.
[0114] Second, the new solver based on the quantum annealing algorithm is explained.
[0115] Figure 5 This is the second schematic flowchart of the method for obtaining an approximate ground state provided by the present invention. For example... Figure 5As shown, the step of solving the ground state of the objective 2-SAT problem based on the objective Hamiltonian to obtain the objective ground state may include:
[0116] Step 501: Determine the target Hamiltonian, which is the negative value of the Hamiltonian in the variable quantum feature solver.
[0117] Step 502: Determine the target ground state by evaluating whether the maximum eigenvalue of the target Hamiltonian is equal to zero. The target ground state tends to the maximum eigenvalue of the target Hamiltonian.
[0118] It should be noted that in the prior art, the initial Hamiltonian can be chosen as: This is consistent with the structure of the common quantum adiabatic theorem. Correspondingly.
[0119] Therefore, the initial state can be chosen accordingly as: Here, the solution space is the solution space of the relaxation problem. The initial state is the Hamiltonian. The state corresponding to the largest eigenvalue. This state corresponds to the mixed state in the quantum annealing algorithm framework.
[0120] In this invention, the target Hamiltonian is chosen as the negative value of the Hamiltonian in the variable quantum characteristic VQE quantum solver, and the goal is to determine its maximum value. The formula is:
[0121] .
[0122] According to the quantum adiabatic theorem, the quantum state will tend toward the Hamiltonian. The largest eigenvalue. Therefore, by evaluating whether the largest eigenvalue is equal to zero, the solvability of the SAT problem can be determined.
[0123] Furthermore, determining the target ground state by evaluating whether the maximum eigenvalue of the target Hamiltonian is equal to zero may include: acquiring a first quantum circuit, the first quantum circuit being composed of alternating first quantum gate sequences and second quantum gate sequences; and determining the target ground state based on the first quantum gate sequences and the second quantum gate sequences.
[0124] It should be noted that we can calculate the corresponding first quantum gate sequence using the above formula. Second quantum gate sequence Within the framework of quantum adiabatic computing, the entire circuit is designed as follows:
[0125] in,
[0126] In this formula, ,in It is a constant whose value is significantly smaller than The target ground state can be determined based on the calculated first and second quantum gate sequences.
[0127] It is understood that the SAT problem solver based on adiabatic quantum computing provided by this invention constructs the same quantum circuit using the adiabatic quantum computing paradigm, and then uses a larger number of layers (diabatic quantum computing) to obtain an approximate ground state. This can improve the accuracy of determining the solution to the three-out-of-three SAT problem.
[0128] Third, the new solver based on the quantum approximation optimization algorithm is explained.
[0129] Figure 6 This is the third schematic flowchart of the method for obtaining an approximate ground state provided by the present invention. For example... Figure 6 As shown, determining the target ground state by evaluating whether the maximum eigenvalue of the target Hamiltonian is equal to zero may include:
[0130] Step 601: Obtain the second quantum circuit, where the number of layers of the target solver corresponding to the second quantum circuit is lower than a preset layer threshold;
[0131] Step 602: By optimizing the number of parameters of the objective solver, an objective function is obtained, wherein the objective function is the target Hamiltonian that is maximized, and the number of objectives is twice the number of layers;
[0132] Step 603: Measure the state of all qubits of the output state of the second quantum circuit using the target solver to obtain the target ground state.
[0133] It should be noted that in the SAT problem solver based on the quantum approximation optimization algorithm, the Hamiltonian, circuitry, and initial state are the same as those of the quantum solver based on adiabatic quantum computation. However, this solver uses a significantly fewer number of layers, denoted as . And it needs to be optimized. One parameter. The variational circuit is designed as follows:
[0134] in,
[0135] Classic optimization techniques can be applied to find The parameter value is used to maximize Subsequently, by measuring the states of all qubits, a solution to the SAT problem can be obtained with a high probability, especially... With sufficiently large parameters, an approximate ground state can be obtained.
[0136] It is understood that the novel solver based on an approximate optimization algorithm provided by this invention obtains an approximate ground state based on the classical optimization method, namely the quantum approximate optimization algorithm. This can improve the accuracy of determining the solution to the three-out-of-three SAT problem.
[0137] It should be added that ground-state solutions are not limited to specific solvers. For example, quantum annealing solvers can be used to solve ground-state Hamiltonians, and coherent extraterrestrial machines are also an option. Furthermore, for Hamiltonians solved using the other three solvers, the quantum Monte Carlo method may be a feasible solution.
[0138] Based on the quantum solution method for the one-in-three SAT problem provided in this invention, we calculated the quantum resources required by the new quantum SAT solver and compared it with a solver that does not employ classical reduction. Our results show that the resource requirements for qubits can be reduced in solvers based on quantum annealing (QA) and variable quantum characteristic solvers (VQE). The required gate resources exhibit a quadratic dependence with problem size, increasing by at most a factor n compared to its classical counterpart. We demonstrate that the quantum solver based on variable quantum characteristic solvers (VQE) can avoid plateau depletion, and we further validate the feasibility of the novel quantum solver through numerical simulations of randomly generated forward one-in-three SAT problems. By integrating our analytical results and simulation data, we aim to demonstrate the potential application prospects of this algorithm in the era of noisy mesoscale quantum computing (NISQ).
[0139] Based on the foregoing embodiments, this invention provides a quantum solution device for the three-out-of-three SAT problem. The modules and units included in the device can be implemented by a processor; of course, they can also be implemented by specific logic circuits. 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.
[0140] The quantum solution apparatus for the one-out-of-three SAT problem provided by the present invention is described below. The quantum solution apparatus for the one-out-of-three SAT problem described below can be referred to in correspondence with the quantum solution method for the one-out-of-three SAT problem described above.
[0141] Figure 7 This is a schematic diagram of the quantum solution device for the one-out-of-three SAT problem provided by the present invention. Figure 7 As shown, the device 700 includes a problem dimensionality reduction module 701, an energy acquisition module 702, and a solution determination module 703, wherein:
[0142] Problem dimensionality reduction module 701 is used to update the solution space of the three-choice SAT problem to the target solution space to obtain the target 2-SAT problem. The target solution space corresponds to the solution space of the relaxed problem, and the relaxed problem includes clauses that relax the constraints.
[0143] Energy acquisition module 702 is used to acquire the target Hamiltonian corresponding to the target 2-SAT problem;
[0144] Solution determination module 703 is used to determine the solution of the one-out-of-three SAT problem based on the target Hamiltonian.
[0145] In some embodiments, the problem dimensionality reduction module 701 includes a condition update unit and a constraint addition unit, wherein,
[0146] The condition update unit is used to update the constraint conditions of the clauses of the three-out-of-three SAT problem from the initial conditions to the target conditions to obtain relaxed clauses. The initial condition is that if only one of the three variables in a clause is 1, then the clause is considered to satisfy the condition. The target condition is that if the number of 1s in the three variables in a clause is odd, then the clause is considered to satisfy the condition.
[0147] The restriction-increasing unit is used to add restrictions to the relaxed clause to obtain the target 2-SAT problem. The restrictions include that two problems in the same clause cannot be true at the same time.
[0148] In some embodiments, in the condition update unit, the relaxed clause Represented as:
[0149] ,in This indicates three clauses;
[0150] The solution to the relaxation problem is expressed as:
[0151] ,in, Let A represent the initial 0-1 clause matrix determined by the one-out-of-three SAT problem. This indicates that the vector is selected as an arbitrary n-dimensional 0-1 vector. It is the initial clause matrix The rank of a is equal to the number of independent clauses modulo 2. This indicates an additional offset or correction.
[0152] In some embodiments, the solution determination module 703 includes a ground state acquisition unit and a solution determination unit, wherein,
[0153] The ground state acquisition unit is used to solve the ground state of the objective 2-SAT problem based on the objective Hamiltonian to obtain the objective ground state, which is used to characterize the ground state or an approximate ground state.
[0154] The solution determination unit is used to determine whether the target ground state corresponds to a set of target solutions of the three-out-of-three SAT problem. If so, the target solution is output; if not, the previous step is returned to solve the target ground state again. If the target solution is not obtained after repeating the process a preset number of times, the three-out-of-three SAT problem is determined to have no solution.
[0155] In some embodiments, the ground state acquisition unit includes a line acquisition component, a penalty term determination component, and a ground state acquisition component, wherein,
[0156] The circuit acquisition component is used to acquire quantum circuits, wherein all quantum states represented by the quantum circuits are located in the solution space of the relaxed problem;
[0157] The penalty term determination component is used to determine that the target Hamiltonian includes a penalty term when both literals in the clause of the relaxed problem are true, the penalty term being used to ensure that cases where the clause is not satisfied are penalized in terms of energy.
[0158] The ground state acquisition component is used to obtain the target ground state corresponding to the target Hamiltonian by minimizing the energy of the target Hamiltonian.
[0159] In some embodiments, the ground state acquisition unit includes a first determining component and a second determining component, wherein,
[0160] The first determining component is used to determine the target Hamiltonian, which is the negative value of the Hamiltonian in the variable quantum feature solver;
[0161] The second determining component is used to determine the target ground state by evaluating whether the maximum eigenvalue of the target Hamiltonian is equal to zero, the target ground state tending towards the maximum eigenvalue of the target Hamiltonian.
[0162] In some embodiments, the second determining component is specifically used to: acquire a first quantum circuit, the first quantum circuit being composed of alternating first quantum gate sequences and second quantum gate sequences; and determine the target ground state based on the first quantum gate sequence and the second quantum gate sequence.
[0163] In some embodiments, the ground state acquisition unit includes a circuit acquisition component, an optimization parameter component, and a measurement state component, wherein,
[0164] The circuit acquisition component is used to acquire a second quantum circuit, wherein the number of layers of the target solver corresponding to the second quantum circuit is lower than a preset layer threshold.
[0165] The optimization parameter component is used to obtain an objective function by optimizing the number of parameters of the objective solver, wherein the objective function is the target Hamiltonian that is maximized, and the number of targets is twice the number of layers;
[0166] The measurement state component is used to measure the state of all qubits of the output state of the second quantum circuit through the target solver to obtain the target ground state.
[0167] In some embodiments, the apparatus further includes: a clause determination module, the clause determination module being configured to determine whether the text of all clauses in the three-out-of-one SAT problem is positive, and to obtain a target ratio corresponding to the three-out-of-one SAT problem, the target ratio being the 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 variables in the three-out-of-one SAT problem;
[0168] The problem dimensionality reduction module 701 is further configured to: update the solution space of the three-choice SAT problem to the target solution space when all clauses in the three-choice SAT problem are positive and the target ratio is greater than 0.5 and less than 0.8, thereby obtaining the target 2-SAT problem.
[0169] In some embodiments, 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 deviates significantly from 0.626.
[0170] In some embodiments, the dimension of the target solution space is a third power of 2, where the third power is equal to the difference between the second power and the first power.
[0171] In this embodiment of the invention, by effectively reducing the dimensionality of the search space and decreasing the complexity of the SAT problem, the convergence to the ground state is accelerated, thereby improving the success rate of solving the one-out-of-three SAT problem.
[0172] Figure 8 This is a schematic diagram of the physical structure of the electronic device provided by the present invention. For example... Figure 8As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840. The processor 810, communications interface 820, and memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a quantum solution method for the one-out-of-three SAT problem. This method includes: updating the solution space of the one-out-of-three SAT problem to a target solution space to obtain a target 2-SAT problem, wherein the target solution space corresponds to the solution space of a relaxed problem, and the relaxed problem includes clauses with relaxed constraints; obtaining the target Hamiltonian corresponding to the target 2-SAT problem; and determining the solution to the one-out-of-three SAT problem based on the target Hamiltonian.
[0173] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0174] On the other hand, the present invention also provides a computer program product, which includes a computer program that 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 one-out-of-three SAT problem provided by the above methods. The method includes: updating the solution space of the one-out-of-three SAT problem to a target solution space to obtain a target 2-SAT problem, wherein the target solution space corresponds to the solution space of a relaxed problem, and the relaxed problem includes clauses that relax constraints; obtaining the target Hamiltonian corresponding to the target 2-SAT problem; and determining the solution of the one-out-of-three SAT problem based on the target Hamiltonian.
[0175] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. 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. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, 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 integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).
[0176] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a quantum solution method for the one-out-of-three SAT problem provided by the methods described above. The method includes: updating the solution space of the one-out-of-three SAT problem to a target solution space to obtain a target 2-SAT problem, wherein the target solution space corresponds to the solution space of a relaxed problem, and the relaxed problem includes clauses that relax constraints; obtaining the target Hamiltonian corresponding to the target 2-SAT problem; and determining the solution of the one-out-of-three SAT problem based on the target Hamiltonian.
[0177] The aforementioned computer-readable storage medium may be any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in connection with an instruction execution system, apparatus, or device.
[0178] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including—but not limited to—electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0179] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, radio frequency (RF), etc., or any suitable combination thereof.
[0180] Computer program code for performing the operations described herein can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as "C" or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0181] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0182] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for quantum solution of a one-out-of-three form SAT problem, characterized in that, The method comprises the following steps: updating a solution space of a ternary SAT problem to a target solution space to obtain a target 2-SAT problem, the target solution space corresponding to a solution space of a relaxed problem, the relaxed problem comprising clauses with relaxed constraint conditions; obtaining a target Hamiltonian corresponding to the target 2-SAT problem; determining a solution of the ternary SAT problem according to the target Hamiltonian; the step of determining the solution of the ternary SAT problem according to the target Hamiltonian comprises: solving a ground state of the target 2-SAT problem according to the target Hamiltonian to obtain a target ground state, the target ground state being used to represent a ground state or an approximate ground state; determining whether the target ground state corresponds to a set of target solutions of the ternary SAT problem, if yes, outputting the target solutions, if not, returning to the previous step to solve the target ground state again, if the target solutions are not obtained after repeating a preset number of times, determining that the ternary SAT problem has no solution; the step of solving the ground state of the target 2-SAT problem according to the target Hamiltonian to obtain the target ground state comprises: determining the target Hamiltonian, the target Hamiltonian being a negative value of a Hamiltonian in a variational quantum eigensolver; determining the target ground state by evaluating whether a maximum eigenvalue of the target Hamiltonian is equal to zero, the target ground state tending to the maximum eigenvalue of the target Hamiltonian; the step of determining the target ground state by evaluating whether the maximum eigenvalue of the target Hamiltonian is equal to zero comprises: obtaining a first quantum circuit, the first quantum circuit being composed of alternating first quantum gate sequences and second quantum gate sequences, the first quantum gate sequences and the second quantum gate sequences being evolution operators of an initial Hamiltonian and a target Hamiltonian; determining the target ground state according to the first quantum gate sequences and the second quantum gate sequences; or the step of determining the target ground state by evaluating whether the maximum eigenvalue of the target Hamiltonian is equal to zero comprises: obtaining a second quantum circuit, the second quantum circuit corresponding to a target solver with a number of layers lower than a preset number of layer threshold; obtaining a target function by optimizing target number of parameters of the target solver, the target function being the maximum target Hamiltonian, the target number being twice the number of layers; measuring states of all qubits of an output state of the second quantum circuit by the target solver to obtain the target ground state; the step of updating the solution space of the ternary SAT problem to the target solution space to obtain the target 2-SAT problem comprises: updating constraint conditions of clauses of the ternary SAT problem from initial conditions to target conditions to obtain relaxed clauses, the initial conditions being that if only one variable is 1 in three variables in a clause, the clause is considered to satisfy the conditions, and the target conditions being that if the number of 1s in three variables in a clause is odd, the clause is considered to satisfy the conditions; adding a restriction condition of the relaxed clauses to obtain the target 2-SAT problem, the restriction condition comprising that two problems in the same clause cannot be true at the same time.
2. The method of quantum solution of a 3 -SAT problem according to claim 1, wherein, The relaxation clause is represented as: wherein represents three clauses; The solution of the relaxed problem is represented as: wherein, A denotes a 0-1 initial clause matrix determined by a three-to-one form SAT problem, denotes a 0-1 vector of arbitrary n-k dimensions, is a rank of the initial clause matrix equal to the number of independent clauses in the sense of modulo 2, denotes an additional offset or correction term.
3. The method of claim 1, wherein, Before the solution space of the ternary form SAT problem is updated to the target solution space to obtain a target 2-SAT problem, the method further includes: Determining whether the literals of all clauses in the ternary form SAT problem are positive, and obtaining a target ratio corresponding to the ternary form SAT problem, the target ratio being a ratio of a first quantity and a second quantity, the first quantity representing a number of clauses in the ternary form SAT problem, and the second quantity representing a number of variables in the ternary form SAT problem; The updating of the solution space of the ternary form SAT problem to the target solution space to obtain the target 2-SAT problem includes: In a case where the literals of all clauses in the ternary form SAT problem are positive, and the target ratio is greater than 0.5 and less than 0.8, the solution space of the ternary form SAT problem is updated to the target solution space to obtain the target 2-SAT problem.
4. The method of claim 3, wherein, The difference between the target ratio and 0.626 is not less than a preset threshold, and the not less than a preset threshold represents that the target ratio significantly deviates from 0.
626.
5. The method of claim 3, wherein, The dimension of the target solution space is a third quantity of the power of 2, and the third quantity is equal to a difference between the second quantity and the first quantity.
6. A quantum solving apparatus for a one-out-of-three form SAT problem, characterized by, It includes: A problem dimension reduction module is configured to update a solution space of a ternary form SAT problem to a target solution space to obtain a target 2-SAT problem, the target solution space corresponding to a solution space of a relaxed problem, the relaxed problem including clauses with relaxed constraint conditions; An energy acquisition module is configured to acquire a target Hamiltonian corresponding to the target 2-SAT problem; A solution determination module is configured to determine a solution of the ternary form SAT problem according to the target Hamiltonian; The solution determination module includes: A ground state acquisition unit is configured to solve a ground state of the target 2-SAT problem according to the target Hamiltonian to obtain a target ground state, the target ground state representing a ground state or an approximate ground state; A solution determination unit is configured to determine whether the target ground state corresponds to a set of target solutions of the ternary form SAT problem, and if so, output the target solutions, and if not, return to the previous step to solve the target ground state again, and if the target solutions are not obtained after repeating a preset number of times, determine that the ternary form SAT problem has no solution; The ground state acquisition unit includes: A first determination component is configured to determine the target Hamiltonian, which is a negative value of a Hamiltonian in a variational quantum characteristic solver; A second determination component is configured to determine the target ground state by evaluating whether a maximum eigenvalue of the target Hamiltonian is equal to zero, the target ground state tending to the maximum eigenvalue of the target Hamiltonian; The second determination component is specifically configured to: acquire a first quantum circuit composed of alternating first quantum gate sequences and second quantum gate sequences, the first quantum gate sequences and the second quantum gate sequences being evolution operators of an initial Hamiltonian and a target Hamiltonian; and determine the target ground state according to the first quantum gate sequences and the second quantum gate sequences; or The second determining component comprises: a circuit obtaining component, configured to obtain a second quantum circuit, the second quantum circuit corresponding to a target solver with a number of layers lower than a preset number of layer threshold; an optimization parameter component, configured to obtain a target function by optimizing a target number of parameters of the target solver, the target function being the target Hamiltonian maximized, the target number being twice the number of layers; a measurement state component, configured to obtain the target ground state by measuring states of all qubits of an output state of the second quantum circuit by the target solver; The problem dimension reduction module comprises: a conditional updating unit, configured to update a constraint condition of a clause of the three-of-one form SAT problem from an initial condition to a target condition to obtain a relaxed clause, the initial condition being that if only one of three variables is 1 in a clause, the clause is considered to satisfy the condition, and the target condition being that if the number of 1s in three variables in a clause is odd, the clause is considered to satisfy the condition; a restriction increasing unit, configured to increase a restriction condition of the relaxed clause to obtain the target 2-SAT problem, the restriction condition including that two problems in the same clause cannot be true at the same time.
7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the quantum solving method of the three-of-one form SAT problem according to any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the quantum solving method of the three-of-one form SAT problem according to any one of claims 1 to 5.
9. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the quantum solving method of the three-of-one form SAT problem according to any one of claims 1 to 5.
Citation Information
Patent Citations
Compact k-sat validation with tcams
CN117275552A
Method and device for determining optimal solution of nonlinear programming problem based on quantum circuit
CN118014091A