Frequency spectrum allocation method and system based on mixed quantum and classical algorithm

By using mixed quantum and classical algorithm methods in spectrum allocation, Boolean expressions and parse trees are constructed, high-quality search spaces are selected for non-uniform superposition, and combined with iterative adjustment of average inversion operators, the problems of large-scale spectrum allocation problems are solved, and efficient spectrum allocation is achieved.

CN119865903AActive Publication Date: 2025-04-22WUHAN HANGCHUNYUAN TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510010065.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-04-22
Estimated Expiration
2045-01-03

AI Technical Summary

Technical Problem

When the prior art faces the problem of large-scale spectrum allocation, the time complexity and calculation overhead are high, making it difficult to effectively solve the spectrum allocation problem when the number of equipment increases and the interference relationship increases.

Method used

Using a spectrum allocation method based on mixed quantum and classical algorithms, by constructing Boolean expressions and parse trees, high-quality search space is selected for non-uniform superposition, combined with iterative adjustment of average inversion operators, narrowing the search space and improving solution efficiency.

Benefits of technology

It significantly reduces computing time, saves computing resources, improves the solution efficiency of spectrum allocation problems, and avoids redundant calculations and unnecessary resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119865903A_ABST
    Figure CN119865903A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of spectrum allocation, and particularly relates to a spectrum allocation method and system based on mixed quantum and a classical algorithm, according to a constructed Boolean expression, an analytic tree is analyzed, then a high-quality search space is selected from a search space according to the ratio of a positive variable to a negative variable in the analytic tree, and in the high-quality search space, the high-quality search space is selected from a search space. Non-uniform superposition is firstly carried out, then a target distribution scheme is overturned, then iteration is continuously carried out on an overturning scheme set through a constructed average inversion operator, the amplitude of the target scheme is increased, and an amplitude increasing scheme set is obtained; and measuring the amplitude increasing scheme set to obtain a distribution result. Compared with a traditional spectrum allocation mode, the method has the advantages that the search space is reduced to a high-quality search space, the search range is reduced, redundant calculation and unnecessary resource consumption are avoided, the transformation from a traditional uniform superposition state to centralized search is realized, and the search efficiency is improved. And the practical application capability of quantum search in a complex combination optimization problem is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of spectrum allocation, and in particular relates to a spectrum allocation method and system based on hybrid quantum and classical algorithms. Background Art

[0002] The spectrum allocation problem is a core issue in the field of wireless communications. Its core task is to allocate frequency resources to communication devices, requiring that the frequencies of adjacent devices do not interfere with each other and that limited spectrum resources be used as efficiently as possible. As a typical NP-complete problem, the complexity of spectrum allocation increases rapidly with the increase in the number of devices and interference relationships.

[0003] In related technologies, spectrum allocation is mainly solved by backtracking algorithm, greedy algorithm and genetic algorithm. However, when faced with large-scale spectrum allocation problems, its time complexity and computational overhead are difficult to be satisfactory. Once the number of devices increases and the interference relationship increases, solving the appropriate spectrum allocation requires a lot of time and computing resources, which increases costs. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a spectrum allocation method and system based on hybrid quantum and classical algorithms, which can reduce computing time and save computing resources.

[0005] A spectrum allocation method based on hybrid quantum and classical algorithms, comprising:

[0006] Obtain the number of devices and frequencies to be allocated spectrum;

[0007] Acquiring a connection relationship between adjacent devices and setting a constraint condition between adjacent devices, wherein the adjacent devices are devices that have frequency interference with each other, and the constraint condition is that the frequencies allocated to the adjacent devices are different;

[0008] Establishing a Boolean expression according to the number of devices to be allocated and the constraint conditions;

[0009] According to the expansion of the Boolean expression, a parse tree is constructed, the parse tree includes a root node and a plurality of child nodes, the child nodes include leaf nodes and non-leaf nodes, the leaf node is a node without child nodes, the root node and the non-leaf node store logical relationships, including logical AND, logical OR and logical NOT, the leaf node stores device variables, the device variables modified by logical NOT are negative variables, and the device variables not modified by logical NOT are positive variables;

[0010] According to the number of devices, a total number of allocation scheme combinations for spectrum allocation to each device is calculated, and the total number of allocation scheme combinations is used as a search space, where the search space includes a front search space, a middle search space, and a rear search space;

[0011] Traversing each node of the parse tree to obtain a ratio of the number of positive and negative variables, and selecting a high-quality search space from the search space according to the ratio of the number of positive and negative variables;

[0012] Performing non-uniform superposition on the allocation schemes according to the high-quality search space to obtain an initial scheme after non-uniform superposition, wherein the amplitude of each allocation scheme in the initial scheme is the same;

[0013] Marking all the non-uniform superposition initial schemes according to the constraint conditions to obtain a target scheme set, and performing phase flipping on the target scheme set to obtain a flipped scheme set;

[0014] The flipping scheme set is continuously iteratively adjusted through an average inversion operator to increase the amplitude of the target scheme, thereby obtaining an amplitude increase scheme set;

[0015] The amplitude increase scheme set is measured to obtain an allocation result.

[0016] Optionally, constructing a parse tree according to the expansion of the Boolean expression includes:

[0017] The Boolean expression is:

[0018]

[0019] Expand the Boolean expression to get the expanded form of the Boolean expression:

[0020]

[0021] Among them, A, B and C are different devices. Indicates different frequencies, ∧ indicates logical AND operation, ∨ indicates logical OR operation, Represents logical NOT operation;

[0022] According to the expansion of the Boolean expression, sub-nodes including different logical operations and connection relationships of the sub-nodes are obtained;

[0023] A parse tree is constructed according to the connection relationship of the sub-nodes and the logical operations of the sub-nodes.

[0024] Optionally, traversing each node of the parse tree to obtain a ratio of the number of positive and negative variables, and selecting a high-quality search space from the search space according to the positive and negative variables includes:

[0025] Get the number of device variables modified by non-nodes, the number of device variables modified by and nodes, and the number of device variables modified by or nodes in the parse tree;

[0026] Calculate the sum of the number of device variables modified by AND nodes and the number of device variables modified by OR nodes as the number of positive variables, as the number of positive variables;

[0027] Take the number of device variables modified by the NOT nodes as the number of negative variables;

[0028] Calculate the ratio of the number of positive variables to the number of negative variables as the ratio of positive and negative variable numbers;

[0029] Select a high-quality search space from the search space according to the positive and negative variables.

[0030] Optionally, the selecting a high-quality search space from the search space according to the ratio of positive and negative variable numbers includes:

[0031] Set a threshold for the ratio of positive and negative variables;

[0032] When the ratio of positive and negative variable numbers is less than the minimum value of the threshold for the ratio of positive and negative variables, select the previous search space as the high-quality search space;

[0033] When the ratio of positive and negative variable numbers is greater than the maximum value of the threshold for the ratio of positive and negative variables, select the subsequent search space as the high-quality search space;

[0034] When the ratio of positive and negative variable numbers is within the threshold for positive and negative variables, select the middle search space as the high-quality search space.

[0035] Optionally, the marking all the non-uniform superposition initial schemes according to the constraint conditions to obtain a set of target schemes and performing phase flipping on the set of target schemes to obtain a set of flipped schemes includes:

[0036] Obtain a preset allocation scheme;

[0037] Mark all the initial schemes in the non-uniform superposition initial schemes that satisfy the preset allocation scheme to obtain a set of target schemes, and perform phase flipping on the set of target schemes to obtain a set of flipped schemes.

[0038] Optionally, the continuously iteratively adjusting the set of flipped schemes through the average inversion operator to increase the amplitude of the target scheme to obtain a set of schemes with increased amplitude includes:

[0039] The average inversion operator is expressed as:

[0040] U s = 2|s><s| - I;

[0041] where |s> is the uniform superposition state of all potential solutions, and I is the identity operator, and <s| is the conjugate transpose of |s>;

[0042] The flipping scheme set is continuously iteratively adjusted through the average inversion operator to reduce the amplitude of non-target schemes and increase the amplitude of target schemes, wherein the target scheme is a scheme that satisfies the constraint conditions of spectrum allocation.

[0043] Optionally, measuring the amplitude increase scheme set to obtain an allocation result includes:

[0044] The amplitude increase scheme set is measured to obtain an allocation scheme corresponding to a maximum amplitude value;

[0045] The allocation scheme corresponding to the maximum amplitude value is taken as the allocation result.

[0046] A spectrum allocation system based on hybrid quantum and classical algorithms, comprising:

[0047] A first acquisition module is used to acquire the number of devices and the number of frequencies to be allocated spectrum;

[0048] A second acquisition module is used to acquire a connection relationship between adjacent devices and set a constraint condition between adjacent devices, wherein the adjacent devices are devices that have frequency interference with each other, and the constraint condition is that the frequencies allocated to the adjacent devices are different;

[0049] A first establishing module, used for establishing a Boolean expression according to the number of devices to be allocated and the constraint condition;

[0050] The second building module is used to expand the Boolean expression and construct a parse tree, the parse tree includes a root node and a plurality of child nodes, the child nodes include leaf nodes and non-leaf nodes, the leaf nodes are nodes without child nodes, the root nodes and non-leaf nodes store logical relationships, including logical AND, logical OR and logical NOT, the leaf nodes store device variables, the device variables modified by logical NOT are negative variables, and the device variables not modified by logical NOT are positive variables;

[0051] A calculation module, configured to calculate a total number of allocation scheme combinations for spectrum allocation to each device according to the number of devices, and use the total number of allocation scheme combinations as a search space, wherein the search space includes a front search space, a middle search space, and a rear search space;

[0052] A traversal module, used for traversing each node of the parse tree to obtain a ratio of the number of positive and negative variables, and selecting a high-quality search space from the search space according to the ratio of the number of positive and negative variables;

[0053] An initialization module, used for performing non-uniform superposition on the allocation scheme according to the high-quality search space to obtain an initial scheme after non-uniform superposition, wherein the amplitude of each allocation scheme in the initial scheme is the same;

[0054] A marking module, used for marking all the non-uniform superposition initial schemes according to the constraint conditions to obtain a target scheme set, and performing phase flipping on the target scheme set to obtain a flipped scheme set;

[0055] An amplitude amplification module, used for iteratively adjusting the flipping scheme set continuously through an average inversion operator to increase the amplitude of the target scheme and obtain an amplitude amplification scheme set;

[0056] The measuring module is used to measure the amplitude increase scheme set to obtain an allocation result.

[0057] A terminal device includes a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor loads and executes the computer program, a spectrum allocation method based on a hybrid quantum and classical algorithm is adopted.

[0058] A computer-readable storage medium stores a computer program, which, when loaded and executed by a processor, adopts a spectrum allocation method based on a hybrid quantum and classical algorithm.

[0059] The beneficial effects of the present invention are:

[0060] According to the constructed Boolean expression, it is parsed into a parse tree, and then according to the ratio of positive variables to negative variables in the parse tree, a high-quality search space is selected from the search space, and the search range of the entire search space is reduced to a high-quality search space. Then, in the high-quality search space, non-uniform superposition is first performed to apply a larger amplitude to the potential solutions concentrated in the second half, so that its weight is significantly higher than other parts. Then, after the target allocation scheme is flipped, the flipping scheme set is continuously iterated through the constructed average inversion operator to increase the amplitude of the target scheme and obtain an amplitude increase scheme set; the amplitude increase scheme set is measured to obtain the allocation result. Compared with the traditional spectrum allocation method, the present application narrows the search space to a high-quality search space, reduces the search range, avoids redundant calculations and unnecessary resource consumption, and secondly, realizes the transition from the traditional uniform superposition state to the centralized search, which significantly improves the practical application ability of quantum search in complex combinatorial optimization problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 A schematic diagram of modeling a communication network of a spectrum allocation problem as a mathematically undirected graph frequency allocation problem of the present invention;

[0062] Figure 2 It is intended to represent the XOR truth value of the present invention;

[0063] Figure 3 A schematic diagram of a parse tree after converting a Boolean expression into a parse tree according to the present invention;

[0064] Figure 4 It is a schematic diagram of uniform superposition of the initial state of the traditional Grover algorithm of the present invention;

[0065] Figure 5 A schematic diagram of the non-uniform superposition of the initial state used in the present invention;

[0066] Figure 6 A schematic diagram of the magnitude of potential allocation solutions eliminated in the remaining part of the original search space by the present invention;

[0067] Figure 7 A phase reversal schematic diagram of the target allocation scheme of the present invention;

[0068] Figure 8 Apply U to the present invention ω Schematic diagram of the relationship between all allocation schemes and amplitude after operation;

[0069] Fig. 9 Apply U to the present invention s Schematic diagram of the relationship between all allocation schemes and amplitude after operation;

[0070] Fig.10 It is a schematic diagram of the comparison results between the present invention and the traditional calculation method. DETAILED DESCRIPTION

[0071] A spectrum allocation method based on hybrid quantum and classical algorithms, the invention comprises:

[0072] S1. Obtain the number of devices and frequencies to which spectrum is to be allocated.

[0073] The spectrum allocation for specific devices aims to use fewer frequencies to allocate spectrum for different devices. Generally speaking, the amount of spectrum is limited. If a different spectrum is allocated to each device, the cost will be greatly increased. Therefore, spectrum is allocated to each device under the premise of non-interference.

[0074] First, the communication network in the spectrum allocation problem needs to be modeled as an undirected graph frequency allocation problem in mathematics. Specifically, each wireless device in the communication network can correspond to a node in the undirected graph, and the interference relationship between the devices is mapped to the edge in the undirected graph. Through this mapping method, the interference information of the communication network is completely embedded in the undirected graph, laying the foundation for further mathematical modeling and solution. The core of this transformation process is to establish a strict correspondence between wireless devices and nodes, and interference relationships and edges. For example, in cellular network spectrum allocation, each base station or user equipment can be regarded as a node, and the possibility of interference between two devices can be represented by an undirected edge. This transformation simplifies the original wireless communication interference problem into an analysis of the graph structure. The transformation process is as follows: Figure 1 The goal of the transformed undirected graph frequency assignment problem is to determine the frequency of each node while satisfying certain constraints. The constraints usually require that adjacent nodes be assigned different frequencies to avoid interference.

[0075] S2, obtaining the connection relationship between adjacent devices and setting the constraint conditions between adjacent devices, where the adjacent devices are devices that have frequency interference with each other, and the constraint condition is that the frequencies allocated to the adjacent devices are different;

[0076] Specifically, by introducing Boolean relations, the undirected graph frequency allocation problem can be further transformed into a Boolean satisfiability problem (SAT). In this process, the nodes of the undirected graph are mapped to Boolean variables in the Boolean formula, and the assignment combinations of these variables are used to describe possible frequency allocation schemes. By solving the Boolean formula, a solution that satisfies the interference constraints can be found, thereby solving the original spectrum allocation problem.

[0077] The frequency allocation of each undirected graph node can be represented by a Boolean variable. For example, the true or false value of a Boolean variable can be used to identify whether a node is assigned a specific frequency. In order to ensure that the spectrum allocation meets the constraints (for example, avoiding frequency conflicts between adjacent devices), the relationship between these variables can be modeled through Boolean logic formulas. For example, for two adjacent nodes (devices with an interference relationship), an incompatible constraint formula can be introduced to ensure that they are not assigned the same frequency.

[0078] Take two devices as an example, assuming that the frequency of one device is f a , the frequency of the other device is f b Using Boolean operations, the exclusive OR (XOR) operation can be used to simply and efficiently ensure that the frequencies of the two devices are different. a and f b When the XOR result is 1, it means that the two devices are assigned different frequencies, thus satisfying the constraints of the spectrum allocation problem.

[0079] More specifically, when two adjacent devices f a and f b When the XOR result of satisfies the following formula, the variable assignment combination can meet the solution requirements of the Boolean expression:

[0080]

[0081] After expanding it, it can be written as:

[0082]

[0083] This formula clearly reflects the logical relationship between two variables when they take different values. For a more intuitive understanding, you can refer to the truth table of the XOR gate (such as Figure 2 According to the truth table, when f a and f b Take different values ​​(such as f a =0,f b =1 or f a =1,f b =0), the result of the XOR operation is 1, which meets the above assumptions and satisfies the interference condition. Similarly, this method can be extended to more complex spectrum allocation problems. For example, in the multi-band allocation problem, multiple Boolean variables can be used to encode more frequencies, and the corresponding Boolean expressions can be expanded to construct a logical formula that meets the complex interference constraints.

[0084] S3. Establish a Boolean expression according to the number of devices to be allocated and the constraints;

[0085] Specifically, when there are multiple devices, binary codes "0" and "1" are set according to the different frequency values ​​of each device, and one bit is used to represent the frequency allocation state of the device to establish a Boolean expression for multiple devices.

[0086] S4. Expand the Boolean expression and construct a parse tree. The parse tree includes a root node and several child nodes. The child nodes include leaf nodes and non-leaf nodes. The leaf nodes are nodes without child nodes. The root nodes and non-leaf nodes store logical relationships, including logical AND, logical OR and logical NOT. The leaf nodes store device variables. The device variables modified by logical NOT are negative variables, and the device variables not modified by logical NOT are positive variables.

[0087] According to the expansion of Boolean expression, building a parse tree includes:

[0088] The Boolean expression is:

[0089]

[0090] Expand the Boolean expression to get the expanded form of the Boolean expression:

[0091]

[0092] Among them, A, B and C are the frequencies of different devices. Indicates different frequencies, ∧ indicates logical AND operation, ∨ indicates logical OR operation, Represents logical NOT operation;

[0093] The result of the Boolean expression is 1, which is a constraint condition, indicating that the frequencies of adjacent devices are not the same.

[0094] According to the expansion of the Boolean expression, the sub-nodes containing different logical operations and the connection relationship of the sub-nodes are obtained;

[0095] Specifically, the connection relationship indicates whether there will be interference between adjacent devices, and the sub-nodes of different logical operations are obtained after the Boolean expression is expanded according to the logical relationship between each device and other devices.

[0096] Construct a parse tree based on the connection relationship of child nodes and the logical operations of child nodes.

[0097] Specifically, the recursive descent algorithm is used to parse the Boolean expression of spectrum allocation, and it is gradually decomposed into a hierarchical syntax tree, where the internal nodes represent logical operators (such as AND, OR, NOT), and the leaf nodes correspond to the frequency variables allocated to user equipment or communication links. The recursive descent algorithm can accurately capture the logical dependencies and mutually exclusive constraints between variables in spectrum allocation by parsing the substructure of the expression layer by layer.

[0098] Taking three devices as an example, the Boolean expression expansion is:

[0099]

[0100] The parse tree built based on this expansion is as follows Figure 3 shown.

[0101] S5. Calculate the total number of allocation scheme combinations for spectrum allocation to each device according to the number of devices, and use the total number of allocation scheme combinations as a search space, where the search space includes a front search space, a middle search space, and a rear search space;

[0102] Specifically, when the number of devices is determined, all the schemes for allocating spectrum to each device can be obtained, including all spectrum allocation schemes that meet the constraints and those that do not meet the constraints. When the number of devices is n, the total number of allocation scheme combinations is 2. n That is, there are several different spectrum allocation schemes in the search space.

[0103] When the search space is allocated, it is first divided into 3 equal parts. If it cannot be divided into 3 equal parts, the front search space and the rear search space are allocated first, and then the middle search space is filled with the value of the front search space or the rear search space. For example, when the number of devices is 3, there are 3 allocation schemes in the front search space and 3 allocation schemes in the rear search space. At this time, there are only 2 allocation schemes in the middle search space. In this case, one allocation scheme of the front search space or the rear search space is copied to fill the middle search space.

[0104] S6, traverse each node of the parse tree, obtain the ratio of the number of positive and negative variables, and select a high-quality search space from the search space according to the ratio of the number of positive and negative variables;

[0105] Traverse each node of the parse tree to obtain the ratio of the number of positive and negative variables. Select the high-quality search space from the search space based on the positive and negative variables, including:

[0106] Get the number of device variables modified by non-nodes, the number of device variables modified by and nodes, and the number of device variables modified by or nodes in the parse tree;

[0107] Specifically, since the child nodes in the parse tree are established through the logical operation attributes of the Boolean expression expansion, each node of the parse tree is directly traversed to obtain the node number of different nodes.

[0108] Calculate the sum of the number of device variables modified by the AND node and the number of device variables modified by the OR node as the number of positive variables;

[0109] The number of the device variables modified by the non-node is taken as the number of negative variables;

[0110] Calculate the ratio of the number of positive variables to the number of negative variables as the ratio of the number of positive and negative variables;

[0111] Specifically, the ratio of the number of positive and negative variables = the number of positive variables / the number of negative variables.

[0112] Select the best search space from the search space based on the positive and negative variables.

[0113] Selecting high-quality search spaces from the search space based on the ratio of the number of positive and negative variables includes:

[0114] Set the threshold of positive and negative variable ratio;

[0115] When the ratio of the number of positive and negative variables is less than the minimum value of the positive and negative variable ratio threshold, the former search space is selected as the high-quality search space;

[0116] When the ratio of the number of positive and negative variables is greater than the maximum value of the positive and negative variable ratio threshold, the latter search space is selected as the high-quality search space;

[0117] Specifically, the positive-negative variable ratio threshold is a threshold for determining which search space the best solution is located in. In this embodiment, the minimum value of the positive-negative variable ratio threshold is set to 0.5, and the maximum value is set to 0.2.

[0118] If r>2, it means that the available frequencies are significantly more than the unavailable frequencies, and the high-quality allocation scheme may be concentrated in the latter part of the search space (denoted as +∞);

[0119] If 0.5≤r≤2r<0.5, it indicates that the available and unavailable frequencies are close to balance, and the high-quality allocation scheme is more likely to be distributed in the middle area of ​​the search space (denoted as middle).

[0120] In other cases (r<0.5), unavailable frequencies are relatively dominant, and high-quality allocation schemes are usually concentrated in the first part of the search space (denoted as -∞).

[0121] Dynamically partitioning the search space based on the above inferences and solving in the inferred high-quality solution area first can significantly reduce unnecessary search overhead and improve solution efficiency. This method combines the logical hierarchical analysis of the parse tree algorithm and the step-by-step construction characteristics of the recursive descent algorithm, making the processing of spectrum allocation Boolean expressions more intuitive and efficient.

[0122] S7, performing non-uniform superposition on the allocation schemes according to the high-quality search space to obtain an initial scheme after non-uniform superposition, wherein the amplitude of each allocation scheme in the initial scheme is the same;

[0123] Specifically, in the re-divided search space, the Grover quantum search algorithm is used to solve the Boolean satisfiability model of the spectrum allocation problem. According to the principle of the Grover quantum search algorithm, the entire solution process can be divided into three core modules: initialization module, Grover iteration module and measurement module.

[0124] When solving the spectrum allocation problem with n devices, e interference relationships, and k frequencies, three types of quantum registers need to be designed to support different functions of quantum computing, namely input registers, auxiliary registers, and output registers. The design of each register is precisely configured according to the scale and complexity of the problem. The details are as follows:

[0125] Input register: used to store the frequency allocation information of each device. The number of qubits required is related to the number of devices n and the frequency type k. The frequency of each device requires log2 k qubits to represent, so the total number of qubits required for the entire input register is: n×[log2 k]. After initialization, this register can represent the color allocation status of all devices in the entire system.

[0126] Auxiliary register: used to store intermediate results, help with error correction and implement complex quantum logic operations. The number of qubits required is related to the interference relationship e of the system and the frequency type k. The number of qubits required to assist in recording the interference relationship between each pair of adjacent devices is 2×[log2 k]+1. Therefore, the total number of qubits in the entire auxiliary register is:

[0127] e(2×[log2 k]+1). This register ensures that the frequency allocation of each pair of adjacent devices meets constraints during calculation, such as avoiding interference.

[0128] Output register: used to store the final calculation result of the Boolean expression. A result of 1 indicates that the current frequency allocation meets the constraint conditions, and a result of 0 indicates that it does not meet the constraint conditions. Since the output only requires a binary state, the output register only requires one qubit.

[0129] According to the above rules, after determining the total number of quantum bits required to solve a spectrum allocation problem with n devices, e interference relationships, and k frequencies, the next step is to initialize the quantum register. Assume that there is at least one allocation scheme that satisfies the conditions among all possible allocation schemes {|0>,|1>,…,|ω>,…,|N-1>} for the spectrum allocation problem, denoted as |ω>. In the initialization phase, the traditional Grover algorithm applies a Hadamard gate (H gate) to all quantum bits in the input register to generate an equal-amplitude superposition state of all possible allocation schemes in the search space:

[0130]

[0131] like Figure 4 As shown in , this operation assigns the same initial amplitude to all potential allocation solutions to ensure that the search process is comprehensive. However, in order to find the result faster, a high-quality search space has been found. Therefore, during initialization, a larger amplitude is applied to the potential solutions concentrated in the second half, making their weight significantly higher than other parts, and performing non-uniform initialization.

[0132] The steps of non-uniform initialization are:

[0133] 1. Allocate a larger initial amplitude to the potential allocation schemes in the latter part, usually twice or even higher than the amplitude of the potential allocation schemes in other parts, such as Figure 5 As shown;

[0134] 2. Optionally, the amplitude of the allocations in the rest of the original search space can be set to zero, thereby completely ignoring these solutions, e.g. Figure 6 shown.

[0135] The method of non-uniform superposition of initial states not only effectively narrows the search range, but also improves the efficiency of Grover's algorithm in finding target allocation solutions in high-probability areas, greatly reducing computational overhead and unnecessary searches.

[0136] S8, marking all the non-uniform superposition initial solutions according to the constraint conditions to obtain a target solution set, and performing phase flipping on the target solution set to obtain a flipping solution set;

[0137] All the initial schemes of non-uniform superposition are marked according to the constraints to obtain the target scheme set. The target scheme set is phase-flipped to obtain the flipped scheme set including:

[0138] Get Get the preset allocation plan;

[0139] All initial schemes satisfying a preset allocation scheme in the non-uniform superposition initial schemes are marked to obtain a target scheme set, and the target scheme set is phase-flipped to obtain a flipped scheme set.

[0140] Specifically, after the initial state is initialized by non-uniform superposition, we construct a mapping operation, the purpose of which is to flip the phase of the target allocation scheme without affecting the phases of other non-target allocation schemes. Assuming that the target allocation scheme is |β>, we apply a phase flip to it through a mapping operation, that is, |β>→-|β>, while for other non-target allocation schemes |α>, the phase remains unchanged, that is, |α>→-|α>. In this way, the phase of the target allocation scheme is flipped, while the phases of other allocation schemes are not affected, ensuring the distinguishability of the target allocation scheme from other allocation schemes. Among all the initial schemes, not all schemes can meet the requirements. The preset allocation scheme is the type of scheme that meets the spectrum allocation requirements.

[0141] In this process, the phase flip of the target allocation scheme will cause the sign of its amplitude to change, which in turn affects the final quantum measurement result. Figure 7 The effect of this manipulation is demonstrated, where the sign of the amplitude of the target allocation |β> is reversed, showing a significant change in the amplitude of the target allocation compared to the initial state.

[0142] It can be seen from the XOR gate truth table that the spectrum allocations of adjacent devices that meet the constraint conditions are different.

[0143] Take the three-device linear two-frequency problem as an example. In this problem, we define the target allocation scheme as |101> and limit the search space to three possible allocation schemes |101>, |100>, |011>. Through the non-uniform superposition operation, we get the initial state as:

[0144]

[0145] Among them, |101> is the target allocation plan.

[0146] At this time, the initial state is a uniform state formed by the superposition of the target allocation scheme and other allocation schemes. Next, we apply a phase flip operation to this initial state, so that the amplitude of the target allocation scheme |101> is reversed. At this time, the amplitude of the target allocation scheme changes from positive to negative, while the amplitudes of other allocation schemes remain unchanged.

[0147] It should be noted that although the amplitude of the target allocation scheme is flipped, if we measure the input qubits at this stage, the probabilities of all allocation schemes are still equal. This is because the probability of a quantum state is determined by the square of the modulus of the amplitude, rather than the sign of the amplitude. Therefore, the probability of the target allocation scheme is still equal to that of other allocation schemes. Although the sign of the amplitude of the target allocation scheme changes, resulting in a phase flip, the squared value of the amplitude remains unchanged and is still the same as the probabilities of other allocation schemes. After this operation, the average amplitude of all allocation schemes will decrease, Figure 8 The dotted line in

[0148] S9. Construct the average inversion operator;

[0149] S10. Continuously perform iterative adjustment on the set of flipping schemes through the average inversion operator to increase the amplitude of the target scheme and obtain a set of schemes with increased amplitude;

[0150] Continuously performing iterative adjustment on the set of flipping schemes through the average inversion operator to increase the amplitude of the target scheme and obtain a set of schemes with increased amplitude includes:

[0151] The average inversion operator is expressed as:

[0152] U s = 2|s><s| - I;

[0153] where |s> is the uniform superposition state of all potential solutions, and I is the identity operator, and <s| is the conjugate transpose of |s>;

[0154] Continuously perform iterative adjustment on the set of flipping schemes through the average inversion operator to decrease the amplitude of non-target schemes and increase the amplitude of the target scheme, where the target scheme is a scheme that satisfies the constraint conditions of spectrum allocation.

[0155] Specifically, after applying the U ω operation to the initial state |ψ0> (i.e., marking the target allocation scheme), what quantum search needs to do next is to construct the average inversion operator. By applying the U s operator, each solution in the quantum state will undergo a phase inversion with respect to the uniform superposition state. In particular, the target state will have a significant phase difference from other non-target states after the phase inversion. This process will gradually increase the probability amplitude of the target state after multiple iterations, eventually resulting in the probability of the measurement result of the target state approaching 1 more and more.

[0156] Taking the example of the three-device linear two-frequency problem, we first initialized all allocation schemes, and then applied the Oracle operator and the average inversion operator. After one iteration, the amplitude of the target allocation scheme |101> began to increase, while the amplitudes of other non-target allocation schemes such as |100> and |011> gradually decreased. The reason for this phenomenon is that after the inversion operator operation, the amplitude changes of the non-target allocation schemes are closer to the average value C of the uniform distribution than the target allocation scheme. x , so their amplitude will decrease during the adjustment process. The target allocation scheme |101> is consistent with the average value C x The deviation is larger, so its amplitude will be enhanced.

[0157] As this process continues to iterate, the amplitude of the target allocation scheme will become larger and larger, and eventually its probability amplitude will be significantly higher than all other non-target allocation schemes, and almost all measurement results will point to the target allocation scheme 101>. The characteristics of this quantum search algorithm enable us to quickly find the target solution among many potential solutions, and its search efficiency far exceeds the classical brute force search method. This process can be intuitively expressed in a graphical way, Fig. 9 It shows the changing trend that the amplitude of the target allocation scheme gradually increases after multiple iterations.

[0158] S11. Measure the amplitude increase scheme set to obtain an allocation result.

[0159] The amplitude increase scheme set is measured, and the allocation results include:

[0160] The amplitude increase scheme set is measured to obtain the allocation scheme corresponding to the maximum amplitude value;

[0161] The allocation scheme corresponding to the maximum amplitude value is taken as the allocation result.

[0162] Specifically, after G iterations, the quantum state will be in a state close to the target state. At this time, the probability amplitude of the target allocation scheme is significantly amplified. Although the state of the entire quantum system is still a superposition state of all allocation schemes, the probability of the target allocation scheme is already the largest. This process is the key to quantum search - by repeatedly applying the inversion operator in the Grover algorithm, the amplitude of the target allocation scheme gradually increases, while the amplitudes of other non-target allocation schemes are relatively reduced. This makes the target allocation scheme the most likely result to be measured in the final stage of measurement.

[0163] In the last step of quantum search, it is very important to measure the quantum superposition state. The measurement will cause the quantum state to collapse from the superposition state to a specific classical state, that is, an item in the database. In the traditional Grover algorithm, all solutions are equally likely in the search space, while the method adopted by the present invention performs non-uniform superposition in the initialization stage, which significantly reduces the search space of the original SAT problem. In this way, the target solution has a greater probability in the final result, thereby increasing the possibility of finding the correct solution.

[0164] Specifically taking the example of the three-device linear two-frequency problem, after the initialization operation and one Grover iteration, we measure the quantum bits on the input register. At this time, the amplitude probability of the target allocation scheme |101> is the highest, which corresponds to an effective allocation scheme in the spectrum allocation problem. Compared with the results of the traditional Grover algorithm on the same spectrum allocation problem, the method of the present invention can find an effective allocation scheme with a higher probability after one iteration. The experimental results show that the probability of the target allocation scheme is more than twice that of the traditional method, and the comparison of the results of the two methods is as follows. Fig.10 shown.

[0165] This result means that the algorithm of the present invention can significantly reduce the time complexity when solving the spectrum allocation problem. Assume that the traditional Grover algorithm needs The time complexity of the method of the present invention is only This shows the huge advantage of quantum algorithms in solving certain types of problems. In particular, when there is only one target allocation solution, the probability of finding the target allocation solution increases significantly after one Grover iteration because the search space becomes smaller and the target allocation solution occupies a larger proportion.

[0166] This process not only shows how quantum search algorithms can accelerate the discovery of target solutions through clever amplitude amplification and phase inversion mechanisms, but also reveals the close relationship between the size of the search space and the probability of finding a good solution. When there is only one target solution, the probability of the target solution will be higher, which enables quantum search to more efficiently find the best solution from a large number of potential solutions.

[0167] The spectrum allocation problem is a typical combinatorial optimization problem, which usually has an extremely large solution space, which makes the solution of the problem very complex and computationally intensive. In such problems, traditional search algorithms often face high computational costs, so effective strategies are needed to reduce the search space and thus speed up the solution of the problem. In order to address this challenge, the present invention combines the classical parse tree algorithm with the traditional Grover quantum search algorithm to determine the approximate position of the target spectrum allocation scheme in the search space in advance. This strategy effectively reduces or subdivides the search space of the original spectrum allocation problem, thereby reducing the amount of computation and significantly improving the solution efficiency.

[0168] Through this hybrid quantum-classical algorithm, the present invention can efficiently and accurately find a feasible solution to the spectrum allocation problem. Experimental results show that compared with the traditional classical algorithm and quantum Grover algorithm, the method of the present invention can significantly reduce the time complexity of the solution process. Specifically, the traditional classical algorithm requires O(N) time complexity to solve similar spectrum allocation problems, while the Grover algorithm requires O(N) time complexity to solve similar spectrum allocation problems. The time complexity of the hybrid algorithm of the present invention is reduced to Where N represents the size of the search space, and L is the degree of subdivision of the search space. In this way, the efficiency of the algorithm is greatly improved, especially when dealing with large-scale spectrum allocation problems. Fig.10 This is a comparison chart of the results when comparing this application with the traditional method.

[0169] A first acquisition module is used to acquire the number of devices and the number of frequencies to be allocated spectrum;

[0170] A second acquisition module is used to acquire a connection relationship between adjacent devices and set a constraint condition between adjacent devices, wherein the adjacent devices are devices that have frequency interference with each other, and the constraint condition is that the frequencies allocated to the adjacent devices are different;

[0171] A first establishing module, used for establishing a Boolean expression according to the number of devices to be allocated and the constraint condition;

[0172] The second building module is used to expand the Boolean expression and construct a parse tree, the parse tree includes a root node and a plurality of child nodes, the child nodes include leaf nodes and non-leaf nodes, the leaf nodes are nodes without child nodes, the root nodes and non-leaf nodes store logical relationships, including logical AND, logical OR and logical NOT, the leaf nodes store device variables, the device variables modified by logical NOT are negative variables, and the device variables not modified by logical NOT are positive variables;

[0173] A calculation module, configured to calculate a total number of allocation scheme combinations for spectrum allocation to each device according to the number of devices, and use the total number of allocation scheme combinations as a search space, wherein the search space includes a front search space, a middle search space, and a rear search space;

[0174] A traversal module, used for traversing each node of the parse tree to obtain a ratio of the number of positive and negative variables, and selecting a high-quality search space from the search space according to the ratio of the number of positive and negative variables;

[0175] An initialization module, used for performing non-uniform superposition on the allocation scheme according to the high-quality search space to obtain an initial scheme after non-uniform superposition, wherein the amplitude of each allocation scheme in the initial scheme is the same;

[0176] A marking module, used for marking all the non-uniform superposition initial schemes according to the constraint conditions to obtain a target scheme set, and performing phase flipping on the target scheme set to obtain a flipped scheme set;

[0177] An amplitude amplification module, used for iteratively adjusting the flipping scheme set continuously through an average inversion operator to increase the amplitude of the target scheme and obtain an amplitude amplification scheme set;

[0178] The measuring module is used to measure the amplitude increase scheme set to obtain an allocation result.

[0179] An embodiment of the present application also discloses a terminal device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor loads and executes the computer program, a spectrum allocation method based on a hybrid quantum and classical algorithm is adopted.

[0180] The terminal device may be a computer device such as a desktop computer, a laptop computer or a cloud server, and the terminal device includes but is not limited to a processor and a memory. For example, the terminal device may also include input and output devices, a network access device and a bus.

[0181] Among them, the processor can adopt a central processing unit (CPU). Of course, according to actual usage, other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. can also be adopted. The general-purpose processor can adopt a microprocessor or any conventional processor, etc., and this application does not impose any restrictions on this.

[0182] Among them, the memory can be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device, or it can be an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital card (SD) or a flash memory card (FC) equipped on the terminal device, etc., and the memory can also be a combination of an internal storage unit and an external storage device of the terminal device. The memory is used to store computer programs and other programs and data required by the terminal device. The memory can also be used to temporarily store data that has been output or is to be output, and this application does not impose any restrictions on this.

[0183] Among them, through this terminal device, a spectrum allocation method based on a hybrid quantum and classical algorithm in the above embodiment is stored in the memory of the terminal device, and is loaded and executed on the processor of the terminal device for easy use.

[0184] An embodiment of the present application further discloses a computer-readable storage medium, and the computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, a spectrum allocation method based on a hybrid quantum and classical algorithm in the above embodiment is adopted.

[0185] Among them, the computer program can be stored in a computer-readable medium, the computer program includes computer program code, the computer program code can be in the form of source code, object code, executable file or certain middleware, etc. The computer-readable medium includes any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the computer-readable medium includes but is not limited to the above-mentioned components.

[0186] Among them, through this computer-readable storage medium, a spectrum allocation method based on a hybrid quantum and classical algorithm in the above embodiment is stored in a computer-readable storage medium, and is loaded and executed on a processor to facilitate the storage and application of the above method.

[0187] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of protection of the present application is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0188] One or more embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the present application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present application should be included in the protection scope of the present application.

Claims

1. A spectrum allocation method based on hybrid quantum and classical algorithms, characterized in that: include: Obtain the number of devices and frequencies to be allocated spectrum; Acquiring a connection relationship between adjacent devices and setting a constraint condition between adjacent devices, wherein the adjacent devices are devices that have frequency interference with each other, and the constraint condition is that the frequencies allocated to the adjacent devices are different; Establishing a Boolean expression according to the number of devices to be allocated and the constraint conditions; According to the expansion of the Boolean expression, a parse tree is constructed, the parse tree includes a root node and a plurality of child nodes, the child nodes include leaf nodes and non-leaf nodes, the leaf node is a node without child nodes, the root node and the non-leaf node store logical relationships, including logical AND, logical OR and logical NOT, the leaf node stores device variables, the device variables modified by logical NOT are negative variables, and the device variables not modified by logical NOT are positive variables; According to the number of devices, a total number of allocation scheme combinations for spectrum allocation to each device is calculated, and the total number of allocation scheme combinations is used as a search space, where the search space includes a front search space, a middle search space, and a rear search space; Traversing each node of the parse tree to obtain a ratio of the number of positive and negative variables, and selecting a high-quality search space from the search space according to the ratio of the number of positive and negative variables; Performing non-uniform superposition on the allocation schemes according to the high-quality search space to obtain an initial scheme after non-uniform superposition, wherein the amplitude of each allocation scheme in the initial scheme is the same; Marking all the non-uniform superposition initial schemes according to the constraint conditions to obtain a target scheme set, and performing phase flipping on the target scheme set to obtain a flipped scheme set; The flipping scheme set is continuously iteratively adjusted through an average inversion operator to increase the amplitude of the target scheme, thereby obtaining an amplitude increase scheme set; The amplitude increase scheme set is measured to obtain an allocation result.

