CN116739101B - A quantum optimization method and device - Google Patents
A quantum optimization method and device Download PDFInfo
- Publication number
- CN116739101B CN116739101B CN202310769824.4A CN202310769824A CN116739101B CN 116739101 B CN116739101 B CN 116739101B CN 202310769824 A CN202310769824 A CN 202310769824A CN 116739101 B CN116739101 B CN 116739101B
- Authority
- CN
- China
- Prior art keywords
- sat
- statement
- term
- objective function
- restriction
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N10/00—Quantum computing, i.e. information processing based on quantum-mechanical phenomena
- G06N10/80—Quantum programming, e.g. interfaces, languages or software-development kits for creating or handling programs capable of running on quantum computers; Platforms for simulating or accessing quantum computers, e.g. cloud-based quantum computing
Landscapes
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computational Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Condensed Matter Physics & Semiconductors (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Artificial Intelligence (AREA)
- Error Detection And Correction (AREA)
Abstract
本申请公开了一种量子优化方法以及装置,该方法包括:将待优化问题转换为QUBO问题,并将QUBO问题对应的初始目标函数转换为伊辛形式的能量函数;针对伊辛形式的能量函数引入物理比特,以使两体相互作用项转换为单体局域作用项,并获得引入的用于保证逻辑比特正确性的限制项;针对限制项构建等价的数字分组问题,并基于数字分组问题获得限制项对应的子目标函数;将限制项对应的子目标函数与单体局域作用项对应的单体函数相结合,获得QUBO问题对应的最终目标函数。该方法在一维冷原子链中即可实现编码,无需利用量子比特几何排布的方式实现编码过程中所引入的限制条件,即,无需在物理体系中对原子进行二维空间上的排布,有效降低奇偶编码过程的复杂度。
The present application discloses a quantum optimization method and device, which includes: converting the problem to be optimized into a QUBO problem, and converting the initial objective function corresponding to the QUBO problem into an energy function in the Ising form; introducing physical bits for the Ising form energy function to convert the two-body interaction term into a monomer local action term, and obtaining the introduced restriction term for ensuring the correctness of the logical bit; constructing an equivalent digital grouping problem for the restriction term, and obtaining the sub-objective function corresponding to the restriction term based on the digital grouping problem; combining the sub-objective function corresponding to the restriction term with the monomer function corresponding to the monomer local action term to obtain the final objective function corresponding to the QUBO problem. This method can realize encoding in a one-dimensional cold atom chain, without the need to use the geometric arrangement of quantum bits to realize the restriction conditions introduced in the encoding process, that is, without the need to arrange atoms in two-dimensional space in the physical system, effectively reducing the complexity of the parity encoding process.
Description
技术领域Technical Field
本申请涉及量子优化技术领域,具体涉及一种量子优化方法。本申请同时涉及一种量子优化装置、一种电子设备以及一种计算机可读取存储介质。The present invention relates to the field of quantum optimization technology, and more particularly to a quantum optimization method. The present invention also relates to a quantum optimization device, an electronic device, and a computer-readable storage medium.
背景技术Background technique
量子优化问题致力于利用量子体系的涨落求解困难的经典二元优化问题。其核心在于将计算问题的解合适地编码到可编程的量子多体系统的基态中。实现编码的问题后,即可运用成熟的绝热算法对优化问题进行求解。在当前的量子优化领域中,由于大部分问题均可以描述为QUBO问题的形式,因此量子优化研究领域中的重要任务即在物理实验体系的哈密顿量中编码优化问题的目标函数,进而可以借助量子绝热算法求解原本对于经典计算机具有NP-complete难度的优化问题。由于物理体系仅能实现局域的相互作用,无法对具有全局连接性的二元问题进行直接编码,因此目前有较多编码方案致力于解决物理体系只有局域相互作用的缺陷,其中奇偶编码被广泛应用,即利用单个实际的物理量子比特编码原哈密顿量中的多量子比特相互作用项,并在此基础上引入一些限制项,以保证逻辑比特的正确性。Quantum optimization problems are dedicated to solving difficult classical binary optimization problems using the fluctuations of quantum systems. The core is to appropriately encode the solution of the computational problem into the ground state of a programmable quantum many-body system. After the encoding problem is realized, the mature adiabatic algorithm can be used to solve the optimization problem. In the current field of quantum optimization, since most problems can be described in the form of QUBO problems, the important task in the field of quantum optimization research is to encode the objective function of the optimization problem in the Hamiltonian of the physical experimental system, and then use the quantum adiabatic algorithm to solve the optimization problem that is originally NP-complete for classical computers. Since the physical system can only realize local interactions, it is impossible to directly encode binary problems with global connectivity. Therefore, there are currently many encoding schemes dedicated to solving the defect that the physical system only has local interactions. Among them, parity coding is widely used, that is, using a single actual physical quantum bit to encode the multi-qubit interaction term in the original Hamiltonian, and introducing some restrictions on this basis to ensure the correctness of the logical bits.
然而,在使用现有的奇偶编码对优化问题的目标函数进行编码的过程中,存在如下问题:现有技术在奇偶编码的基础上,利用量子比特几何排布的方式实现编码过程中所引入的限制条件,然而该种方式需对原子进行二维空间上的排布,使得编码过程过于复杂。However, in the process of using existing parity coding to encode the objective function of the optimization problem, there are the following problems: based on parity coding, the existing technology uses the geometric arrangement of quantum bits to implement the restrictions introduced in the encoding process. However, this method requires the arrangement of atoms in two-dimensional space, making the encoding process too complicated.
发明内容Summary of the invention
本发明提供一种量子优化方法、装置、电子设备及计算机可读存储介质,以解决现有技术中采用奇偶编码对优化问题的目标函数进行编码时、编码过程过于复杂的问题。The present invention provides a quantum optimization method, device, electronic device and computer-readable storage medium to solve the problem that when odd-even coding is used to encode the objective function of the optimization problem in the prior art, the encoding process is too complicated.
为了解决或者一定程度上改善上述技术问题,根据本发明一方面,提供一种量子优化方法,该方法包括:In order to solve or improve the above technical problems to a certain extent, according to one aspect of the present invention, a quantum optimization method is provided, the method comprising:
将待优化问题转换为QUBO问题,并将所述QUBO问题对应的初始目标函数转换为伊辛形式的能量函数;Converting the problem to be optimized into a QUBO problem, and converting the initial objective function corresponding to the QUBO problem into an energy function in Ising form;
针对所述伊辛形式的能量函数引入物理比特,以使两体相互作用项转换为单体局域作用项,并获得引入的用于保证逻辑比特正确性的限制项;Introducing physical bits into the Ising form energy function to convert the two-body interaction term into a single-body local interaction term, and obtaining the introduced restriction term for ensuring the correctness of the logical bit;
针对所述限制项构建等价的数字分组问题,并基于所述数字分组问题获得所述限制项对应的子目标函数;Constructing an equivalent digital grouping problem for the restriction item, and obtaining a sub-objective function corresponding to the restriction item based on the digital grouping problem;
将所述限制项对应的子目标函数与所述单体局域作用项对应的单体函数相结合,获得所述QUBO问题对应的最终目标函数。The sub-objective function corresponding to the restriction term is combined with the monomer function corresponding to the monomer local action term to obtain the final objective function corresponding to the QUBO problem.
在一些实施方式中,所述针对所述限制项构建等价的数字分组问题,包括:In some implementations, constructing an equivalent digital grouping problem for the restriction item includes:
将所述限制项转换为SAT语句,并将所述SAT语句约化为可在光学腔的冷原子体系中编码的数字分组问题。The constraints are converted into SAT statements, and the SAT statements are reduced to a digital grouping problem that can be encoded in a cold atomic system of an optical cavity.
在一些实施方式中,所述将所述SAT语句约化为可在光学腔的冷原子体系中编码的数字分组问题,包括:In some embodiments, reducing the SAT statement to a digital grouping problem that can be encoded in a cold atom system of an optical cavity includes:
基于所述SAT语句定义数字组,使得当所述SAT语句由可满足的变量取值时,在所述数字组中可获取一个子集,所述子集中所包含的数字的和值等于某一目标值,其中,所述数字和所述目标值中的整数幂级数被替换为无平方因子的整数平方根;A number group is defined based on the SAT statement, so that when the SAT statement is evaluated by a satisfiable variable, a subset can be obtained in the number group, and the sum of the numbers included in the subset is equal to a certain target value, wherein the integer power series in the numbers and the target value are replaced by integer square roots without square factors;
基于所述数字组,构建数字分组问题的目标函数。Based on the number groups, an objective function of the number grouping problem is constructed.
在一些实施方式中,所述SAT语句由M个字句c1,c2,...,cM组成,且所述SAT语句包含N个变量x1,x2,…xN,基于所述SAT语句定义数字组,包括:In some implementations, the SAT statement is composed of M clauses c 1 , c 2 , ..., c M , and the SAT statement contains N variables x 1 , x 2 , ... x N . Defining a number group based on the SAT statement includes:
基于所述SAT语句定义出的所述数字为:The numbers defined based on the SAT statement are:
基于所述SAT语句定义出的所述目标值为:The target value defined based on the SAT statement is:
其中,i的取值范围从1到N,j的取值范围从1到M,αp表示第p个无平方因子的整数;Where i ranges from 1 to N, j ranges from 1 to M, and α p represents the pth integer without square factors;
{ai,bi,cj,dj}构成新的数字分组问题的数字集合,将该数字集合记为序列{r1,...,rk,...r2M+2N};{a i , b i , c j , d j } constitutes a digital set for a new digital grouping problem, and the digital set is recorded as a sequence {r 1 , ..., r k , ...r 2M+2N };
基于所述序列构建等价的数字分组问题的目标函数:Based on the sequence, we construct an equivalent objective function for the digital grouping problem:
其中,yk=1或-1。Here, y k =1 or -1.
在一些实施方式中,所述基于所述数字分组问题获得所述限制项对应的子目标函数,包括:In some implementations, obtaining the sub-objective function corresponding to the restriction item based on the digital grouping problem includes:
将所述SAT语句的变量的数量和字句的数量代入所述数字分组问题的目标函数,获得所述限制项对应的子目标函数。Substitute the number of variables and the number of sentences of the SAT statement into the objective function of the digital grouping problem to obtain the sub-objective function corresponding to the restriction item.
在一些实施方式中,所述伊辛形式的能量函数表示为:In some embodiments, the Ising form energy function is expressed as:
所述针对所述伊辛形式的能量函数引入物理比特,以使两体相互作用项转换为单体局域作用项,并获得引入的用于保证逻辑比特正确性的限制项,包括:针对所述伊辛形式的能量函数引入物理比特bii′=sisi′,以使两体相互作用项Jii′转换为单体局域作用项J、所述能量函数转换为单体局域场作用的形式并获得引入的用于保证逻辑比特正确性的(n-1)(n-2)/2个限制条件,其中,n为伊辛形式能量函数的变量个数,引入所述限制项满足如下方程:The energy function of the Ising form is introduced with a physical bit so as to convert the two-body interaction term into a monomer local action term, and obtain the introduced restriction term for ensuring the correctness of the logical bit, including: introducing a physical bit b ii′ = s i s i′ for the energy function of the Ising form so as to convert the two-body interaction term J ii′ into a monomer local action term J, converting the energy function into a form of monomer local field action And obtain the (n-1)(n-2)/2 restriction conditions introduced to ensure the correctness of the logic bit, where n is the number of variables of the Ising form energy function, and the restriction terms are introduced to satisfy the following equation:
bii′bii′+1bi+1i′+1bi+1i′=1。b ii′ b ii′+1 b i+1i′+1 b i+1i′ =1.
在一些实施方式中,所述将所述限制项转换为SAT语句,包括:In some implementations, converting the restriction item into a SAT statement includes:
将每个限制项写成一个对应的3-SAT语句的形式,以将(n-1)(n-2)/2个限制项约化为具有(n-1)2个变量,4(n-1)(n-2)个字句的3-SAT语句:Write each restriction in the form of a corresponding 3-SAT statement to reduce the (n-1)(n-2)/2 restrictions to a 3-SAT statement with (n-1) 2 variables and 4(n-1)(n-2) words:
其中,xii′=(bii′+1)/2,β为新引入的辅助变量。Among them, x ii′ =(b ii′ +1)/2, and β is a newly introduced auxiliary variable.
在一些实施方式中,所述将所述限制项转换为SAT语句,包括:In some implementations, converting the restriction item into a SAT statement includes:
将每个限制项写成一个对应的4-SAT语句的形式,以将(n-1)(n-2)/2个限制项约化为具有n(n-1)/2个变量,4(n-1)(n-2)个字句的4-SAT语句:Write each restriction in the form of a corresponding 4-SAT statement to reduce the (n-1)(n-2)/2 restrictions to a 4-SAT statement with n(n-1)/2 variables and 4(n-1)(n-2) words:
其中,xii′=(bii′+1)/2。Among them, x ii′ =(b ii′ +1)/2.
在一些实施方式中,所述方法还包括:In some embodiments, the method further comprises:
基于所述最终目标函数,使用绝热算法进行求解,并基于解码奇偶编码的算法计算获得所述待优化问题的解。Based on the final objective function, an adiabatic algorithm is used to solve the problem, and a solution to the problem to be optimized is obtained based on an algorithm calculation for decoding parity codes.
在一些实施方式中,所述待优化问题包括分子构象搜索问题。In some embodiments, the problem to be optimized includes a molecular conformation search problem.
根据本发明的另一方面,提供一种量子优化装置,该装置包括:According to another aspect of the present invention, a quantum optimization device is provided, the device comprising:
能量函数转换单元,用于将待优化问题转换为QUBO问题,并将所述QUBO问题对应的初始目标函数转换为伊辛形式的能量函数;An energy function conversion unit, used for converting the problem to be optimized into a QUBO problem, and converting an initial objective function corresponding to the QUBO problem into an energy function in Ising form;
单体局域作用项转换单元,用于针对所述伊辛形式的能量函数引入物理比特,以使两体相互作用项转换为单体局域作用项,并获得引入的用于保证逻辑比特正确性的限制项;A monomer local action term conversion unit, used for introducing physical bits into the Ising form energy function, so as to convert the two-body interaction term into the monomer local action term, and obtain the introduced restriction term for ensuring the correctness of the logic bit;
数字分组构建单元,用于针对所述限制项构建等价的数字分组问题,并基于所述数字分组问题获得所述限制项对应的子目标函数;A digital grouping construction unit, used to construct an equivalent digital grouping problem for the restriction item, and obtain a sub-objective function corresponding to the restriction item based on the digital grouping problem;
最终目标函数获得单元,用于将所述限制项对应的子目标函数与所述单体局域作用项对应的单体函数相结合,获得所述QUBO问题对应的最终目标函数。The final objective function obtaining unit is used to combine the sub-objective function corresponding to the restriction term with the monomer function corresponding to the monomer local action term to obtain the final objective function corresponding to the QUBO problem.
根据本发明的另一方面,提供一种电子设备,包括处理器和存储器;其中,所述存储器用于存储一条或多条计算机指令,其中,所述一条或多条计算机指令被所述处理器执行以实现上述方法。According to another aspect of the present invention, an electronic device is provided, comprising a processor and a memory; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the above method.
根据本发明的另一方面,提供一种计算机可读存储介质,其上存储有一条或多条计算机指令,该指令被处理器执行以实现上述方法。According to another aspect of the present invention, a computer-readable storage medium is provided, on which one or more computer instructions are stored, and the instructions are executed by a processor to implement the above method.
与现有技术相比,本发明具有以下优点:Compared with the prior art, the present invention has the following advantages:
本发明提供的量子优化方法,将待优化问题转换为QUBO问题,并将QUBO问题对应的初始目标函数转换为伊辛形式的能量函数;针对伊辛形式的能量函数引入物理比特,以使两体相互作用项转换为单体局域作用项,并获得引入的用于保证逻辑比特正确性的限制项;针对限制项构建等价的数字分组问题,并基于数字分组问题获得限制项对应的子目标函数;将限制项对应的子目标函数与单体局域作用项对应的单体函数相结合,获得QUBO问题对应的最终目标函数。该方法使得在一维的冷原子链中即可实现编码,无需利用量子比特几何排布的方式实现编码过程中所引入的限制条件,即,无需在物理体系中对原子进行二维空间上的排布,有效降低了奇偶编码过程的复杂度。The quantum optimization method provided by the present invention converts the problem to be optimized into a QUBO problem, and converts the initial objective function corresponding to the QUBO problem into an energy function in the Ising form; introduces physical bits for the Ising form energy function to convert the two-body interaction term into a monomer local action term, and obtains the introduced restriction term for ensuring the correctness of the logical bit; constructs an equivalent digital grouping problem for the restriction term, and obtains the sub-objective function corresponding to the restriction term based on the digital grouping problem; combines the sub-objective function corresponding to the restriction term with the monomer function corresponding to the monomer local action term to obtain the final objective function corresponding to the QUBO problem. This method enables encoding to be realized in a one-dimensional cold atom chain, without the need to use the geometric arrangement of quantum bits to realize the restriction conditions introduced in the encoding process, that is, without the need to arrange atoms in two-dimensional space in the physical system, effectively reducing the complexity of the parity encoding process.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本申请一实施例提供的量子优化方法流程图;FIG1 is a flow chart of a quantum optimization method provided by an embodiment of the present application;
图2是本申请一实施例提供的Mijazawa-Jernigan(MJ)模型的示意图;FIG2 is a schematic diagram of a Mijazawa-Jernigan (MJ) model provided in an embodiment of the present application;
图3是本申请一实施例提供的氨基酸序列的示意图;FIG3 is a schematic diagram of an amino acid sequence provided in an embodiment of the present application;
图4是本申请一实施例提供的量子优化装置的单元框图;FIG4 is a unit block diagram of a quantum optimization device provided in one embodiment of the present application;
图5是本申请一实施例提供的电子设备的逻辑结构示意图。FIG5 is a schematic diagram of the logical structure of an electronic device provided in an embodiment of the present application.
具体实施方式Detailed ways
在下面的描述中阐述了很多具体细节以便于充分理解本申请。但是本申请能够以很多不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本申请内涵的情况下做类似推广,因此本申请不受下面公开的具体实施的限制。Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application. Therefore, the present application is not limited to the specific implementation disclosed below.
针对量子优化场景,为了降低奇偶编码过程的复杂度,本申请提供了一种量子优化方法、与该方法相对应的量子优化装置、电子设备以及计算机可读存储介质。以下提供实施例对上述方法、装置、电子设备以及计算机可读存储介质进行详细说明。For quantum optimization scenarios, in order to reduce the complexity of the parity encoding process, the present application provides a quantum optimization method, a quantum optimization device, an electronic device and a computer-readable storage medium corresponding to the method. The following embodiments are provided to describe the above method, device, electronic device and computer-readable storage medium in detail.
本申请一实施例提供一种量子优化方法。图1为本申请第一实施例提供的量子优化方法的流程图,以下结合图1对本实施例提供的方法进行详细描述。以下描述所涉及的实施例是用来解释说明方法原理,不是实际使用的限定。An embodiment of the present application provides a quantum optimization method. FIG1 is a flow chart of the quantum optimization method provided in the first embodiment of the present application. The method provided in this embodiment is described in detail below in conjunction with FIG1. The embodiments described below are used to explain the principle of the method and are not intended to be limiting for actual use.
本实施例提供的量子优化方法可实现在光学腔的冷原子体系中编码QUBO问题,该方法基于奇偶编码,将原本具有任意连接的两体相互作用形式的哈密顿量转化成单体的局域场形式,并将该过程中所产生的保证逻辑比特正确性的限制项、编码成光学腔的冷原子体系易于实现的哈密顿量,从而实现完整的编码过程。如图1所示,该量子优化方法包括如下步骤:The quantum optimization method provided in this embodiment can realize the encoding of QUBO problems in the cold atom system of the optical cavity. The method is based on parity coding, which converts the Hamiltonian originally in the form of two-body interaction with arbitrary connection into the local field form of a monomer, and encodes the restriction terms generated in the process to ensure the correctness of the logical bit into the Hamiltonian that is easy to implement in the cold atom system of the optical cavity, thereby realizing the complete encoding process. As shown in Figure 1, the quantum optimization method includes the following steps:
S101,将待优化问题转换为QUBO问题,并将QUBO问题对应的初始目标函数转换为伊辛形式的能量函数。S101, converting the problem to be optimized into a QUBO problem, and converting the initial objective function corresponding to the QUBO problem into an energy function in Ising form.
本步骤用于将待优化问题转换为QUBO(quadratic unconstrained binaryoptimization)问题,并将QUBO问题对应的初始目标函数(布尔函数)转换为伊辛形式的能量函数。在QUBO问题中,目标函数表示为二进制变量的二次函数,其中每个变量只能取0或1,该问题的任务即最小化目标函数。This step is used to convert the problem to be optimized into a QUBO (quadratic unconstrained binary optimization) problem, and convert the initial objective function (Boolean function) corresponding to the QUBO problem into an Ising form energy function. In the QUBO problem, the objective function is expressed as a quadratic function of binary variables, where each variable can only take 0 or 1, and the task of this problem is to minimize the objective function.
本实施例以分子构象搜索作为待优化问题进行介绍,分子构象对于了解化合物结构、反应机理、能量分布等具有重要作用,在ECD/NMR计算、过渡态探索、过渡态搜索、活性构象生成等计算中,分子构象搜索通常是必不可少的步骤,其通常根据常见的刚性分子结构与若干柔性变化的分子进行计算模拟。This example introduces molecular conformation search as a problem to be optimized. Molecular conformation plays an important role in understanding compound structure, reaction mechanism, energy distribution, etc. In calculations such as ECD/NMR calculations, transition state exploration, transition state search, and active conformation generation, molecular conformation search is usually an indispensable step, which is usually calculated and simulated based on common rigid molecular structures and several molecules with flexible changes.
现有的分子构象搜索方式包括:系统搜索(按照预定策略进行穷举式搜索,随分子数量及可变化键/可旋转键数量的增加,计算量呈指数上升,受限于软件及硬件条件)、随机搜索(具有大量的初始构象,在其中进行随机搜索,可找到接近最稳定的构象,但计算时间较长)、条件搜索(根据研究工作,对分子构象增加了若干初始条件及搜索路径)。Existing molecular conformation search methods include: systematic search (exhaustive search according to a predetermined strategy. The amount of calculation increases exponentially with the increase in the number of molecules and the number of variable bonds/rotatable bonds, which is limited by software and hardware conditions), random search (with a large number of initial conformations, random search can find the conformation close to the most stable one, but the calculation time is long), and conditional search (based on research work, several initial conditions and search paths are added to the molecular conformation).
上述分子构象搜索方式存在如下局限性:只针对静态情况;建模方式较为粗略,耗费时间和算力;可扩展性差,无法应用于更大的构象搜索。The above molecular conformation search method has the following limitations: it is only applicable to static situations; the modeling method is relatively rough, time-consuming and computationally intensive; and it has poor scalability and cannot be applied to larger conformation searches.
由于全局最优的分子构象搜索本质上是一个NP-难的计算问题,其搜索空间大小与相应的计算复杂度随着构成分子的原子数目呈指数增长。经典计算为了降低计算复杂度,采用分子动力学模拟的方法,但是其结果无法保证全局最优。量子计算因为量子叠加原理具有天然的计算并行性,可以在整个分子构象空间进行整体性的并行运算,相比已有的经典算法可以获得指数级的量子加速,尤其对较大规模的分子构象搜索具有显著计算优越性。Since the search for the global optimal molecular conformation is essentially an NP-hard computational problem, the size of the search space and the corresponding computational complexity grow exponentially with the number of atoms that make up the molecule. Classical computing uses molecular dynamics simulation to reduce computational complexity, but its results cannot guarantee global optimality. Quantum computing has natural computational parallelism due to the principle of quantum superposition, and can perform holistic parallel operations in the entire molecular conformation space. Compared with existing classical algorithms, it can achieve exponential quantum acceleration, especially for large-scale molecular conformation searches, which has significant computational superiority.
通过量子计算方法进行分子构象搜索的建模方式具体为:在利用分子力场方法对原子间相互作用进行建模的基础上,运用量子编码方式,将分子构象搜索问题对应的能量函数映射到量子计算机可有效求解的伊辛耦合的自旋玻璃模型。具体的编码过程,可以将分子中相邻化学键之间的可能键角表示成二进制数的形式,在此基础上根据分子力场给出的相互作用、原子位置不重叠、对称性等三个原则定量给出分子构象对应的哈密顿量。The modeling method for molecular conformation search through quantum computing methods is as follows: on the basis of modeling the interaction between atoms using the molecular force field method, the energy function corresponding to the molecular conformation search problem is mapped to the Ising coupled spin glass model that can be effectively solved by quantum computers using quantum coding. The specific coding process can represent the possible bond angles between adjacent chemical bonds in the molecule in the form of binary numbers, and on this basis, the Hamiltonian corresponding to the molecular conformation is quantitatively given according to the three principles of interaction given by the molecular force field, non-overlapping atomic positions, and symmetry.
在本实施例中,利用上述现有技术,先将分子构象搜索问题转换为伊辛耦合的自旋玻璃模型,并提出一种量子编码方式,使该分子构象搜索问题可以在实际的光腔冷原子实验体系中便捷自然得实现编码,分子构象搜索问题转换为哈密顿量基态问题,可在量子计算机上可以通过量子振幅放大、量子绝热淬火、变分量子计算、QAOA、量子Lanczos等算法进行求解。In this embodiment, the above-mentioned existing technology is used to first convert the molecular conformation search problem into an Ising coupled spin glass model, and a quantum encoding method is proposed, so that the molecular conformation search problem can be conveniently and naturally encoded in an actual optical cavity cold atom experimental system. The molecular conformation search problem is converted into a Hamiltonian ground state problem, which can be solved on a quantum computer through algorithms such as quantum amplitude amplification, quantum adiabatic quenching, variational quantum computing, QAOA, and quantum Lanczos.
例如,针对分子构象搜索问题中的蛋白质折叠问题,蛋白质的折叠结构由相邻氨基酸分子的相对位置确定,每相邻两个分子之间的化学键方向可以用二进制变量表示,00表示向下,01表示向右,10表示向左,11表示向上。固定第一条键的方向,可以将任意N个氨基酸的折叠描述简化为2N-4个二进制变量的描述。考虑到旋转对称性限制带来的分子结构兼并,可将第三个二进制变量固定为0,强制第三个氨基酸直行或向下,从而使得所需变量的数量减少为2N-5。因此,某个特殊结构的分子折叠状态可以被描述为如下方程:For example, for the protein folding problem in the molecular conformation search problem, the folding structure of the protein is determined by the relative positions of adjacent amino acid molecules. The direction of the chemical bond between each two adjacent molecules can be represented by a binary variable, 00 for downward, 01 for right, 10 for left, and 11 for upward. By fixing the direction of the first bond, the folding description of any N amino acids can be simplified to the description of 2N-4 binary variables. Taking into account the molecular structure mergers caused by rotational symmetry restrictions, the third binary variable can be fixed to 0, forcing the third amino acid to go straight or downward, thereby reducing the number of required variables to 2N-5. Therefore, the molecular folding state of a particular structure can be described by the following equation:
q=010q1q2q3…q2N-6q2N-5 q=010q 1 q 2 q 3 …q 2N-6 q 2N-5
其中qi=0或1,01表示第一个化学键的方向为向右,0q1表示第二个化学键的方向向右或者向下,该二进制变量序列后续的每两个变量连起来即表示某个化学键的方向。利用该种方式,即可得知各分子在空间中的相对位置,并结合已知的分子之间的相互作用,可以表示为量子比特之间的耦合Eint。子计算中仍需考虑基团不能空间重叠、去除不合理旋转角度等约束条件,这些约束条件由能量函数中添加惩罚项实现,惩罚项分别为Eolap、Econstraint,如下公式所示:Where q i = 0 or 1, 01 means the direction of the first chemical bond is to the right, 0q 1 means the direction of the second chemical bond is to the right or downward, and each subsequent two variables in this binary variable sequence are connected to represent the direction of a chemical bond. In this way, the relative position of each molecule in space can be known, and combined with the known interaction between molecules, it can be expressed as the coupling E int between quantum bits. In the sub-calculation, it is still necessary to consider constraints such as the inability of groups to overlap in space and the removal of unreasonable rotation angles. These constraints are achieved by adding penalty terms to the energy function. The penalty terms are E olap and E constraint , as shown in the following formula:
E(q)=Eint(q)+Eolap(q)+Econstraint(q)E(q)=E int (q)+E olap (q)+E constraint (q)
一般而言,对应的量子优化问题的哈密顿量H(q)是关于序列q中的二进制变量的多项式,此时,哈密顿量的表达式中含有两体以上的耦合项,可以通过引入额外的辅助变量的方式,将原本的多体相互作用项约化为一系列的两体相互作用项,变成QUBO问题的形式。Generally speaking, the Hamiltonian H(q) of the corresponding quantum optimization problem is a polynomial with respect to the binary variables in the sequence q. At this time, the expression of the Hamiltonian contains coupling terms of more than two bodies. By introducing additional auxiliary variables, the original multi-body interaction terms can be reduced to a series of two-body interaction terms, turning it into the form of a QUBO problem.
以图2中的Mijazawa-Jernigan(MJ)模型为例,即脯氨酸-丝氨酸-缬氨酸-赖氨酸-蛋氨酸-丙氨酸(PSVKMA)的六个氨基酸序列,其分子折叠结构可以用序列q=010q1q2q3q4q5q6q7描述。基于已知的分子之间的相互作用大小,可获知其对应的能量函数表达式为:Taking the Mijazawa-Jernigan (MJ) model in Figure 2 as an example, the six amino acid sequence of proline-serine-valine-lysine-methionine-alanine (PSVKMA), its molecular folding structure can be described by the sequence q = 010q 1 q 2 q 3 q 4 q 5 q 6 q 7. Based on the known size of the interaction between molecules, the corresponding energy function expression can be obtained as:
EPSVVKMA(q)=-q2+8q1q2+15q2q3-18q1q2q3-3q1q4+12q1q2q4+4q3q4+3q1q3q4-6q2q3q4-12q1q2q3q4+4q2q5+3q1q2q5-15q2q3q5+15q4q5+3q1q4q5-6q2q4q5-12q1q2q4q5-15q3q4q5+28q2q3q4q5-2q1q2q6-4q3q6+2q2q3q6+13q1q2q3q6-2q1q4q6+4q1q2q4q6+2q3q4q6+13q1q3q4q6+4q2q3q4q6-37q1q2q3q4q6+7q5q6+2q2q5q6+13q1q2q5q6+4q2q4q5q6+9q2q3q5q6-33q1q2q3q5q6-20q4q5q6+13q1q4q5q6+4q2q4q5q6-37q1q2q4q5q6+9q3q4q5q6-33q1q3q4q5q6-37q2q3q4q5q6+99q1q2q3q4q5q6-4q2q7+4q2q3q7+7q4q7+2q2q4q7+13q1q2q3q7+4q3q4q7+9q2q3q4q7-33q1q2q3q4q7+4q2q5q7-18q4q5q7+9q2q4q5q7-33q1q2q4q5q7-33q2q3q4q5q7+62q1q2q3q4q5q7+7q6q7+2q2q6q7+13q1q2q6q7+4q3q6q7+9q2q3q6q7-33q1q2q3q6q7-20q4q6q7+13q1q4q6q7+4q2q4q6q7-37q1q2q4q6q7+9q3q4q6q7-33q1q3q4q6q7-37q2q3q4q6q7+99q1q2q3q4q6q7-18q5q6q7+9q2q5q6q7-33q1q2q5q6q7-33q2q3q5q6q7+62q1q2q3q5q6q7+53q4q5q6q7-33q1q4q5q6q7-37q2q4q5q6q7+99q1q2q4q5q6q7-33q3q4q5q6q7+62q1q3q4q5q6q7+99q2q3q4q5q6q7-190q1q2q3q4q5q6q7 E PSVVKMA (q)=-q 2 +8q 1 q 2 +15q 2 q 3 -18q 1 q 2 q 3 -3q 1 q 4 +12q 1 q 2 q 4 +4q 3 q 4 +3q 1 q 3 q 4 -6q 2 q 3 q 4 -12q 1 q 2 q 3 q 4 +4q 2 q 5 +3q 1 q 2 q 5 -15q 2 q 3 q 5 +15q 4 q 5 +3q 1 q 4 q 5 -6q 2 q 4 q 5 -12q 1 q 2 q 4 q 5 -15q 3 q 4 q 5 +28q 2 q 3 q 4 q 5 -2q 1 q 2 q 6 -4q 3 q 6 +2q 2 q 3 q 6 +13q 1 q 2 q 3 q 6 -2q 1 q 4 q 6 +4q 1 q 2 q 4 q 6 +2q 3 q 4 q 6 +13q 1 q 3 q 4 q 6 +4q 2 q 3 q 4 q 6 -37q 1 q 2 q 3 q 4 q 6 +7q 5 q 6 +2q 2 q 5 q 6 +13q 1 q 2 q 5 q 6 +4q 2 q 4 q 5 q 6 +9q 2 q 3 q 5 q 6 -33q 1 q 2 q 3 q 5 q 6 -20q 4 q 5 q 6 +13q 1 q 4 q 5 q 6 +4q 2 q 4 q 5 q 6 -37q 1 q 2 q 4 q 5 q 6 +9q 3 q 4 q 5 q 6 -33q 1 q 3 q 4 q 5 q 6 -37q 2 q 3 q 4 q 5 q 6 +99q 1 q 2 q 3 q 4 q 5 q 6 -4q 2 q 7 +4q 2 q 3 q 7 +7q 4 q 7 + 2q 2 q 4 q 7 +13q 1 q 2 q 3 q 7 +4q 3 q 4 q 7 +9q 2 q 3 q 4 q 7 -33q 1 q 2 q 3 q 4 q 7 +4q 2 q 5 q 7 -18q 4 q 5 q 7 +9q 2 q 4 q 5 q 7 -33q 1 q 2 q 4 q 5 q 7 - 33q 2 q 3 q 4 q 5 q 7 +62q 1 q 2 q 3 q 4 q 5 q 7 +7q 6 q 7 +2q 2 q 6 q 7 +13q 1 q 2 q 6 q 7 +4q 3 q 6 q 7 +9q 2 q 3 q 6 q 7 -33q 1 q 2 q 3 q 6 q 7 -20q 4 q 6 q 7 +13q 1 q 4 q 6 q 7 +4q 2 q 4 q 6 q 7 -37q 1 q 2 q 4 q 6 q 7 +9q 3 q 4 q 6 q 7 -33q 1 q 3 q 4 q 6 q 7 -37q 2 q 3 q 4 q 6 q 7 +99q 1 q 2 q 3 q 4 q 6 q 7 -18q 5 q 6 q 7 +9q 2 q 5 q 6 q 7 -33q 1 q 2 q 5 q 6 q 7 -33q 2 q 3 q 5 q 6 q 7 +62q 1 q 2 q 3 q 5 q 6 q 7 +53q 4 q 5 q 6 q 7 -33q 1 q 4 q 5 q 6 q 7 -37q 2 q 4 q 5 q 6 q 7 +99q 1 q 2 q 4 q 5 q 6 q 7 -33q 3 q 4 q 5 q 6 q 7 +62q 1 q 3 q 4 q 5 q 6 q 7 +99q 2 q 3 q 4 q 5 q 6 q 7 -190q 1 q 2 q 3 q 4 q 5 q 6 q 7
考虑如图3中的特殊情形,只有第四个和第五个化学键的角度需要考虑,对应的序列表示为q=010010q40q6q7,带入能量函数并改写标记为q=010010q10q2q3,得到如下方程:Consider the special case shown in Figure 3, where only the fourth and fifth chemical bond angles need to be considered. The corresponding sequence is q = 010010q 4 0q 6 q 7 . Substituting the energy function and rewriting the notation as q = 010010q 1 0q 2 q 3 , we obtain the following equation:
E(q)=-1-4q3+9q1q3+9q2q3-16q1q2q3 E(q)=-1-4q 3 +9q 1 q 3 +9q 2 q 3 -16q 1 q 2 q 3
此处引入额外的布尔变量q4=q2q3,即可将原本的三体问题转换为两体问题,且为了保证q4=q2q3可被满足,引入额外的项δ(3q4+q2q3-2q2q4-2q3q4),在该条件被违反时附加能量大于0,其中δ表示惩罚项的强度大小,本实施例中可取δ=9。所获得的能量函数可以为:Here, an additional Boolean variable q 4 =q 2 q 3 is introduced to convert the original three-body problem into a two-body problem. In order to ensure that q 4 =q 2 q 3 can be satisfied, an additional term δ(3q 4 +q 2 q 3 -2q 2 q 4 -2q 3 q 4 ) is introduced. When this condition is violated, the additional energy is greater than 0, where δ represents the intensity of the penalty term. In this embodiment, δ=9 can be taken. The energy function obtained can be:
E(q′)=-1-4q3+36q4+9q1q3-16q1q4-18q2q4-18q3q4 E(q′)=-1-4q 3 +36q 4 +9q 1 q 3 -16q 1 q 4 -18q 2 q 4 -18q 3 q 4
在该能量函数中引入新的伊辛变量si,且满足qi=1-si)/2,并略去能量函数中的常数项,得到伊辛形式的能量函数为:Introducing a new Ising variable s i into the energy function, and satisfying q i =1-s i )/2, and omitting the constant term in the energy function, the energy function in Ising form is obtained:
(7s1+9s2+8s3-20s4+9s1s3+9s2s3-16s1s4-18s2s4-18s3s4)/4(7s 1 +9s 2 +8s 3 -20s 4 +9s 1 s 3 +9s 2 s 3 -16s 1 s 4 -18s 2 s 4 -18s 3 s 4 )/4
对于其中的单体项,可以通过引入一个额外的辅助逻辑比特s0,并固定s0=1即可将上述能量函数写成更便于本实施例进行处理的如下形式:(7s0s1+9s0s2+8s0s3-20s0s4+9s1s3+9s2s3-16s1s4-18s2s4-18s3s4)/4For the single term, an additional auxiliary logic bit s 0 can be introduced and s 0 =1 to write the energy function into the following form which is more convenient for processing in this embodiment: (7s 0 s 1 +9s 0 s 2 +8s 0 s 3 -20s 0 s 4 +9s 1 s 3 +9s 2 s 3 -16s 1 s 4 -18s 2 s 4 -18s 3 s 4 )/4
转换成该伊辛形式的能量函数即可采用本实施例提供的后续步骤进行求解。The energy function converted into the Ising form can be solved using the subsequent steps provided in this embodiment.
S102,针对伊辛形式的能量函数引入物理比特,以使两体相互作用项转换为单体局域作用项,并获得引入的用于保证逻辑比特正确性的限制项。S102, introducing physical bits for the Ising form energy function to convert the two-body interaction term into a single-body local interaction term, and obtaining the introduced restriction term for ensuring the correctness of the logical bit.
在上述步骤将待优化问题转换为QUBO问题、并将QUBO问题对应的初始目标函数转换为伊辛形式的能量函数之后,本步骤用于采用奇偶编码方式、针对上述伊辛形式的能量函数引入物理比特,以将原本全局相互作用的两体相互作用项转换为单体局域作用项,并获得引入的用于保证逻辑比特正确性的限制条件(即限制项)。After the above steps convert the problem to be optimized into a QUBO problem and convert the initial objective function corresponding to the QUBO problem into an Ising form energy function, this step is used to introduce physical bits for the Ising form energy function using parity coding to convert the original global interaction two-body interaction terms into monomer local interaction terms, and obtain the introduced restriction conditions (i.e., restriction terms) for ensuring the correctness of the logical bits.
例如,针对能量函数 For example, for the energy function
可引入物理比特bii′=sisi′,以使两体相互作用项Jii′转换为单体局域作用项J、所述能量函数转换为单体局域场作用的形式并获得引入的用于保证逻辑比特正确性的(n-1)(n-2)/2个限制条件,在本实施例中,n为伊辛形式能量函数的变量个数,在本实施例的场景中可取5,引入所述限制项满足如下方程(也可采用其它方式设置限制项,此处不作限定):bii′bii′+1bi+1i′+1bi+1i′=1。The physical bit b ii′ = s i s i′ can be introduced to convert the two-body interaction term J ii′ into the monomer local interaction term J and the energy function into the form of monomer local field action. And obtain the (n-1)(n-2)/2 constraints introduced to ensure the correctness of the logical bits. In this embodiment, n is the number of variables of the Ising form energy function, which can be 5 in the scenario of this embodiment. The restriction items are introduced to satisfy the following equation (other methods can also be used to set the restriction items, which are not limited here): b ii′ b ii′+1 b i+1i′+1 b i+1i′ =1.
S103,针对限制项构建等价的数字分组问题,并基于数字分组问题获得限制项对应的子目标函数。S103, constructing an equivalent digital grouping problem for the restriction item, and obtaining a sub-objective function corresponding to the restriction item based on the digital grouping problem.
在上述步骤采用奇偶编码方式、针对上述伊辛形式的能量函数引入物理比特,以将原本全局相互作用的两体相互作用项转换为单体局域作用项,并获得引入的用于保证逻辑比特正确性的限制条件(即限制项)之后,本步骤用于针对上述引入的限制项构建等价的数字分组问题,并基于该数字分组问题获得限制项对应的子目标函数。After the above steps use parity coding to introduce physical bits for the Ising form energy function to convert the original global interaction terms into monomer local interaction terms, and obtain the introduced constraints (i.e., constraints) to ensure the correctness of the logical bits, this step is used to construct an equivalent digital grouping problem for the above introduced constraints, and obtain the sub-objective function corresponding to the constraints based on the digital grouping problem.
针对任一布尔变量方程,均可获得对应的SAT语句,使得当该组布尔变量满足原始方程时,对应的SAT语句也被满足。本实施例基于该结论,将原本不易于在物理体系中编码的限制条件(即限制项)、先转换为现有的物理体系中更易于实现的SAT语句形式,可选择的SAT语句形式可以有多种,以3-SAT语句为例,可将每个限制项转换为对应的如下3-SAT语句形式:For any Boolean variable equation, a corresponding SAT statement can be obtained, so that when the group of Boolean variables satisfies the original equation, the corresponding SAT statement is also satisfied. Based on this conclusion, this embodiment converts the restriction conditions (i.e., restriction items) that are originally not easy to encode in the physical system into a SAT statement form that is easier to implement in the existing physical system. There are many selectable SAT statement forms. Taking 3-SAT statements as an example, each restriction item can be converted into the corresponding 3-SAT statement form as follows:
其中,xii,=(bii′+1)/2,β为新引入的辅助变量。通过该转换,可将上述(n-1)(n-2)/2个限制条件约化为具有(n-1)2个变量、4(n-1)(n-2)个字句的3-SAT问题。Wherein, x ii , =(b ii′ +1)/2, β is a newly introduced auxiliary variable. Through this transformation, the above (n-1)(n-2)/2 constraints can be reduced to a 3-SAT problem with (n-1) 2 variables and 4(n-1)(n-2) sentences.
在另一实施方式中,也可将每个限制项写成如下4-SAT语句的形式,通过该转换,可将上述(n-1)(n-2)/2个限制条件约化为具有n(n-1)/2个变量,4(n-1)(n-2)个字句的4-SAT语句:In another embodiment, each restriction item may be written in the form of the following 4-SAT statement. Through this transformation, the above (n-1)(n-2)/2 restriction conditions may be reduced to a 4-SAT statement with n(n-1)/2 variables and 4(n-1)(n-2) words:
其中,xii′=(bii′+1)/2。Wherein, x ii′ =(b ii′ +1)/2.
上述针对限制项构建等价的数字分组问题是指将SAT语句约化为可在光学腔的冷原子体系中编码的数字分组问题,具体的,可基于SAT语句定义数字组,使得当SAT语句由可满足的变量取值时,在定义的数字组中可获取一个子集,该子集中所包含的数字的和值等于某一目标值;基于定义的数字组,构建数字分组问题的目标函数。The above-mentioned construction of an equivalent digital grouping problem for the restriction term refers to reducing the SAT statement to a digital grouping problem that can be encoded in the cold atomic system of the optical cavity. Specifically, a digital group can be defined based on the SAT statement, so that when the SAT statement is evaluated by satisfiable variables, a subset can be obtained in the defined digital group, and the sum of the numbers contained in the subset is equal to a certain target value; based on the defined digital group, the objective function of the digital grouping problem is constructed.
在本实施例中,上述将SAT语句约化为可在光学腔的冷原子体系中编码的数字分组问题的过程中,所定义的数字和目标值中的整数幂级数被替换为无平方因子的整数平方根,具体的,基于现有的经典计算,可将一个3-SAT问题约化为一个整数子集和问题(subsetsum problem),本实施例与该现有经典计算的区别在于:将现有的经典计算中的数字和目标值中的整数幂级数替换为无平方因子的整数平方根,例如,将整数b的幂级数bi替换为第i个无平方因子的整数平方根其目的在于,避免引入指数大的实验参数而出现实验参数的指数爆炸,使得现实的实验平台无法实现。In this embodiment, in the process of reducing the SAT statement to a digital grouping problem that can be encoded in a cold atom system of an optical cavity, the integer power series in the defined digital and target values are replaced by integer square roots without square factors. Specifically, based on existing classical calculations, a 3-SAT problem can be reduced to an integer subset sum problem. The difference between this embodiment and the existing classical calculation is that the integer power series in the digital and target values in the existing classical calculations are replaced by integer square roots without square factors. For example, the power series bi of the integer b is replaced by the i-th integer square root without square factors. The purpose is to avoid the introduction of exponentially large experimental parameters that may lead to an exponential explosion of experimental parameters, making a realistic experimental platform impossible to implement.
假如3-SAT语句由M个字句c1,c2,…,cM组成,且该3-SAT语句包含N个变量x1,x2,…xN,上述基于SAT语句定义数字组,具体包括如下内容:Assuming that a 3-SAT statement consists of M words c 1 , c 2 , …, c M , and the 3-SAT statement contains N variables x 1 , x 2 , …, x N , the above definition of a number group based on the SAT statement specifically includes the following contents:
基于所述SAT语句定义出的所述数字为:The numbers defined based on the SAT statement are:
基于所述SAT语句定义出的所述目标值为:The target value defined based on the SAT statement is:
其中,i的取值范围从1到N,j的取值范围从1到M,αp表示第p个无平方因子的整数;Where i ranges from 1 to N, j ranges from 1 to M, and α p represents the pth integer without square factors;
{ai,bi,cj,dj}构成新的数字分组问题的数字集合,将该数字集合标记序号,重新记为序列{r1,...,rk,...r2M+2N};{a i , b i , c j , d j } constitutes a new digital set for the digital grouping problem. The digital set is marked with serial numbers and re-recorded as a sequence {r 1 , ..., r k , ...r 2M+2N };
基于所述序列构建等价的数字分组问题的目标函数:Based on the sequence, we construct an equivalent objective function for the digital grouping problem:
其中,yk=1或-1,T即定义的目标值。Wherein, y k = 1 or -1, and T is the defined target value.
上述基于数字分组问题获得限制项对应的子目标函数,具体是指将SAT语句的变量的数量和字句的数量代入数字分组问题的目标函数,获得限制项对应的子目标函数。例如,将M=4(n-1)(n-2)、N=(n-1)2代入上述数字分组问题的目标函数,得到如下限制项对应的子目标函数:The sub-objective function corresponding to the restriction item obtained based on the digital grouping problem specifically refers to substituting the number of variables and the number of words of the SAT statement into the objective function of the digital grouping problem to obtain the sub-objective function corresponding to the restriction item. For example, substituting M = 4 (n-1) (n-2) and N = (n-1) 2 into the objective function of the digital grouping problem, the following sub-objective function corresponding to the restriction item is obtained:
S104,将上述子目标函数与单体局域作用项对应的单体函数相结合,获得QUBO问题对应的最终目标函数。S104, combining the above sub-objective function with the monomer function corresponding to the monomer local action term to obtain the final objective function corresponding to the QUBO problem.
在上述步骤S102经奇偶编码使两体相互作用项转换为单体局域作用项、以及步骤S103获得限制项对应的子目标函数之后,本步骤用于将上述子目标函数与单体局域作用项对应的单体函数相结合,获得QUBO问题对应的最终目标函数,具体的,将子目标函数与单体函数相加和,获得的最终目标函数为:After the two-body interaction term is converted into a monomer local interaction term by parity coding in the above step S102, and the sub-objective function corresponding to the restriction term is obtained in step S103, this step is used to combine the above sub-objective function with the monomer function corresponding to the monomer local interaction term to obtain the final objective function corresponding to the QUBO problem. Specifically, the sub-objective function is added to the monomer function, and the final objective function obtained is:
此处需设置Δ足够大。Here, Δ needs to be set large enough.
需要说明的是,在上述获得QUBO问题对应的最终目标函数之后,还需基于所述最终目标函数,使用绝热算法进行求解,并基于解码奇偶编码的算法计算获得所述待优化问题的解。具体的,运用绝热算法对最终目标函数进行求解,得到{yk},且根据步骤S104获得的最终目标函数,可获知前n(n-1)/2个yk=bk,QUBO问题的解可以利用现有的解码奇偶编码的算法从变量{bk}中求解获得。It should be noted that after the final objective function corresponding to the QUBO problem is obtained, it is necessary to use an adiabatic algorithm to solve the final objective function, and obtain the solution of the problem to be optimized based on the algorithm for decoding parity codes. Specifically, the final objective function is solved using an adiabatic algorithm to obtain {y k }, and according to the final objective function obtained in step S104, the first n(n-1)/2 y k = b k can be obtained, and the solution to the QUBO problem can be obtained by using the existing algorithm for decoding parity codes to solve the variable {b k }.
现有技术中,在奇偶编码的基础上,需利用量子比特几何排布的方式实现编码过程中带来的限制条件,但本实施例借助问题约化的方式,不直接在物理平台中编码限制条件,而是借助SAT问题作为桥梁,将限制条件与数字分组问题联系起来(将QUBO问题经过奇偶编码后引入的限制条件转换为一个数字分组问题),使得限制条件可以不借助几何排布方式的情况下、光学腔中的冷原子体系中天然得实现编码,即,通过问题约化的方式使得编码过程只需在一维的冷原子链中即可实现,不需要对原子进行二维空间上的排布,规避了现有技术中需要在二维空间调控原子的要求。该方案充分开发和利用光学腔中冷原子实验系统的非局域相互作用形式,使其成为具有潜力的全局量子优化平台。In the prior art, on the basis of parity coding, it is necessary to use the geometric arrangement of quantum bits to realize the constraints brought about in the coding process. However, this embodiment uses the method of problem reduction, and does not directly encode the constraints in the physical platform, but uses the SAT problem as a bridge to link the constraints with the digital grouping problem (converting the constraints introduced by the QUBO problem after parity coding into a digital grouping problem), so that the constraints can be naturally encoded in the cold atom system in the optical cavity without the help of geometric arrangement. That is, through the method of problem reduction, the coding process only needs to be realized in a one-dimensional cold atom chain, and there is no need to arrange atoms in two-dimensional space, which avoids the requirement of regulating atoms in two-dimensional space in the prior art. This scheme fully develops and utilizes the non-local interaction form of the cold atom experimental system in the optical cavity, making it a potential global quantum optimization platform.
并且,借助将限制条件(限制项)约化为数字分组问题的方式,将原本需要n比特全局相互作用的量子优化问题,编码到光学腔中的冷原子体系中,额外付出的原子的消耗代价为2(n-1)(5n-9)-n,仅仅带来二次方的缩放速度,使得该方案使用的原子数量的缩放较优。Moreover, by reducing the constraints (restrictions) to a digital grouping problem, the quantum optimization problem that originally required n-bit global interactions was encoded into a cold atom system in an optical cavity. The cost of the additional atoms consumed is 2(n-1)(5n-9)-n, which only brings a quadratic scaling speed, making the scaling of the number of atoms used in this scheme better.
上述第一实施例提供了一种方法,与之相对应的,本申请第四实施例还提供了一种装置,由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关的技术特征的细节部分请参见上述提供的方法实施例的对应说明即可,下述对装置实施例的描述仅仅是示意性的。The above-mentioned first embodiment provides a method, and correspondingly, the fourth embodiment of the present application also provides a device. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For details of the relevant technical features, please refer to the corresponding description of the method embodiment provided above. The following description of the device embodiment is merely illustrative.
请参考图4理解该实施例,图4为本实施例提供的装置的单元框图,如图4所示,本实施例提供的装置包括:Please refer to FIG. 4 to understand this embodiment. FIG. 4 is a unit block diagram of a device provided in this embodiment. As shown in FIG. 4 , the device provided in this embodiment includes:
能量函数转换单元201,用于将待优化问题转换为QUBO问题,并将所述QUBO问题对应的初始目标函数转换为伊辛形式的能量函数;An energy function conversion unit 201 is used to convert the problem to be optimized into a QUBO problem, and convert the initial objective function corresponding to the QUBO problem into an energy function in Ising form;
单体局域作用项转换单元202,用于针对所述伊辛形式的能量函数引入物理比特,以使两体相互作用项转换为单体局域作用项,并获得引入的用于保证逻辑比特正确性的限制项;A monomer local interaction term conversion unit 202, used for introducing physical bits into the Ising form energy function, so as to convert the two-body interaction term into a monomer local interaction term, and obtain the introduced restriction term for ensuring the correctness of the logic bit;
数字分组构建单元203,用于针对所述限制项构建等价的数字分组问题,并基于所述数字分组问题获得所述限制项对应的子目标函数;A digital grouping construction unit 203 is used to construct an equivalent digital grouping problem for the restriction item, and obtain a sub-objective function corresponding to the restriction item based on the digital grouping problem;
最终目标函数获得单元204,用于将所述限制项对应的子目标函数与所述单体局域作用项对应的单体函数相结合,获得所述QUBO问题对应的最终目标函数。The final objective function obtaining unit 204 is used to combine the sub-objective function corresponding to the restriction term with the monomer function corresponding to the monomer local action term to obtain the final objective function corresponding to the QUBO problem.
在一些实施方式中,所述针对所述限制项构建等价的数字分组问题,包括:In some implementations, constructing an equivalent digital grouping problem for the restriction item includes:
将所述限制项转换为SAT语句,并将所述SAT语句约化为可在光学腔的冷原子体系中编码的数字分组问题。The constraints are converted into SAT statements, and the SAT statements are reduced to a digital grouping problem that can be encoded in a cold atomic system of an optical cavity.
在一些实施方式中,所述将所述SAT语句约化为可在光学腔的冷原子体系中编码的数字分组问题,包括:In some embodiments, reducing the SAT statement to a digital grouping problem that can be encoded in a cold atom system of an optical cavity includes:
基于所述SAT语句定义数字组,使得当所述SAT语句由可满足的变量取值时,在所述数字组中可获取一个子集,所述子集中所包含的数字的和值等于某一目标值,其中,所述数字和所述目标值中的整数幂级数被替换为无平方因子的整数平方根;A number group is defined based on the SAT statement, so that when the SAT statement is evaluated by a satisfiable variable, a subset can be obtained in the number group, and the sum of the numbers included in the subset is equal to a certain target value, wherein the integer power series in the numbers and the target value are replaced by integer square roots without square factors;
基于所述数字组,构建数字分组问题的目标函数。Based on the number groups, an objective function of the number grouping problem is constructed.
在一些实施方式中,所述SAT语句由M个字句c1,c2,…,cM组成,且所述SAT语句包含N个变量x1,x2,…xN,基于所述SAT语句定义数字组,包括:In some implementations, the SAT statement is composed of M clauses c 1 , c 2 , ..., c M , and the SAT statement contains N variables x 1 , x 2 , ..., x N . Defining a number group based on the SAT statement includes:
基于所述SAT语句定义出的所述数字为:The numbers defined based on the SAT statement are:
基于所述SAT语句定义出的所述目标值为:The target value defined based on the SAT statement is:
其中,i的取值范围从1到N,j的取值范围从1到M,αp表示第p个无平方因子的整数;Where i ranges from 1 to N, j ranges from 1 to M, and α p represents the pth integer without square factors;
{ai,bi,cj,dj}构成新的数字分组问题的数字集合,将该数字集合记为序列{r1,…,rk,…e2M+2N};{a i , b i , c j , d j } constitutes a new digital grouping problem digital set, which is recorded as a sequence {r 1 , …, r k , …e 2M+2N };
基于所述序列构建等价的数字分组问题的目标函数:Based on the sequence, we construct an equivalent objective function for the digital grouping problem:
其中,yk=1或-1。Here, y k =1 or -1.
在一些实施方式中,所述基于所述数字分组问题获得所述限制项对应的子目标函数,包括:In some implementations, obtaining the sub-objective function corresponding to the restriction item based on the digital grouping problem includes:
将所述SAT语句的变量的数量和字句的数量代入所述数字分组问题的目标函数,获得所述限制项对应的子目标函数。Substitute the number of variables and the number of sentences of the SAT statement into the objective function of the digital grouping problem to obtain the sub-objective function corresponding to the restriction item.
在一些实施方式中,所述伊辛形式的能量函数表示为:In some embodiments, the Ising form energy function is expressed as:
所述针对所述伊辛形式的能量函数引入物理比特,以使两体相互作用项转换为单体局域作用项,并获得引入的用于保证逻辑比特正确性的限制项,包括:The energy function of the Ising form introduces physical bits to convert the two-body interaction term into a monomer local interaction term, and obtains the introduced restriction term for ensuring the correctness of the logical bit, including:
针对所述伊辛形式的能量函数引入物理比特bii′=sisi′,以使两体相互作用项Jii′转换为单体局域作用项J、所述能量函数转换为单体局域场作用的形式并获得引入的用于保证逻辑比特正确性的(n-1)(n-2)/2个限制条件,其中,n为伊辛形式能量函数的变量个数,引入所述限制项满足如下方程:The physical bit b ii′ = s i s i′ is introduced into the Ising form energy function to convert the two-body interaction term J ii′ into a monomer local interaction term J and the energy function into a monomer local field action form. And obtain the (n-1)(n-2)/2 constraints introduced to ensure the correctness of the logic bit, where n is the number of variables of the Ising form energy function, and the introduced constraints satisfy the following equation:
bii′bii′+1bi+1i′+1bi+1i′=1。b ii′ b ii′+1 b i+1i′+1 b i+1i′ =1.
在一些实施方式中,所述将所述限制项转换为SAT语句,包括:In some implementations, converting the restriction item into a SAT statement includes:
将每个限制项写成一个对应的3-SAT语句的形式,以将(n-1)(n-2)/2个限制项约化为具有(n-1)2个变量,4(n-1)(n-2)个字句的3-SAT语句:Write each restriction in the form of a corresponding 3-SAT statement to reduce the (n-1)(n-2)/2 restrictions to a 3-SAT statement with (n-1) 2 variables and 4(n-1)(n-2) words:
其中,xii′=(bii′+1)/2,β为新引入的辅助变量。Among them, x ii′ =(b ii′ +1)/2, and β is a newly introduced auxiliary variable.
在一些实施方式中,所述将所述限制项转换为SAT语句,包括:In some implementations, converting the restriction item into a SAT statement includes:
将每个限制项写成一个对应的4-SAT语句的形式,以将(n-1)(n-2)/2个限制项约化为具有n(n-1)/2个变量,4(n-1)(n-2)个字句的4-SAT语句:Write each restriction in the form of a corresponding 4-SAT statement to reduce the (n-1)(n-2)/2 restrictions to a 4-SAT statement with n(n-1)/2 variables and 4(n-1)(n-2) words:
其中,xii′=(bii′+1)/2。Wherein, x ii′ =(b ii′ +1)/2.
在一些实施方式中,所述装置还包括:In some embodiments, the device further comprises:
求解单元,用于基于所述最终目标函数,使用绝热算法进行求解,并基于解码奇偶编码的算法计算获得所述待优化问题的解。A solving unit is used to solve the problem to be optimized by using an adiabatic algorithm based on the final objective function and calculating the solution based on an algorithm for decoding parity coding.
在上述的实施例中,提供了一种量子优化方法以及一种量子优化装置,此外,本申请另一实施例还提供一种电子设备,该电子设备可以设置程序形式的上述量子优化装置,以执行本发明实施例提供的量子优化过程。本申请提供的电子设备实施例描述得比较简单,相关部分请参见上述方法实施例的对应说明即可,下述描述的实施例仅仅是示意性的。可选的,该电子设备的一种可选硬件结构可如图3所示,包括:至少一个处理器01,至少一个通信接口302,至少一个存储器303和至少一个通信总线304;In the above-mentioned embodiments, a quantum optimization method and a quantum optimization device are provided. In addition, another embodiment of the present application further provides an electronic device, which can be provided with the above-mentioned quantum optimization device in the form of a program to execute the quantum optimization process provided by the embodiment of the present invention. The electronic device embodiment provided in this application is described relatively simply. For the relevant parts, please refer to the corresponding description of the above-mentioned method embodiment. The embodiment described below is merely exemplary. Optionally, an optional hardware structure of the electronic device may be as shown in Figure 3, including: at least one processor 01, at least one communication interface 302, at least one memory 303 and at least one communication bus 304;
可选的,通信接口302可以为通信模块的接口,如GSM模块的接口;Optionally, the communication interface 302 may be an interface of a communication module, such as an interface of a GSM module;
处理器01可能是中央处理器CPU,或者是特定集成电路ASIC(ApplicationSpecific Integrated Circuit),或者是被配置成实施本发明实施例的一个或多个集成电路。The processor 01 may be a central processing unit CPU, or an application specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention.
存储器303可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。The memory 303 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
其中,存储器303存储有程序,处理器301调用存储器303所存储的程序,以执行本发明实施例提供的量子优化方法。The memory 303 stores a program, and the processor 301 calls the program stored in the memory 303 to execute the quantum optimization method provided in the embodiment of the present invention.
在上述实施例中,提供了一种量子优化方法、一种量子优化装置以及一种电子设备,此外,本申请另一实施例还提供了一种用于实现上述量子优化方法的计算机可读存储介质。本申请提供的计算机可读存储介质实施例描述得比较简单,相关部分请参见上述方法实施例的对应说明即可,下述描述的实施例仅仅是示意性的。In the above embodiments, a quantum optimization method, a quantum optimization device, and an electronic device are provided. In addition, another embodiment of the present application further provides a computer-readable storage medium for implementing the above quantum optimization method. The computer-readable storage medium embodiment provided in the present application is described relatively simply. For the relevant parts, please refer to the corresponding description of the above method embodiment. The embodiments described below are merely illustrative.
本实施例提供的计算机可读存储介质上存储有计算机指令,该指令被处理器执行时,可实现上述实施例所提供的量子优化方法。The computer-readable storage medium provided in this embodiment stores computer instructions, and when the instructions are executed by a processor, the quantum optimization method provided in the above embodiment can be implemented.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
1、计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
2、本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。2. Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
本申请虽然以较佳实施例公开如上,但其并不是用来限定本申请,任何本领域技术人员在不脱离本申请的精神和范围内,都可以做出可能的变动和修改,因此本申请的保护范围应当以本申请权利要求所界定的范围为准。Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310769824.4A CN116739101B (en) | 2023-06-27 | 2023-06-27 | A quantum optimization method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310769824.4A CN116739101B (en) | 2023-06-27 | 2023-06-27 | A quantum optimization method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN116739101A CN116739101A (en) | 2023-09-12 |
| CN116739101B true CN116739101B (en) | 2024-07-26 |
Family
ID=87918318
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310769824.4A Active CN116739101B (en) | 2023-06-27 | 2023-06-27 | A quantum optimization method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116739101B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119808977B (en) * | 2025-03-11 | 2025-07-15 | 国开启科量子技术(安徽)有限公司 | Distributed quantum computing method, apparatus, device and medium for Simon problem |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114127856A (en) * | 2019-05-13 | 2022-03-01 | 1Qb信息技术公司 | Method and system for quantum computation enabled molecular de novo computation simulation |
| CN115514488A (en) * | 2022-09-14 | 2022-12-23 | 上海交通大学 | Big integer decomposition problem mapping method and system based on Itanium model |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CA3060810A1 (en) * | 2018-11-02 | 2020-05-02 | Iqb Information Technologies Inc. | Method and system for determining a conformation of a molecule using high-performance binary optimizer |
| US10592816B1 (en) * | 2018-12-03 | 2020-03-17 | Accenture Global Solutions Limited | Quantum computation for optimization in exchange systems |
| CN115630704B (en) * | 2022-08-29 | 2024-07-02 | 北京量子信息科学研究院 | Method for solving multi-body problem and quantum computing system |
-
2023
- 2023-06-27 CN CN202310769824.4A patent/CN116739101B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114127856A (en) * | 2019-05-13 | 2022-03-01 | 1Qb信息技术公司 | Method and system for quantum computation enabled molecular de novo computation simulation |
| CN115514488A (en) * | 2022-09-14 | 2022-12-23 | 上海交通大学 | Big integer decomposition problem mapping method and system based on Itanium model |
Also Published As
| Publication number | Publication date |
|---|---|
| CN116739101A (en) | 2023-09-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP7471736B2 (en) | Method and system for estimating ground state energy of a quantum system | |
| De Vos | Reversible computing: fundamentals, quantum computing, and applications | |
| CN110825375A (en) | Quantum program conversion method and device, storage medium and electronic device | |
| JP7297540B2 (en) | Information processing device, PUBO solver, information processing method and program | |
| JP6925546B1 (en) | Arithmetic system, information processing device, and optimal solution search processing method | |
| CN116739101B (en) | A quantum optimization method and device | |
| Liang et al. | Operator algebra and algorithmic construction of boundaries and defects in (2+ 1) D topological Pauli stabilizer codes | |
| CN111626424A (en) | Quantum register distribution method and system for noisy medium-sized quantum computing architecture | |
| Desai et al. | Implementing a neural network interatomic model with performance portability for emerging exascale architectures | |
| Xue et al. | Quantum information protection scheme based on reinforcement learning for periodic surface codes | |
| CN118520845A (en) | Optimizing method for text embedding model | |
| CN120611804A (en) | Method and device for rapid generation of quantum chemical Hamiltonian based on stable subtable | |
| Zhang et al. | Generative AI through CAS lens: An integrated overview of algorithmic optimizations, architectural advances, and automated designs | |
| CN114512193A (en) | Method for preparing system test state based on spin symmetry and equivalent particle characteristics | |
| Iftemi et al. | Quantum computing applications and impact for cyber physical systems | |
| WO2022087718A1 (en) | Operator implementations for quantum computation | |
| Rosenhahn et al. | Optimization driven quantum circuit reduction | |
| Brown et al. | 5 year update to the next steps in quantum computing | |
| Arponen et al. | Independent-cluster parametrizations of wave functions in model field theories: Ii. classical mappings and their algebraic structure | |
| Song et al. | Design and implementation of a parallel Stein algorithm based on a ternary optical computer | |
| Yang et al. | Spacetime-Efficient and Hardware-Compatible Complex Quantum Logic Units in qLDPC Codes | |
| CN113222154B (en) | A method and device for determining the amplitude of a quantum state | |
| EP3852028A1 (en) | Optimization device, control method for optimization device, and control program for optimization device | |
| Sangiogo-Gil et al. | Nonadiabatic molecular dynamics on quantum computers: challenges and opportunities | |
| CN116579274A (en) | An Automatic Design Method for Tensor Operation Acceleration Chip |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |