A system state judgment method and device based on quantum Bayesian network
Through the system state judgment method based on quantum Bayesian network, the superposition characteristics of quantum states are used to solve the problem of high computational complexity of Bayesian network in complex risk systems, and achieve efficient calculation and accurate risk monitoring.
Patent Information
- Application Number
- CN202110538136.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-18
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-05-18
AI Technical Summary
In the existing technology, Bayesian networks cannot effectively reduce the computational complexity of probability solution in complex risk systems, resulting in a reduction in risk monitoring efficiency, especially when the number of nodes increases.
The system state judgment method based on quantum Bayesian network is adopted to reduce the computational complexity by constructing quantum circuits and utilizing the superposition characteristics of quantum states, and achieve efficient calculation with less storage and computing resources.
It reduces the computational complexity of Bayesian networks, improves the efficiency and accuracy of risk monitoring, and can handle large-scale multi-node system models.
Smart Images

Figure CN115374945B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of quantum computing technology, and in particular to a method and device for judging a system state based on a quantum Bayesian network. Background Art
[0002] Quantum computers are physical devices that follow the laws of quantum mechanics to perform high-speed mathematical and logical operations, store and process quantum information. When a device processes and calculates quantum information and runs quantum algorithms, it is a quantum computer. Quantum computers have become a key technology under research because they have the ability to process mathematical problems more efficiently than ordinary computers. For example, they can speed up the time to crack RSA keys from hundreds of years to a few hours.
[0003] Risk monitoring (abbreviated as risk control) refers to the various measures and methods taken by risk managers to eliminate or reduce the possibility of risk events, or the risk controllers to reduce the losses caused by risk events. Risk control is generally applied in the financial industry, such as risk control of company transactions, merchant transactions or personal transactions.
[0004] In the prior art, Bayesian networks are often used to judge the system state and monitor risks. It assumes that there are multiple key factor nodes in a complex random system, most of which have no direct causal relationship, and the causal relationship between directly related nodes is unidirectional, and there is no node that can go back to itself along the unidirectional causal relationship. It can more intuitively show a complex risk system with discrete key factors, sparse, unidirectional causal relationship and no loops, and can complete the calculation of the joint probability of all nodes and the edge probability of a single node. However, the existing technology cannot reduce the computational complexity of probability solution in the system, and as the number of nodes in the complex risk system increases, the efficiency of risk monitoring using the system state judgment method is greatly reduced.
[0005] Based on this, it is necessary to implement a system state judgment method based on quantum Bayesian network, so as to implement risk monitoring to solve the shortcomings of the existing technology. Summary of the invention
[0006] The purpose of the present invention is to provide a system state judgment method based on quantum Bayesian network to solve the deficiencies in the prior art. It can reduce the computational complexity of the Bayesian network, achieve efficient computing, and utilize the superposition characteristics of quantum states to support the processing of large-scale multi-node system models with less storage and computing resources, and provide rich functions.
[0007] An embodiment of the present application provides a system state judgment method based on a quantum Bayesian network, the method comprising:
[0008] Obtaining a Bayesian network corresponding to the target system, wherein the Bayesian network includes: a probability distribution of the root node state of the target system and a conditional probability distribution corresponding to the causal relationship between nodes;
[0009] According to the probability distribution of the root node state and the conditional probability distribution between nodes, a quantum circuit corresponding to the Bayesian network is constructed as a quantum Bayesian network;
[0010] For a target node in the target system, measuring a quantum bit corresponding to the target node in the quantum circuit;
[0011] The state of the target node is determined according to the measurement result of the quantum bit.
[0012] The system state judgment method based on the quantum Bayesian network as described above, wherein preferably, the quantum circuit corresponding to the Bayesian network is constructed according to the probability distribution of the root node state and the conditional probability distribution between nodes, including:
[0013] For the root node, construct a first sub-quantum circuit for preparing a superposition state of a quantum bit, wherein one node corresponds to one or a group of quantum bits, and the superposition state includes: each state of the root node and its probability distribution;
[0014] For every two nodes having a causal relationship among all the nodes, respectively construct a second sub-quantum circuit corresponding to the causal relationship and used to encode the conditional probability distribution;
[0015] According to the first sub-quantum circuit and the second sub-quantum circuit, a quantum circuit corresponding to the Bayesian network is obtained.
[0016] In the above-mentioned method for determining the system state based on the quantum Bayesian network, preferably, the first sub-quantum circuit for preparing the superposition state of the quantum bit for the root node is constructed, including:
[0017] Determine, according to the number of states of the root node, the number of quantum bits required to encode the state of the root node as a first number, and the number of preset quantum logic gates as a second number;
[0018] Determining parameters of the preset quantum logic gate according to the probability distribution of the root node;
[0019] A first sub-quantum circuit for encoding the state of the root node and its probability distribution is constructed according to the first number of quantum bits, the second number of preset quantum logic gates, and parameters of the preset quantum logic gates.
[0020] In the above-mentioned method for determining the state of a system based on a quantum Bayesian network, preferably, for every two nodes having a causal relationship among all the nodes, a second sub-quantum circuit corresponding to the causal relationship and used to encode the conditional probability distribution is constructed, including:
[0021] Determine a cause node and a result node of the two nodes having a causal relationship;
[0022] respectively constructing quantum logic gate combinations that are applied to the result nodes when the cause nodes take different states;
[0023] According to the conditional probability distribution between each combination of the quantum logic gates, the cause nodes and the result nodes, a second sub-quantum circuit corresponding to the causal relationship is constructed.
[0024] In the above-mentioned method for determining the system state based on the quantum Bayesian network, preferably, determining the state of the target node according to the measurement result of the quantum bit includes:
[0025] Determining the probability distribution of the target node state according to the measurement result of the quantum bit;
[0026] The state of the target node is determined according to the probability distribution of the state of the target node.
[0027] The system state judgment method based on quantum Bayesian network as described above, wherein, preferably, the method further comprises:
[0028] According to the determination result of the state of the target node, the target node is processed by a corresponding processing method.
[0029] In the above-mentioned system state judgment method based on quantum Bayesian network, preferably, the target node is a global node, and the target node is processed by a corresponding processing method according to the judgment result of the state of the target node, including:
[0030] According to the judgment result of the state of the global node, the importance of each node is estimated.
[0031] Another embodiment of the present application provides a system state judgment device based on a quantum Bayesian network, the device comprising:
[0032] An acquisition module is used to obtain a Bayesian network corresponding to the target system, wherein the Bayesian network includes: a probability distribution of the root node state of the target system and a conditional probability distribution corresponding to the causal relationship between nodes;
[0033] A construction module, used to construct a quantum circuit corresponding to the Bayesian network as a quantum Bayesian network according to the probability distribution of the root node state and the conditional probability distribution between nodes;
[0034] A measurement module, configured to measure, for a target node in the target system, a quantum bit corresponding to the target node in the quantum circuit;
[0035] A judgment module is used to judge the state of the target node according to the measurement result of the quantum bit.
[0036] As described above, in the system state judgment device based on quantum Bayesian network, preferably, the building module includes:
[0037] A first construction unit is used to construct a first sub-quantum circuit for preparing a superposition state of a quantum bit for the root node, wherein one node corresponds to one or a group of quantum bits, and the superposition state includes: each state of the root node and its probability distribution;
[0038] A second construction unit is used to construct, for each two nodes having a causal relationship among all the nodes, a second sub-quantum circuit corresponding to the causal relationship and used to encode the conditional probability distribution;
[0039] An obtaining unit is used to obtain a quantum circuit corresponding to the Bayesian network according to the first sub-quantum circuit and the second sub-quantum circuit.
[0040] As described above, in the system state judgment device based on quantum Bayesian network, preferably, the first construction unit includes:
[0041] A first determining unit is used to determine, according to the number of states of the root node, the number of quantum bits required to encode the state of the root node as a first number, and the number of preset quantum logic gates as a second number;
[0042] A second determining unit, configured to determine the parameters of the preset quantum logic gate according to the probability distribution of the root node;
[0043] A third construction unit is used to construct a first sub-quantum circuit for encoding the state of the root node and its probability distribution according to the first number of quantum bits, the second number of preset quantum logic gates, and parameters of the preset quantum logic gates.
[0044] As described above, in the system state judgment device based on quantum Bayesian network, preferably, the second construction unit includes:
[0045] A third determining unit, used to determine a cause node and a result node of the two nodes having a causal relationship;
[0046] A construction unit, used to respectively construct a combination of quantum logic gates applied to the result node when the cause node takes different states;
[0047] The fourth construction unit is used to construct a second sub-quantum circuit corresponding to the causal relationship according to the conditional probability distribution between each combination of the quantum logic gates and the cause nodes and the result nodes.
[0048] As described above, in the system state judgment device based on quantum Bayesian network, preferably, the judgment module includes:
[0049] A fourth determining unit, configured to determine a probability distribution of the target node state according to the measurement result of the quantum bit;
[0050] A judging unit is used to judge the state of the target node according to the probability distribution of the state of the target node.
[0051] As described above, the system state judgment device based on quantum Bayesian network, wherein, preferably, the device further comprises:
[0052] The processing module is used to process the target node in a corresponding processing manner according to the judgment result of the state of the target node.
[0053] As described above, in the system state judgment device based on quantum Bayesian network, preferably, the processing module includes:
[0054] The estimation unit is used to estimate the importance of each node according to the judgment result of the state of the global node.
[0055] Yet another embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program is configured to execute any of the above methods when running.
[0056] Yet another embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any of the methods described above.
[0057] Compared with the prior art, the present invention obtains a Bayesian network corresponding to a target system, and constructs a quantum circuit corresponding to the Bayesian network according to the probability distribution of the root node state and the conditional probability distribution between nodes. As a quantum Bayesian network, the present invention measures the quantum bits corresponding to the target nodes in the quantum circuit for the target nodes in the target system, and judges the state of the target nodes according to the measurement results of the quantum bits. The present invention realizes a system state judgment method based on a quantum Bayesian network, which can reduce the computational complexity of the Bayesian network, realize efficient computing, and utilize the superposition characteristics of quantum states to realize the pertinence and accuracy of state judgment with less storage and computing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a hardware structure block diagram of a computer terminal of a system state judgment method based on a quantum Bayesian network provided by an embodiment of the present invention;
[0059] Figure 2 It is a flowchart of a method for determining a system state based on a quantum Bayesian network provided by an embodiment of the present invention;
[0060] Figure 3 It is a schematic diagram of a security system state based on a Bayesian network provided by an embodiment of the present invention;
[0061] Figure 4 It is a schematic diagram of a first sub-quantum circuit for encoding the state of a root node and its probability distribution provided by an embodiment of the present invention;
[0062] Figure 5 It is a schematic diagram of a quantum circuit for constructing a causal relationship between nodes provided by an embodiment of the present invention;
[0063] Figure 6 It is a schematic diagram of a second sub-quantum circuit corresponding to a causal relationship between nodes provided by an embodiment of the present invention;
[0064] Figure 7 is a schematic diagram of a quantum circuit corresponding to a quantum Bayesian network provided by an embodiment of the present invention;
[0065] Figure 8 It is a structural schematic diagram of a system state judgment device based on a quantum Bayesian network provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0066] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, but should not be construed as limiting the present invention.
[0067] The embodiment of the present invention first provides a system state judgment method based on a quantum Bayesian network. The method can be applied to electronic devices, such as computer terminals, specifically ordinary computers, quantum computers, etc.
[0068] The following describes it in detail by taking running on a computer terminal as an example. Figure 1 The hardware structure block diagram of a computer terminal of a system state judgment method based on a quantum Bayesian network provided by an embodiment of the present invention. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the computer terminal may also include a transmission device 106 for communication functions and an input and output device 108. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0069] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the implementation of a system state judgment method based on a quantum Bayesian network in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to a computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0070] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0071] It should be noted that a true quantum computer is a hybrid structure, which consists of two parts: one part is a classical computer, which is responsible for performing classical calculations and control; the other part is a quantum device, which is responsible for running quantum programs and thus realizing quantum computing. A quantum program is a sequence of instructions written in a quantum language such as QRunes that can be run on a quantum computer, which supports quantum logic gate operations and ultimately realizes quantum computing. Specifically, a quantum program is a sequence of instructions that operate quantum logic gates in a certain sequence.
[0072] In practical applications, due to the limitations of the development of quantum device hardware, quantum computing simulation is usually required to verify quantum algorithms, quantum applications, etc. Quantum computing simulation is the process of using a virtual architecture (i.e., quantum virtual machine) built with the resources of an ordinary computer to simulate the operation of a quantum program corresponding to a specific problem. Usually, it is necessary to build a quantum program corresponding to a specific problem. The quantum program referred to in the embodiment of the present invention is a program written in a classical language to characterize quantum bits and their evolution, in which quantum bits, quantum logic gates, etc. related to quantum computing are represented by corresponding classical codes.
[0073] Quantum circuits, as a manifestation of quantum programs, are also called quantum logic circuits. They are the most commonly used general quantum computing model. They represent circuits that operate on quantum bits in an abstract concept. They are composed of quantum bits, circuits (timelines), and various quantum logic gates. Finally, the results often need to be read out through quantum measurement operations.
[0074] Unlike traditional circuits that are connected by metal wires to transmit voltage or current signals, in quantum circuits, the circuits can be seen as connected by time, that is, the state of the quantum bit evolves naturally over time, following the instructions of the Hamiltonian operator until it encounters a logic gate and is operated.
[0075] A quantum program as a whole corresponds to a total quantum circuit. The quantum program described in the present invention refers to the total quantum circuit, wherein the total number of quantum bits in the total quantum circuit is the same as the total number of quantum bits in the quantum program. It can be understood that a quantum program can be composed of a quantum circuit, measurement operations on quantum bits in the quantum circuit, registers for storing measurement results, and control flow nodes (jump instructions). A quantum circuit can contain dozens, hundreds, or even thousands of quantum logic gate operations. The execution process of a quantum program is the process of executing all quantum logic gates in a certain time sequence. It should be noted that the time sequence is the time order in which a single quantum logic gate is executed.
[0076] It should be noted that in classical computing, the most basic unit is the bit, and the most basic control mode is the logic gate, which can achieve the purpose of controlling the circuit through the combination of logic gates. Similarly, the way to process quantum bits is quantum logic gates. Using quantum logic gates, quantum states can evolve. Quantum logic gates are the basis of quantum circuits. Quantum logic gates include single-bit quantum logic gates, such as Hadamard gates (H gates), Pauli-X gates (X gates), Pauli-Y gates (Y gates), Pauli-Z gates (Z gates), RX gates, RY gates, RZ gates, etc.; multi-bit quantum logic gates, such as CNOT gates, CR gates, iSWAP gates, Toffoli gates, etc. Quantum logic gates are generally represented by unitary matrices, which are not only in matrix form, but also an operation and transformation. The effect of general quantum logic gates on quantum states is calculated by multiplying the unitary matrix on the left by the matrix corresponding to the right vector of the quantum state.
[0077] Quantum state, that is, the logical state of quantum bits, is represented by binary in quantum algorithms (or quantum programs). For example, a group of quantum bits is q0, q1, q2, representing the 0th, 1st, and 2nd quantum bits, and is sorted from high to low as q2q1q0. The quantum state corresponding to this group of quantum bits has a total of 2 to the power of the total number of quantum bits, which refers to 8 eigenstates (determined states): , , , , , , , , each quantum state bit corresponds to the quantum bit, such as state, 000 from high to low corresponds to q2q1q0, |> is the Dirac symbol.
[0078] Using a single qubit to illustrate, the logical state of a single qubit May be in state, state, State and The superposition state (uncertain state) of the state can be specifically expressed as , where a and b are complex numbers representing the quantum state amplitude (probability amplitude), and the square of the amplitude represents the probability, , represents the probability of the |0> state and the |1> state, In short, the quantum state is a superposition state composed of various eigenstates. When the probability of other states is 0, it is in the only definite eigenstate.
[0079] Bayesian network is a probabilistic graph model. It is a graphical network based on probabilistic reasoning. Bayesian network is a mathematical model based on probabilistic reasoning. Probabilistic reasoning is the process of obtaining other probabilistic information through the information of some variables. Bayesian network based on probabilistic reasoning is proposed to solve the problems of uncertainty and incompleteness. It has great advantages in solving the failures caused by uncertainty and correlation of complex equipment and has been widely used in many fields. Bayesian network itself is an uncertain causal association model. Unlike other decision-making models, it is a probabilistic knowledge expression and reasoning model that visualizes multivariate knowledge graphs. It more accurately contains the causal relationship and conditional correlation between network node variables. Bayesian network has a strong ability to handle uncertainty problems. It uses conditional probability to express the correlation between various information elements. It can learn and reason under limited, incomplete and uncertain information conditions. And it can effectively express and fuse multi-source information. Bayesian theory is an important tool for processing uncertain information. As a probability-based uncertainty reasoning method, Bayesian networks have been used in intelligent systems that process uncertain information and have been successfully used in the fields of medical diagnosis, statistical decision-making, expert systems, learning prediction, etc. These successful applications fully demonstrate that Bayesian network technology is a powerful uncertainty reasoning method.
[0080] See also Figure 2 , Figure 2 A schematic flow chart of a method for determining a system state based on a quantum Bayesian network provided in an embodiment of the present invention may include the following steps:
[0081] S201: Obtaining a Bayesian network corresponding to a target system, wherein the Bayesian network includes: a probability distribution of a root node state of the target system, and a conditional probability distribution corresponding to a causal relationship between nodes.
[0082] Specifically, the target system can be a complex random system with multiple nodes, most of which have no direct causal relationship, and the causal relationship between directly related nodes is unidirectional, and there is no node that can advance to itself along the unidirectional causal relationship. Therefore, the target system is a random system that can more intuitively demonstrate a node that is discrete, sparse, and has a unidirectional causal relationship without a loop.
[0083] Preferably, a Bayesian network corresponding to the target system can be obtained, and the probability distribution of the root node state contained in the Bayesian network and the conditional probability distribution corresponding to the causal relationship between nodes can be obtained. For example, all root nodes in each node of the Bayesian network and the causal relationship between each node can be obtained first, wherein the causal relationship between each node can include the pointing relationship between nodes and the conditional probability distribution of each state when the node contains several states.
[0084] For example, Figure 3 FIG. 1 is a schematic diagram of a security system state based on a Bayesian network provided by an embodiment of the present invention. The target network includes four nodes A, B, C, and D, and the specific directional relationship between the nodes is: A→B, A→C, B→D. It is assumed that the root node A contains two states, namely, state 0 and state 1, and the probability of state 0 is , the probability of state 1 is ; The conditional probability distribution corresponding to the causal relationship between node A and node B is , , and assuming , The above example only uses the root node and one of its adjacent nodes to illustrate the states contained in the node and the probability distribution of each state. The states contained in the other C and D nodes and their corresponding probability distributions are not expanded here. However, it should be noted that the sum of the probability distributions corresponding to each node state is 1.
[0085] S202: Constructing a quantum circuit corresponding to the Bayesian network as a quantum Bayesian network according to the probability distribution of the root node state and the conditional probability distribution between nodes.
[0086] Specifically, in one implementation, constructing a quantum Bayesian network may include the following steps:
[0087] S2021: For the root node, construct a first sub-quantum circuit for preparing a superposition state of quantum bits, wherein one node corresponds to one or a group of quantum bits, and the superposition state includes: various states of the root node and their probability distribution.
[0088] Specifically, the first step of constructing the first sub-quantum circuit is to initialize the corresponding quantum bits of all root nodes in the target system, that is, to complete the superposition state preparation of the corresponding quantum bits according to the probability distribution of the root nodes, which specifically includes the following steps:
[0089] Step a: According to the number of states of the root node, determine the number of quantum bits required to encode the state of the root node as a first number, and preset the number of quantum logic gates as a second number.
[0090] Specifically, according to the number of states of the root node , the required first quantity can be determined of quantum bits, where , where the top bracket represents rounding up; according to the state number of the root node , the required second quantity can also be determined The preset quantum logic gates, where .
[0091] Step b: Determine the parameters of the preset quantum logic gate according to the probability distribution of the root node.
[0092] Specifically, according to the probability distribution of the root node, the parameters of the preset quantum logic gate are determined. The preset quantum logic gate used is preferably a rotation logic gate RY gate, and its matrix form is:
[0093]
[0094] Quantum logic gate RY gate implementation:
[0095]
[0096] Among them, determining the parameters of the preset quantum logic gate is to determine the parameters of the RY gate .
[0097] For example, assume that there is a 2-state root node A, denoted as
[0098]
[0099] in , is the probability of occurrence of different states of the root node A.
[0100] That is, the first number of quantum bits required to encode the state of the root node is 1, and the second number presets the number of quantum logic gates to be 1.
[0101] For example, assume there is a 4-state root node , denoted as
[0102]
[0103] in , is the root node The probability of different states occurring.
[0104] That is, the first number of quantum bits required to encode the state of the root node is 2, and the second number of quantum logic gates is preset to be 3.
[0105] Step c: constructing a first sub-quantum circuit for encoding the state of the root node and its probability distribution according to the first number of quantum bits, the second number of preset quantum logic gates, and parameters of the preset quantum logic gates.
[0106] Exemplary, to construct the above 4-state root node Taking the first sub-quantum circuit as an example, the idea of encoding the quantum circuit corresponding to the root node is to split it from top to bottom and implement it with a series of controlled rotating gates (controlled RY gates). The specific implementation process includes:
[0107] First, the probabilities corresponding to the four states of the root node are divided into two groups, one group is , and the other group is The root of the sum of the squares of the two probabilities of each group is encoded as the amplitude value into the amplitude of the quantum state of the first quantum bit to obtain the encoded final state, namely:
[0108]
[0109] At this time, after the first equal division, the RY gate is applied to the first quantum bit, that is:
[0110]
[0111] Available, That is, by setting The value of can realize the above amplitude value encoding. The rotation angle of RY gate in the following figure is The specific value of can be determined similarly.
[0112] Continuing with the second step of data splitting, 4 groups of data will be obtained, realizing the amplitude encoding of 2 quantum bits and a total of 4 quantum states, and obtaining:
[0113]
[0114]
[0115] Using 2 qubits and 3 preset quantum logic gates, the rotation angle of the confirmed RY gate The specific value of is obtained as Figure 4 The schematic diagram of the first sub-quantum circuit of the state of the encoding root node and its probability distribution is shown. In order to vividly show the control status of the quantum logic gate RY gate, the hollow circle in the diagram of this application represents 0 control, indicating that when the quantum state of the quantum bit is 0, The quantum logic gate will be executed; the solid black circle represents 1 control, which means that when the quantum state of the quantum bit is 1, The quantum logic gate will be executed, and the lines between the circles represent the control.
[0116] S2022: For every two nodes having a causal relationship among all the nodes, construct a second sub-quantum circuit corresponding to the causal relationship and used to encode the conditional probability distribution.
[0117] Specifically, for every two nodes with causal relationship in each node, a second sub-quantum circuit corresponding to the causal relationship is constructed respectively, specifically including:
[0118] 1. Determine a cause node and a result node among the two nodes having a causal relationship;
[0119] Specifically, determine the nodes that have a causal relationship between each other among all nodes, that is, there is a unidirectional pointing relationship and conditional probability between two nodes. For example, if node A points to node B, and node B does not point to node A, then nodes A and B are said to have a causal relationship, and A is the cause node and B is the result node.
[0120] 2. Constructing quantum logic gate combinations that are applied to the result nodes when the cause nodes take different states respectively;
[0121] For example, suppose there is a The reason for the state is that node A determines 1 The result node B of the state, then the causal relationship between nodes AB can be decomposed into different amplitude encoding processes for B when A takes different states, and the following is obtained: Figure 5 The schematic diagram of quantum circuit for constructing causal relationship between nodes provided by this embodiment is shown. In the figure, the PreA module represents the initialization quantum circuit related to node A, and the A0B, A1B modules and the subsequent ellipsis represent the quantum logic gate combination of A applied to B in different states.
[0122] It should be noted that Figure 5 Only A0B when A=0 and A1B when A=1 are shown. Each controlled quantum gate combination AiB( ) can be regarded as a small root node initialization amplitude coded quantum circuit, and the number of controlled quantum gate combinations AiB is equal to the number of states of node A.
[0123] 3. Construct a second sub-quantum circuit corresponding to the causal relationship according to the conditional probability distribution between each combination of the quantum logic gates, the cause nodes and the result nodes.
[0124] For example, assume that there is a 4-state cause node A that unidirectionally determines a 4-state result node B. The causal relationship between nodes A and B is decomposed into different amplitude encoding processes for B when A takes different states, and the following is obtained: Figure 6A schematic diagram of the second sub-quantum circuit corresponding to a causal relationship between nodes is shown, wherein the A0B module represents the quantum logic gate combination applied by A to B in the first state, and the remaining A1B, A2B, and A3B represent the quantum logic gate combinations applied by A to B in the remaining different states.
[0125] It should be noted that the quantum logic gate combination of modules A0B is the same as that of A1B, A2B and A3B, except that the rotation angle of each RY gate is different. The specific value and controlled state are different.
[0126] S2023: Obtain a quantum circuit corresponding to the Bayesian network according to the first sub-quantum circuit and the second sub-quantum circuit.
[0127] Specifically, the first sub-quantum circuit and the second sub-quantum circuit are combined in sequence to obtain a quantum circuit corresponding to the quantum Bayesian network.
[0128] Exemplarily, the first sub-quantum circuit representing the four states of the coding root node and their probability distribution is combined with the above second sub-quantum circuit in sequence to obtain the following: Figure 7 Schematic diagram of quantum circuit corresponding to a quantum Bayesian network shown.
[0129] S203: For a target node in the target system, measuring a quantum bit corresponding to the target node in the quantum circuit.
[0130] Specifically, the target node is generally a non-root node or a node combination including the root node. Each node in the target system corresponds to one or a group of quantum bits, and each edge corresponds to a group of quantum logic gates. The result output of the target system depends on the measurement or observation of the quantum bits in the quantum circuit. The probability distribution of the target system nodes can be obtained by measuring or observing the quantum bit combination corresponding to all or some nodes.
[0131] For example, following the above Figure 3 A schematic diagram of the state of a security system based on a Bayesian network is shown, in which the four nodes can be divided into directly observable measurable nodes (A) and hidden nodes (B, C, D) that cannot be directly observed, and the actual system nodes corresponding to the measurable nodes (A) have measurement tools (such as sensors) that can directly observe the state and probability distribution contained in the node; the hidden nodes (B, C, D) can determine the state contained in the nodes and the corresponding probability distribution by measuring the quantum bits corresponding to the B, C, D nodes in the simulated quantum circuit.
[0132] S204: Determine the state of the target node according to the measurement result of the quantum bit.
[0133] Specifically, judging the state of the target node according to the measurement result of the quantum bit may include:
[0134] Step S2041: Determine the probability distribution of the target node state based on the measurement result of the quantum bit.
[0135] Specifically, the probability distribution of the target node can be determined based on the measurement result of the quantum bit. Figure 3 The quantum bit corresponding to node B in the measurement is ,in, and They represent the amplitudes of quantum states 0 and 1 respectively, and the square of the amplitude represents the probability distribution of the state of the target node B.
[0136] Step S2042: Determine the state of the target node according to the probability distribution of the state of the target node.
[0137] Specifically, following the above example, it can be determined that the probability that the target node B is in state 0 is 25%, and the probability that it is in state 1 is 75%. It can be determined that the target node B is in state 1 with a high probability.
[0138] In practical applications, the target node may also be processed in a corresponding manner according to the judgment result of the state of the target node.
[0139] Optionally, the state distribution of the corresponding nodes can be determined by measuring the quantum bits corresponding to specific or all nodes.
[0140] Specifically, by measuring the quantum bits corresponding to a specific node of the target system, we can directly obtain the probability distribution of this specific node, and then judge the state of this specific node; by measuring the quantum bits of all nodes of the target system, we can obtain the state probability distribution of the entire system, and then judge the state of the system.
[0141] Exemplarily, according to different requirements, by measuring a characteristic node, such as node B, or all of nodes A, B, C, and D, the state distribution of the corresponding node is determined.
[0142] Optionally, the state probability distribution of the hidden nodes is given based on the observation results of the measurable nodes to determine the possible states of the hidden nodes.
[0143] Exemplarily, Table 1 is a table of the states of each node of the initial target system and the corresponding probability distribution, as shown in the following table:
[0144] Table 1: Initial target system node states and corresponding probability distribution table
[0145]
[0146] According to the above Table 1 and the observation results of the measurable node A, it can be judged that the possible states of the implicit nodes B, C, and D are 1, 0, and 1 respectively.
[0147] Optionally, the state of a measurable node is determined by the observation results of the node, and a prediction of the possible state of the target system is given globally.
[0148] Specifically, the state of the measurable node is updated as the measurement result, and the entire quantum Bayesian network can be updated. For example, the state 0 and state 1 of the measurable node are updated as the measurement result, and then the target system is updated. By judging the state of the key local nodes or global nodes in the system, the function of continuous monitoring of the system state and prediction can be realized, and real-time system monitoring and early warning can be realized.
[0149] Exemplarily, through the observation results of the measurable node A, for example, the state of the measurable node is determined to be state 0, and the state probability distributions of the implicit nodes B, C, and D are given respectively, as shown in the following Table 2-1, which gives a measurable node determination state and the states of the remaining nodes and the corresponding probability distribution table, and judges the possible state of the implicit node.
[0150] Table 2-1: A measurable node determination state and other node states and corresponding probability distribution table
[0151]
[0152] From the above Table 2-1, it can be judged that the states of the implicit nodes B, C, and D may be states 1, 0, and 1.
[0153] As shown in Table 2-2 below, another measurable node determination state and the remaining node states and corresponding probability distribution table are given, and the possible state of the implicit node is determined.
[0154] Table 2-2: Another measurable node determination state and other node states and corresponding probability distribution table
[0155]
[0156] From the above Table 2-2, it can be judged that the states of the implicit nodes B, C, and D may be 0, 0, and 1.
[0157] Optionally, by measuring the global nodes of the target system, the measurement results are classified according to different nodes to determine the importance of the state change of the node.
[0158] Specifically, the target node may be a global node, and the target node is processed by a corresponding processing method according to the judgment result of the state of the target node, including:
[0159] According to the judgment result of the state of the global node, the importance of each node is estimated.
[0160] Exemplarily, for the target system, the measurement results are divided into two categories according to the state of A: (A=0, BCD=?) and (A=1, BCD=?), so as to evaluate the impact of the state change of A on the global state of the system.
[0161] By comparing Table 1, Table 2-1 and Table 2-2, it can be seen that the state of a measurable node and the states of the remaining nodes and the corresponding probability distribution shown in Table 2-1 indicate that when the state of the measurable node is determined, it has little impact on the global state of the entire target system, so the importance of the measurable node A is not high; the state of another measurable node and the states of the remaining nodes and the corresponding probability distribution shown in Table 2-2 indicate that when the state of the measurable node is determined, it has a greater impact on the global state of the entire target system, and at this time, the importance of the measurable node A is higher. Similarly, the impact of the state change of B on the global state of ACD can be evaluated, and the importance of each node can be estimated or ranked by judging the results. Therefore, for the security system, under the premise of limited defense resources, the protection of nodes with higher importance can be strengthened, thereby improving the security of the entire system.
[0162] Similarly, by evaluating the impact of the state change of A on the states of other single or multiple hidden nodes, these classification results can be statistically analyzed and the importance of each node can be estimated according to specific standards.
[0163] For a target system containing measurable nodes and implicit nodes, the initial static state judgment and subsequent continuous observation of the target system, as well as the continuous updating of the state of the measurable nodes, can be used to judge the state of the target system or a specific node with the help of the quantum Bayesian network. Based on the judgment, corresponding actions or early warnings can be taken. On the other hand, the continuous observation results of the measurable nodes can be statistically analyzed to predict the possible future state change trends of the specific nodes or target systems. The measurable node states within a period of time can also be statistically analyzed to obtain the state change trends of the measurable nodes. The quantum Bayesian network can then be used to complete the prediction of the change trends of the entire system or specific nodes, and the prediction of the state judgment of the target system over a longer period of time can be realized. Based on the estimation of the importance of the nodes, limited defense resources can be configured in a targeted manner to improve the targetedness and accuracy of the state judgment of the entire target system.
[0164] Compared with the prior art, the present invention obtains a Bayesian network corresponding to a target system, and constructs a quantum circuit corresponding to the Bayesian network according to the probability distribution of the root node state and the conditional probability distribution between nodes. As a quantum Bayesian network, the present invention measures the quantum bits corresponding to the target nodes in the quantum circuit for the target nodes in the target system, and judges the state of the target nodes according to the measurement results of the quantum bits. The present invention realizes a system state judgment method based on a quantum Bayesian network, which can reduce the computational complexity of the Bayesian network, realize efficient computing, and utilize the superposition characteristics of quantum states to realize the pertinence and accuracy of state judgment with less storage and computing resources.
[0165] See also Figure 8 , Figure 8 A schematic diagram of a system state judgment device based on a quantum Bayesian network provided by an embodiment of the present invention, and Figure 2 Corresponding to the process shown, the device may include:
[0166] The acquisition module 801 is used to obtain a Bayesian network corresponding to the target system, wherein the Bayesian network includes: a probability distribution of the root node state of the target system and a conditional probability distribution corresponding to the causal relationship between nodes;
[0167] A construction module 802 is used to construct a quantum circuit corresponding to the Bayesian network as a quantum Bayesian network according to the probability distribution of the root node state and the conditional probability distribution between nodes;
[0168] A measurement module 803 is used to measure the quantum bit corresponding to the target node in the target system;
[0169] The judgment module 804 is used to judge the state of the target node according to the measurement result of the quantum bit.
[0170] Preferably, the building blocks include:
[0171] A first construction unit is used to construct a first sub-quantum circuit for preparing a superposition state of a quantum bit for the root node, wherein one node corresponds to one or a group of quantum bits, and the superposition state includes: each state of the root node and its probability distribution;
[0172] A second construction unit is used to construct, for each two nodes having a causal relationship among all the nodes, a second sub-quantum circuit corresponding to the causal relationship and used to encode the conditional probability distribution;
[0173] An obtaining unit is used to obtain a quantum circuit corresponding to the Bayesian network according to the first sub-quantum circuit and the second sub-quantum circuit.
[0174] Preferably, the first construction unit comprises:
[0175] A first determining unit is used to determine, according to the number of states of the root node, the number of quantum bits required to encode the state of the root node as a first number, and the number of preset quantum logic gates as a second number;
[0176] A second determining unit, configured to determine the parameters of the preset quantum logic gate according to the probability distribution of the root node;
[0177] A third construction unit is used to construct a first sub-quantum circuit for encoding the state of the root node and its probability distribution according to the first number of quantum bits, the second number of preset quantum logic gates, and parameters of the preset quantum logic gates.
[0178] Preferably, the second construction unit comprises:
[0179] A third determining unit, used to determine a cause node and a result node of the two nodes having a causal relationship;
[0180] A construction unit, used to respectively construct a combination of quantum logic gates applied to the result node when the cause node takes different states;
[0181] The fourth construction unit is used to construct a second sub-quantum circuit corresponding to the causal relationship according to the conditional probability distribution between each combination of the quantum logic gates and the cause nodes and the result nodes.
[0182] Preferably, the judging module comprises:
[0183] A fourth determining unit, configured to determine a probability distribution of the target node state according to the measurement result of the quantum bit;
[0184] A judging unit is used to judge the state of the target node according to the probability distribution of the state of the target node.
[0185] Preferably, the device further comprises:
[0186] The processing module is used to process the target node in a corresponding processing manner according to the judgment result of the state of the target node.
[0187] Preferably, the processing module comprises:
[0188] The estimation unit is used to estimate the importance of each node according to the judgment result of the state of the global node.
[0189] Compared with the prior art, the present invention obtains a Bayesian network corresponding to a target system, and constructs a quantum circuit corresponding to the Bayesian network according to the probability distribution of the root node state and the conditional probability distribution between nodes. As a quantum Bayesian network, the present invention measures the quantum bits corresponding to the target nodes in the quantum circuit for the target nodes in the target system, and judges the state of the target nodes according to the measurement results of the quantum bits. The present invention realizes a system state judgment method based on a quantum Bayesian network, which can reduce the computational complexity of the Bayesian network, realize efficient computing, and utilize the superposition characteristics of quantum states to realize the pertinence and accuracy of state judgment with less storage and computing resources.
[0190] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
[0191] Specifically, in this embodiment, the above storage medium may be configured to store a computer program for performing the following steps:
[0192] S201: Obtaining a Bayesian network corresponding to a target system, wherein the Bayesian network includes: a probability distribution of a root node state of the target system and a conditional probability distribution corresponding to a causal relationship between nodes;
[0193] S202: constructing a quantum circuit corresponding to the Bayesian network as a quantum Bayesian network according to the probability distribution of the root node state and the conditional probability distribution between nodes;
[0194] S203: For a target node in the target system, measuring a quantum bit corresponding to the target node in the quantum circuit;
[0195] S204: Determine the state of the target node according to the measurement result of the quantum bit.
[0196] Compared with the prior art, the present invention obtains a Bayesian network corresponding to a target system, and constructs a quantum circuit corresponding to the Bayesian network according to the probability distribution of the root node state and the conditional probability distribution between nodes. As a quantum Bayesian network, the present invention measures the quantum bits corresponding to the target nodes in the quantum circuit for the target nodes in the target system, and judges the state of the target nodes according to the measurement results of the quantum bits. The present invention realizes a system state judgment method based on a quantum Bayesian network, which can reduce the computational complexity of the Bayesian network, realize efficient computing, and utilize the superposition characteristics of quantum states to realize the pertinence and accuracy of state judgment with less storage and computing resources.
[0197] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0198] Specifically, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0199] Specifically, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0200] S201: Obtaining a Bayesian network corresponding to a target system, wherein the Bayesian network includes: a probability distribution of a root node state of the target system and a conditional probability distribution corresponding to a causal relationship between nodes;
[0201] S202: constructing a quantum circuit corresponding to the Bayesian network as a quantum Bayesian network according to the probability distribution of the root node state and the conditional probability distribution between nodes;
[0202] S203: For a target node in the target system, measuring a quantum bit corresponding to the target node in the quantum circuit;
[0203] S204: Determine the state of the target node according to the measurement result of the quantum bit.
[0204] Compared with the prior art, the present invention obtains a Bayesian network corresponding to a target system, and constructs a quantum circuit corresponding to the Bayesian network according to the probability distribution of the root node state and the conditional probability distribution between nodes. As a quantum Bayesian network, the present invention measures the quantum bits corresponding to the target nodes in the quantum circuit for the target nodes in the target system, and judges the state of the target nodes according to the measurement results of the quantum bits. The present invention realizes a system state judgment method based on a quantum Bayesian network, which can reduce the computational complexity of the Bayesian network, realize efficient computing, and utilize the superposition characteristics of quantum states to realize the pertinence and accuracy of state judgment with less storage and computing resources.
[0205] The above describes in detail the structure, features and effects of the present invention based on the embodiments shown in the drawings. The above is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the drawings. Any changes made according to the concept of the present invention, or modifications to equivalent embodiments with equivalent changes, which still do not exceed the spirit covered by the description and drawings, should be within the protection scope of the present invention.
Claims
1. A system state judgment method based on quantum Bayesian network, characterized in that: The method comprises: Obtaining a Bayesian network corresponding to the target system, wherein the Bayesian network includes: a probability distribution of the root node state of the target system and a conditional probability distribution corresponding to the causal relationship between nodes; According to the probability distribution of the state of the root node and the conditional probability distribution between nodes, a quantum circuit corresponding to the Bayesian network is constructed as a quantum Bayesian network; wherein the quantum circuit corresponding to the Bayesian network includes a second sub-quantum circuit, and the second quantum circuit is a quantum circuit corresponding to the causal relationship and used to encode the conditional probability distribution, which is constructed for every two nodes with a causal relationship among all nodes; wherein the method for constructing the second sub-quantum circuit includes: determining a cause node and a result node among the two nodes with a causal relationship; respectively constructing a quantum logic gate combination applied to the result node when the cause node takes different states, wherein the quantum logic gate combination is used to encode the node state and probability distribution of a node based on two quantum bits; and constructing a second sub-quantum circuit corresponding to the causal relationship according to each of the quantum logic gate combinations and the conditional probability distribution between the cause node and the result node; For a target node in the target system, measuring a quantum bit corresponding to the target node in the quantum circuit; The state of the target node is determined according to the measurement result of the quantum bit.
2. The method according to claim 1, characterized in that The step of constructing a quantum circuit corresponding to the Bayesian network according to the probability distribution of the root node state and the conditional probability distribution between nodes further includes: For the root node, construct a first sub-quantum circuit for preparing a superposition state of a quantum bit, wherein one node corresponds to one or a group of quantum bits, and the superposition state includes: each state of the root node and its probability distribution; According to the first sub-quantum circuit and the second sub-quantum circuit, a quantum circuit corresponding to the Bayesian network is obtained.
3. The method according to claim 2, characterized in that The step of constructing a first sub-quantum circuit for preparing a superposition state of a quantum bit for the root node includes: Determine, according to the number of states of the root node, the number of quantum bits required to encode the state of the root node as a first number, and the number of preset quantum logic gates as a second number; Determining parameters of the preset quantum logic gate according to the probability distribution of the root node; A first sub-quantum circuit for encoding the state of the root node and its probability distribution is constructed according to the first number of quantum bits, the second number of preset quantum logic gates, and parameters of the preset quantum logic gates.
4. The method according to claim 1, characterized in that: The quantum logic gate combination includes a first parameter-containing RY gate acting on a first quantum bit, and a second parameter-containing RY gate and a third parameter-containing RY gate acting on a second quantum bit in sequence, wherein the second parameter-containing RY gate is controlled by the |O> state of the first quantum bit after the first parameter-containing RY gate acts, and the third parameter-containing RY gate is controlled by the |1> state of the first quantum bit after the first parameter-containing RY gate acts.
5. The method according to claim 1, characterized in that The step of determining the state of the target node according to the measurement result of the quantum bit includes: Determining the probability distribution of the target node state according to the measurement result of the quantum bit; The state of the target node is determined according to the probability distribution of the state of the target node.
6. The method according to claim 1, characterized in that The method further comprises: According to the determination result of the state of the target node, the target node is processed by a corresponding processing method.
7. The method according to claim 6, characterized in that The target node is a global node, and the target node is processed by a corresponding processing method according to the judgment result of the state of the target node, including: According to the judgment result of the state of the global node, the importance of each node is estimated.
8. A system state judgment device based on quantum Bayesian network, characterized in that: The device comprises: An acquisition module is used to obtain a Bayesian network corresponding to the target system, wherein the Bayesian network includes: a probability distribution of the root node state of the target system and a conditional probability distribution corresponding to the causal relationship between nodes; A construction module is used to construct a quantum circuit corresponding to the Bayesian network as a quantum Bayesian network according to the probability distribution of the root node state and the conditional probability distribution between nodes, wherein the quantum circuit corresponding to the Bayesian network includes a second sub-quantum circuit, and the second quantum circuit is a quantum circuit corresponding to the causal relationship and used to encode the conditional probability distribution, which is constructed for every two nodes with a causal relationship among all nodes; wherein the method for constructing the second sub-quantum circuit includes: determining a cause node and a result node among the two nodes with a causal relationship; respectively constructing a quantum logic gate combination applied to the result node when the cause node takes different states, wherein the quantum logic gate combination is used to encode the node state and probability distribution of a node based on two quantum bits; and constructing a second sub-quantum circuit corresponding to the causal relationship according to each of the quantum logic gate combinations and the conditional probability distribution between the cause node and the result node; A measurement module, configured to measure, for a target node in the target system, a quantum bit corresponding to the target node in the quantum circuit; A judgment module is used to judge the state of the target node according to the measurement result of the quantum bit.
9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.