2. The spectrum allocation method based on hybrid quantum and classical algorithms as claimed in claim 1, characterized in that: According to the Boolean expression expansion, constructing a parse tree includes: The Boolean expression is: (A⊕B)∧(B⊕C)…… Expand the Boolean expression to get the expanded form of the Boolean expression: Among them, A, B and C are different devices, ⊕ indicates different frequencies, ∧ indicates logical AND operation, and ∨ indicates logical OR operation. Represents logical NOT operation; According to the expansion of the Boolean expression, sub-nodes including different logical operations and connection relationships of the sub-nodes are obtained; A parse tree is constructed according to the connection relationship of the sub-nodes and the logical operations of the sub-nodes.

3. The spectrum allocation method based on hybrid quantum and classical algorithms as claimed in claim 1, characterized in that: Traversing each node of the parse tree to obtain a ratio of the number of positive and negative variables, and selecting a high-quality search space from the search space according to the positive and negative variables comprises: Get the number of device variables modified by non-nodes, the number of device variables modified by and nodes, and the number of device variables modified by or nodes in the parse tree; Calculate the sum of the number of device variables modified by the AND node and the number of device variables modified by the OR node as the number of positive variables; The number of the device variables modified by the non-node is taken as the number of negative variables; Calculating the ratio of the number of positive variables to the number of negative variables as the ratio of the number of positive and negative variables; A high-quality search space is selected from the search space according to the positive and negative variables.

4. The spectrum allocation method based on hybrid quantum and classical algorithms as claimed in claim 3, characterized in that: The selecting a high-quality search space from the search space according to the ratio of the number of positive and negative variables comprises: Set the threshold of positive and negative variable ratio; When the ratio of the number of positive and negative variables is less than the minimum value of the positive and negative variable ratio threshold, select the previous search space as the high-quality search space; When the ratio of the number of positive and negative variables is greater than the maximum value of the positive and negative variable ratio threshold, select the subsequent search space as the high-quality search space; When the ratio of the number of positive and negative variables is within the positive and negative variable threshold, select the middle search space as the high-quality search space.

5. The spectrum allocation method based on hybrid quantum and classical algorithms as claimed in claim 1, characterized in that: The marking of all the non-uniform superposition initial schemes according to the constraint conditions to obtain a target scheme set, and performing phase flipping on the target scheme set to obtain a flipped scheme set includes: Obtain a preset allocation scheme; Mark the initial schemes in the non-uniform superposition initial schemes that all satisfy the preset allocation scheme to obtain a target scheme set, and perform phase flipping on the target scheme set to obtain a flipped scheme set.

6. The spectrum allocation method based on hybrid quantum and classical algorithms as claimed in claim 1, characterized in that: The continuously iterative adjustment of the flipped scheme set through the average inversion operator to increase the amplitude of the target scheme to obtain an amplitude-increased scheme set includes: The average inversion operator is expressed as: IN s =2|s> <s|-Ι; where |s> is the uniform superposition state of all potential solutions, I is the identity operator, and <s| is the conjugate transpose of |s>; Continuously perform iterative adjustment on the flipped scheme set through the average inversion operator to reduce the amplitude of non-target schemes and increase the amplitude of target schemes, and the target scheme is a scheme that satisfies the constraint conditions of spectrum allocation.

7. The spectrum allocation method based on hybrid quantum and classical algorithms as claimed in claim 1, characterized in that: The measurement of the amplitude-increased scheme set to obtain an allocation result includes: Measure the amplitude-increased scheme set to obtain the allocation scheme corresponding to the maximum amplitude value; Take the allocation scheme corresponding to the maximum amplitude value as the allocation result.

8. A spectrum allocation system based on hybrid quantum and classical algorithms, characterized in that: Includes: A first acquisition module for acquiring the number of devices and the number of frequencies to be allocated for the spectrum; A second acquisition module for acquiring the connection relationship between adjacent devices and setting the constraint conditions between adjacent devices, where the adjacent devices are devices with frequency interference between each other, and the constraint condition is that the allocated frequencies of adjacent devices are different; A first establishment module for establishing a Boolean expression according to the number of devices to be allocated and the constraint conditions; A second establishment module for expanding according to the Boolean expression to construct an analysis tree, the analysis tree includes a root node and several sub-nodes, the sub-nodes include leaf nodes and non-leaf nodes, the leaf nodes are nodes without sub-nodes, the root node and non-leaf nodes store logical relationships, including logical AND, logical OR, and logical NOT, and the leaf nodes store device variables, and the device variables modified by logical NOT are negative variables, and the device variables not modified by logical NOT are positive variables; A calculation module for calculating the total number of allocation scheme combinations for the spectrum allocation of each device according to the number of devices, and taking the total number of allocation scheme combinations as the search space, and the search space includes a previous search space, a middle search space, and a subsequent search space; A traversal module for traversing each node of the analysis tree to obtain the ratio of the number of positive and negative variables, and selecting a high-quality search space from the search space according to the ratio of the number of positive and negative variables; An initialization module, used for performing non-uniform superposition on the allocation scheme according to the high-quality search space to obtain an initial scheme after non-uniform superposition, wherein the amplitude of each allocation scheme in the initial scheme is the same; A marking module, used for marking all the non-uniform superposition initial schemes according to the constraint conditions to obtain a target scheme set, and performing phase flipping on the target scheme set to obtain a flipped scheme set; An amplitude amplification module, used for iteratively adjusting the flipping scheme set continuously through an average inversion operator to increase the amplitude of the target scheme and obtain an amplitude amplification scheme set; The measuring module is used to measure the amplitude increase scheme set to obtain an allocation result.

9. A terminal device, comprising a memory and a processor, characterized in that: The memory stores a computer program that can be run on the processor, and when the processor loads and executes the computer program, the method according to any one of claims 1 to 7 is adopted.

10. A computer-readable storage medium having a computer program stored therein, characterized in that: When the computer program is loaded and executed by a processor, the method according to any one of claims 1 to 7 is adopted.

Citation Information

Patent Citations

  • Integer decomposition optimization method and system based on Grover quantum computing search algorithm

    CN112182494A

  • Self-organizing quantum network protocol and route scheduling algorithm

    CN113163433A

  • Quantum recommendation system

    US20200372388A1

Cited By

  • Quantum error correction syndrome data stream processing method and device, terminal and medium

    CN122154968A

  • Method and apparatus for processing quantum error correction syndrome data stream, terminal and medium

    CN122154968B