A quantum circuit enhanced knowledge graph reasoning method
Patent Information
- Application Number
- CN202610855461.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-15
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2046-06-15
AI Technical Summary
[0008]鉴于上述的分析,本发明旨在公开了一种量子线路增强的知识图谱推理方法;解决现有知识图谱推理方法参数量大、计算复杂度高、符号-向量融合不足的技术问题;通过量子嵌入与逻辑规则的深度协同,实现高精度、低复杂度、可解释的知识图谱推理
(1)针对知识图谱推理任务,结合量子嵌入网络与逻辑规则打分函数,构建已知事实与未知事实的联合概率分布模型,并将一阶逻辑规则无缝集成至量子表示空间,通过变分量子线路实现高效求解;
Smart Images

Figure CN122390039B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge graph technology; and more particularly to a quantum circuit-enhanced knowledge graph reasoning method. Background Technology
[0002] Knowledge graph (KG) inference technology has core application value in fields such as artificial intelligence, intelligent recommendation, and semantic search. Link prediction, as a key task, aims to solve the inference problem of missing relationships in knowledge graphs. However, with the increasing complexity of application scenarios, existing technologies face severe challenges in handling high-order relation dependencies, large-scale data expansion, and computational efficiency. The current technological bottleneck is concentrated on how to effectively reduce model parameter complexity and computational overhead while maintaining inference accuracy, in order to meet the rigid requirements of resource efficiency in practical deployments. This challenge has become a key obstacle restricting the practical application of KG inference technology.
[0003] Existing knowledge graph reasoning methods can be mainly divided into the following three categories: The first category is the embedded method. This type of method maps entities and relations to a low-dimensional vector space and evaluates the effectiveness of triples through a scoring function. Its limitations are: it cannot effectively capture high-order relation dependencies, leading to a significant decrease in accuracy in complex semantic scenarios; at the same time, the linear nature of the vector space makes it difficult to express non-linear logical constraints, resulting in weak interpretability of the inference results; in addition, the number of model parameters increases linearly with the size of the knowledge graph, leading to high parameter complexity and making the training process difficult to analyze.
[0004] The second category is rule-driven methods. These methods use first-order logic rules to model relational patterns, which theoretically can support complex reasoning. However, their core drawbacks are: severe combinatorial explosion problem, where the rule combination space grows exponentially with the size of the knowledge graph, resulting in exponential computational complexity and extremely poor scalability; at the same time, the construction of the rule base depends on manual intervention and is difficult to adapt to dynamic knowledge evolution.
[0005] The third category is quantum enhancement methods. Recent research attempts to represent entities using quantum states and model relationships through quantum gate operations. However, this approach does not systematically integrate symbolic knowledge: it only focuses on the quantization of vector spaces and does not incorporate first-order logic rules into the quantum reasoning process, thus failing to leverage the potential advantages of quantum computing in symbol-vector collaboration. At the same time, the collaborative optimization of quantum embedding and logic rules has not been fully explored, resulting in insufficient application generalization ability and difficulty in migrating to general knowledge graph scenarios.
[0006] In summary, the current technical approach has three common defects: (1) low parameter efficiency: the hybrid method requires additional parameters (such as rule weights) and large-scale data, which leads to model expansion; (2) high computational complexity: the combinatorial explosion of rule methods and the high overhead of quantum simulation make the inference time grow superlinearly with the KG scale; (3) insufficient symbol-vector fusion: the existing schemes either focus on vector expression (embedded / quantized) or on symbol logic (rule method), and fail to achieve efficient collaboration between the two under a unified framework.
[0007] Based on the above-mentioned shortcomings, there is an urgent need for a new paradigm that can simultaneously optimize symbolic logic expression, parameter efficiency, and computational scalability in order to achieve efficient reasoning on large-scale knowledge graphs with more than one million entries. Summary of the Invention
[0008] Based on the above analysis, this invention aims to disclose a quantum circuit-enhanced knowledge graph reasoning method; to solve the technical problems of large number of parameters, high computational complexity, and insufficient symbol-vector fusion in existing knowledge graph reasoning methods; and to achieve high-precision, low-complexity, and interpretable knowledge graph reasoning through deep synergy between quantum embedding and logical rules.
[0009] This invention discloses a quantum circuit-enhanced knowledge graph reasoning method, comprising: S1. Map the knowledge graph entities into complex vector space quantum states containing amplitude parameter vectors and phase parameter vectors to generate an entity quantum state library; S2. For the triple to be reasoned, the relation transformation is performed on the parameterized quantum gate constructed from the quantum state of the beginning entity through three rotation angle parameters, and the quantum exchange test is performed with the quantum state of the tail entity. The inner product real part is calculated to generate a semantic association score, which is converted into the probability of the triple being true. S3. Using the probability of the triplet being true as a priori, construct a joint probability distribution by combining first-order logic rules, and solve the posterior distribution of unknown facts through variable quantum circuits. S4. Define a variational objective function based on the joint probability distribution, and jointly optimize the entity amplitude / phase parameters, relation rotation parameters and rule weights through gradient descent until the posterior distribution converges. S5. Predict unknown facts based on convergent posterior distributions and complete the knowledge graph.
[0010] Furthermore, in S1, each entity in the knowledge graph... Mapping to quantum state ; ; in, For amplitude parameter vectors, Let d be the phase parameter vector, and d be the implicit dimension of quantum embedding. This indicates element-wise multiplication.
[0011] Furthermore, S2 includes: S2-1. Define a trainable parameter set containing three rotation angle parameters for each relation in the knowledge graph. Construct a parameterized quantum gate by multiplying the rotation matrices. Decompose the quantum operation in the complex field into matrix operation in the real field. Perform relation transformation on the quantum state of the head entity and output the transformed quantum state of the head entity. S2-2. Perform a quantum exchange test on the transformed head entity quantum state and tail entity quantum state, calculate the real part of the inner product of the two states to generate a semantic association score with global phase invariance, and convert it into the probability of the triplet's validity through an activation function.
[0012] Furthermore, S2-1 includes: 1) Define a trainable parameter set containing three rotation angle parameters independently for each relation. ; ; in , and All are of dimension The real vectors correspond to the three rotation angle parameters in the universal single-qubit rotation gate; 2) Construct a parameterized quantum gate and a rotation matrix by multiplying three rotation matrices; For relationship In dimensions Define the rotation matrix The parameterized form is: ; ; in, , , For dimension The following three rotation angle parameters; Represents the rotation matrix; 3) Decompose complex-field quantum operations into real-field matrix operations and perform relational transformations on the physical quantum states; The transformation relationship is as follows: ; in, , For the input quantum state in dimension The real part and the imaginary part; , For the relationship The real and imaginary components are output after mapping.
[0013] Furthermore, a quantum exchange test is performed on the head entity quantum state and the tail entity quantum state after the relation transformation. The scoring function that generates a semantic association score with global phase invariance by calculating the real part of the inner product of the two states is as follows: ; in, For triples Quantum semantic similarity score; Indicates the head entity. Indicates the tail entity. Indicates a relationship; Represents the quantum state of the head entity after relational transformation; Represents the tail entity quantum state; express and The complex vector inner product, To take the real part.
[0014] Furthermore, the expression for the probability of a triple being true is: ; in, To create a label for the triplet. Represents the head entity embedding vector Tail entity embedding vector splicing operation; For relationship The dedicated weight vector, " is the matrix transpose; For bias terms; This is the sigmoid function.
[0015] Furthermore, in S3, based on mean-field theory, the approximate posterior distribution is decomposed into a product of first-order logic rule instantiations, and a Bernoulli distribution is established for each predicate; including: Approximate posterior distribution Defined as the product of the distributions corresponding to all instantiation rules: ; in, Representation rules The corresponding set of instantiation rules, For rules Instantiation rules For rules The constitutive instantiation predicate; For instantiating predicates The truth value of , This indicates that the facts are true; For each corresponding triple Instantiated predicates The truth model is a Bernoulli distribution: ; in, For instantiating predicates The true prediction probability is generated through quantum semantic similarity calculation, and its mathematical expression is: ; in, For quantum semantic similarity function, For rules The weight vector, , Head entities Tail-end entity quantum embedding vector, For bias terms, It is the sigmoid activation function.
[0016] Furthermore, in S3, the constructed joint probability Defined as: ; in, For known facts, For unknown facts, For rules The assigned learnable weights, Representation rules The corresponding set of instantiation rules, To instantiate the rules, For rules The constitutive instantiation predicate; The normalization constant is It is a set of rules.
[0017] Furthermore, in S3, the optimization objective function under rule constraints is derived; ; Among them, rules , It is a set of first-order logic rules.
[0018] Furthermore, in S4, a gradient-based optimization method is used to update the parameters of the objective function; Among them, the model parameter set The iterative update rule is as follows: ; In the formula, For learning rate, Describe the objective function About parameter set In iteration step gradient at; ; in, The joint gradient of the rule score and entropy penalty with respect to the predicate probability is given. The gradient of the quantum semantic similarity score with respect to the model parameters.
[0019] Compared with traditional methods, the present invention has the following technical advantages: (1) For knowledge graph reasoning tasks, a joint probability distribution model of known facts and unknown facts is constructed by combining quantum embedded networks and logical rule scoring functions, and first-order logical rules are seamlessly integrated into the quantum representation space to achieve efficient solution through variable quantum circuits; (2) Physical quantum state mapping design: a complex vector space embedding vector is constructed by training amplitude parameter vector and phase parameter vector to simulate the superposition system of non-normalized qubit states; (3) Design of quantum operation parameterization model for relation mapping: By defining a trainable parameter set for each relation independently and decomposing complex matrix multiplication into real number field operations, we can ensure that the parameters of each relation are not shared, so as to accurately capture the semantic specificity of the relation. (4) A semantic association scoring method based on quantum measurement calculates the semantic similarity of the head and tail entities through a quantum exchange test protocol, generates a semantic association strength score, and converts it into a probability prediction of the validity of triples.
[0020] (5) Optimize the module design, generate an approximate posterior distribution by calculating the quantum variational objective function and quantum semantic similarity, and realize end-to-end joint optimization of rule reasoning and quantum embedding. Attached Figure Description
[0021] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. Figure 1 This is a flowchart of the quantum circuit-enhanced knowledge graph reasoning method in an embodiment of the present invention. Detailed Implementation
[0022] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and, together with the embodiments of the present invention, serve to illustrate the principles of the present invention.
[0023] One embodiment of the present invention discloses a quantum circuit-enhanced knowledge graph reasoning method, such as... Figure 1 As shown, it includes: S1. Map the knowledge graph entities into complex vector space quantum states containing amplitude parameter vectors and phase parameter vectors to generate an entity quantum state library; S2. For the triple to be reasoned, the relation transformation is performed on the parameterized quantum gate constructed from the quantum state of the head entity through three rotation angle parameters, and the quantum exchange test is performed with the quantum state of the tail entity. The inner product real part is calculated to generate a semantic association score, which is converted into the probability of the triple being true. S3. Using the probability of the triplet being true as a priori, construct a joint probability distribution by combining first-order logic rules, and solve the posterior distribution of unknown facts through variable quantum circuits. S4. Define a variational objective function based on the joint probability distribution, and jointly optimize the entity amplitude / phase parameters, relation rotation parameters and rule weights through gradient descent until the posterior distribution converges. S5. Predict unknown facts based on convergent posterior distributions and complete the knowledge graph.
[0024] Specifically, in S1, based on quantum computing... A quantum bit system in The principle of representing each entity in a knowledge graph using a normalized state vector in a multidimensional complex vector space is applied to this knowledge graph. Mapping to quantum state .
[0025] Define two trainable parameter vectors: Amplitude parameter vector ; Phase parameter vector ; in, is the implicit dimension of quantum embedding, representing the number of analog qubits.
[0026] Map all entities in the knowledge graph to simulated quantum states, and construct a complex vector space embedding representation for each entity that includes trainable amplitude parameter vectors and phase parameter vectors; ; in, This represents element-wise multiplication (Hadamard product). The vector's front... Dimension represents the real part of a complex number, followed by The dimension represents the imaginary part of a complex number. This representation simulates the imaginary part of a complex number. A system consisting of a superposition of non-normalized qubit states, where each component can be interpreted as the amplitude of a single analog qubit.
[0027] Through the above mapping, all entities in the knowledge graph are transformed into quantum state representations, generating an entity quantum state library, which lays the foundation for subsequent quantum relation transformation and reasoning.
[0028] Specifically, in S2, S2-1. Define a trainable parameter set containing three rotation angle parameters for each relation in the knowledge graph. Construct a parameterized quantum gate by multiplying the rotation matrices. Decompose the quantum operation in the complex field into matrix operation in the real field. Perform relation transformation on the quantum state of the head entity and output the transformed quantum state of the head entity. Specifically, it includes: 1) Define a trainable parameter set containing three rotation angle parameters independently for each relation. ; ; in , and All are of dimension The real vectors correspond to the three rotation angle parameters in the universal single-qubit rotation gate.
[0029] 2) Construct a parameterized quantum gate and a rotation matrix by multiplying three rotation matrices; For relationship In dimensions Define the rotation matrix The parameterized form is: ; ; in, , , For dimension The following three rotation angle parameters; The rotation matrix is expressed mathematically as follows: ; For angle.
[0030] 3) Decompose complex-field quantum operations into real-field matrix operations and perform relational transformations on the physical quantum states; To improve computational efficiency in the real number field, complex matrix multiplication is decomposed into real number field operations. Let the input quantum state have dimension... The real part is The imaginary part is Through relationships The real part of the mapped output is The imaginary part is Then the transformation relation is: ; The unfolded form is as follows: ; In this embodiment, each relationship pass Each parameter independently defines its rotating circuit ( indivual parameter, indivual parameter, indivual (parameters), and the parameter set of each relation. They do not share information, thus ensuring that the model can learn the independent transformation patterns of each relation and accurately capture the specificity of relation semantics.
[0031] S2-2. Perform a quantum exchange test on the transformed head entity quantum state and tail entity quantum state, calculate the real part of the inner product of the two states to generate a semantic association score with global phase invariance, and convert it into the probability of the triplet's validity through an activation function. Specifically, it includes: 1) Perform a quantum exchange test on the transformed head entity quantum state and tail entity quantum state, and calculate the real part of the inner product of the two states to generate a semantic association score with global phase invariance; Head entity quantum state After relational transformation, it becomes ; Head entity quantum state after relational transformation With tail entity quantum state A quantum exchange test is performed, and the real part of the inner product of the two states is calculated as a semantic association score.
[0032] The scoring function is defined as follows: ; in, The head entity quantum state after relational transformation With tail entity quantum state The complex vector inner product, To take the real part; vector and Vector dot product
[0033] ; In this embodiment, only the real part of the inner product is used. The reason is: (1) The real part directly quantizes the degree of overlap of quantum states; (2) Ensure invariance to global phase transformation, which is in accordance with the basic principles of quantum mechanics.
[0034] scaling factor Map the output to a range This gives the rating a probabilistic interpretation; the closer the rating is to 1, the higher the semantic similarity between the head and tail entities. (Triples) The stronger the effectiveness.
[0035] 2) Combining quantum semantic association scoring with linear transformation, the probability of triplets being true is output through an activation function, the mathematical expression of which is: ; in, To create a label for the triplet. This indicates that the relationship is established; This indicates the operation of concatenating the embedding vectors of the head and tail entities; For relationship The dedicated weight vector, " is the matrix transpose; For bias terms; For the sigmoid function, map the output to The interval is used to predict the validity of the triplet.
[0036] In this embodiment, a hybrid architecture combining quantum similarity scoring and classical neural networks balances the similarity measurement capability of variable quantum circuits with the expressive power of classical neural networks. All model parameters include: entity embeddings. Relationship circuit parameters Classical weights and learnable weights The goal of joint optimization using gradient descent is to maximize the log-likelihood of the observed triplet.
[0037] Specifically, in S3, S3-1. Combining first-order logic rules, define a negative evidence lower bound objective function to approximate the posterior distribution of unknown facts; The mathematical expression for the negative evidence lower bound objective function, approximating the posterior distribution of the unknown facts, is as follows:
[0038] in, For approximate posterior distribution, A collection of unknown facts Given a set of known facts, These are the weight parameters for first-order logic rules; This is the set of first-order logic rules obtained through mining and filtering. Rules in the set; Let be the joint probability, representing the probability under the rule weights. Under the given conditions, known facts and unknown facts The probability of both occurring.
[0039] The mining of first-order logic rules can employ existing methods, such as the differentiable rule learning framework proposed by Yang et al. in "Differentiable learning of logical rules for knowledge base reasoning". This framework transforms the mining of first-order logic clauses into a continuous parameter optimization problem, using a neural network scorer to evaluate candidate rule bodies. The head structure performs differentiable gradient evaluation, quickly generates high-confidence atom combinations with a length ≤3, and simultaneously outputs initial weights that can be used for subsequent backpropagation, thereby realizing the construction of a logical rule candidate pool with high recall, learnability, and adaptability to sparse data. The mined first-order logic rules were preprocessed to remove reflexive rules and eliminate duplicates. Then, a confidence score threshold was set for the same target predicate, and all rules with confidence scores greater than the predetermined threshold were selected to form a set of first-order logic rules. .
[0040] S3-2. Based on mean-field theory, the approximate posterior distribution is decomposed into a product of first-order logic rules, and a Bernoulli distribution is established for each predicate. Based on mean-field theory, the approximate posterior distribution is... Defined as the product of the distributions corresponding to all instantiation rules: ; in, Representation rules The corresponding set of instantiation rules, For rules Instantiation rules For rules The constitutive instantiation predicate; For instantiating predicates The truth value of , This indicates that the facts are true; For each instantiated predicate (corresponding triples) Its truth model is a Bernoulli distribution: ; in, As a predicate The probability of being true is generated through quantum semantic similarity calculation, and its mathematical expression is: ; in, For quantum semantic similarity function, For rules The weight vector, , Head entities Tail-end entity quantum embedding vector, For bias terms, It is the sigmoid activation function.
[0041] S3-3. Calculate the satisfaction probability of each rule instantiation, which is defined as the product of the probabilities of the predicates; For each level of logical rule Its instantiation rules The probability distribution (the probability that the rule body satisfies the condition) is defined as the product of the probabilities that constitute the predicate: ; When all predicates in the rule body are true ( )hour, This indicates the confidence level of the instantiation rule.
[0042] rule Instantiation rule set The joint probability of all rules is: ; S3-4. Construct a rule-weighted joint probability distribution; A joint probability distribution for known and unknown facts is constructed by combining first-order logic rules. This distribution uses rules as its framework and quantum scoring as a priori information, embedding logical constraints into the probabilistic model through an exponential potential function. ; in, This is the normalization constant; For rules The assigned learnable weights reflect the importance of the rules; .
[0043] This joint probability integrates first-order logic rules (such as transitivity rules, symmetry rules, etc.) into the quantum representation space through a weighted exponential potential function, thereby unifying symbolic reasoning and probabilistic reasoning.
[0044] S3-5. Derive the optimization objective function under rule constraints; Approximating the mean field weighted joint probability of rules Substituting the ELBO objective function, after expansion and simplification, we obtain the final optimized objective function: ; The first term is the first-order logic rule score; the second term is the entropy penalty, calculated by the probability of the quantum semantic similarity output. Apply regularization to prevent predicate probabilities from approaching 0 or 1 too early, thus maintaining the exploratory power and smoothness of the distribution; By minimizing the objective function Jointly optimize the quantum embedding parameters until the model converges or achieves satisfactory posterior distribution approximation accuracy.
[0045] This embodiment achieves end-to-end joint optimization of quantum semantic similarity and rule reasoning through the objective function, significantly improving the accuracy and efficiency of knowledge graph reasoning.
[0046] Specifically, in S4, a gradient-based optimization method is used to update the parameters of the objective function; Specifically, with an approximate posterior distribution The parameters are the optimization objects, and all model parameters are updated synchronously through the single-step gradient descent rule; Among them, the model parameter set The iterative update rules are as follows: ; In the formula, For learning rate, Describe the objective function Regarding parameters In iteration step The gradient at that point.
[0047] Gradient calculation propagates the derivative along the model structure using automatic differentiation combined with the chain rule. Its calculation expression is: ; in, The joint gradient of the rule score and entropy penalty with respect to the predicate probability is given. The gradient of the quantum semantic similarity score with respect to the model parameters.
[0048] S5. Predict unknown facts based on convergent posterior distributions and complete the knowledge graph.
[0049] Based on the posterior distribution after convergence of S1-S4 optimization, the final vector for each entity and relation is generated. By calculating the probability of occurrence of unknown facts, high-confidence unknown facts are predicted, thus completing the knowledge graph completion. The specific steps include the following: S5-1. Based on the optimization results of S1-S4, determine the final set of model parameters for each entity. ; That is, the final quantum embedding vector of each entity, the final rotation parameters and weight parameters of each relation, and the final weight of each first-order logic rule; S5-2, For candidate unknown fact triples Based on the final set of model parameters The vector in the calculation calculates the probability of the candidate unknown fact being true; The semantic similarity score between the head and tail entities is calculated by quantum exchange test, and the probability prediction value of the triple is output by combining relational linear transformation and activation function. S5-3. Sort all candidate unknown facts in descending order of probability, select the Top-K high-probability results as inference output, and complete the knowledge graph completion.
[0050] In summary, compared with traditional methods, the quantum circuit-enhanced knowledge graph reasoning method of this embodiment has the following technical advantages: (1) For knowledge graph reasoning tasks, a joint probability distribution model of known facts and unknown facts is constructed by combining quantum embedded networks and logical rule scoring functions, and first-order logical rules are seamlessly integrated into the quantum representation space to achieve efficient solution through variable quantum circuits; (2) Physical quantum state mapping design: a complex vector space embedding vector is constructed by training amplitude parameter vector and phase parameter vector to simulate the superposition system of non-normalized quantum bit states; (3) Design of quantum operation parameterization model for relation mapping: By defining a trainable parameter set for each relation independently and decomposing complex matrix multiplication into real number field operations, we can ensure that the parameters of each relation are not shared, so as to accurately capture the semantic specificity of the relation. (4) A semantic association scoring method based on quantum measurement calculates the semantic similarity of the head and tail entities through a quantum exchange test protocol, generates a semantic association strength score, and converts it into a probability prediction of the validity of triples.
[0051] (5) Optimize the module design, generate an approximate posterior distribution by calculating the quantum variational objective function and quantum semantic similarity, and realize end-to-end joint optimization of rule reasoning and quantum embedding.
[0052] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A quantum circuit-enhanced knowledge graph reasoning method, characterized in that, include: S1. Map the knowledge graph entities into complex vector space quantum states containing amplitude parameter vectors and phase parameter vectors to generate an entity quantum state library; S2. For the triple to be reasoned, the relation transformation is performed on the parameterized quantum gate constructed from the quantum state of the beginning entity through three rotation angle parameters, and the quantum exchange test is performed with the quantum state of the tail entity. The inner product real part is calculated to generate a semantic association score, which is converted into the probability of the triple being true. S2 includes: S2-1. Define a trainable parameter set containing three rotation angle parameters for each relation in the knowledge graph. Construct a parameterized quantum gate by multiplying the rotation matrices. Decompose the quantum operation in the complex field into matrix operation in the real field. Perform relation transformation on the quantum state of the head entity and output the transformed quantum state of the head entity. S2-2. Perform quantum exchange tests on the transformed head entity quantum state and tail entity quantum state, calculate the real part of the inner product of the two states to generate a semantic association score with global phase invariance, and convert it into the probability of the triplet's validity through an activation function; S3. Using the probability of the triplet being true as a priori, construct a joint probability distribution by combining first-order logic rules, and solve the posterior distribution of unknown facts through variable quantum circuits. S4. Define a variational objective function based on the joint probability distribution, and jointly optimize the entity amplitude / phase parameters, relation rotation parameters and rule weights through gradient descent until the posterior distribution converges. S5. Predict unknown facts based on convergent posterior distributions and complete the knowledge graph.
2. The quantum circuit-enhanced knowledge graph reasoning method according to claim 1, characterized in that, In S1, each entity in the knowledge graph Mapping to quantum state ; ; in, For amplitude parameter vectors, For phase parameter vectors, For quantum embedded implicit dimensions, This indicates element-wise multiplication.
3. The quantum circuit-enhanced knowledge graph reasoning method according to claim 1, characterized in that, S2-1 includes: 1) Define a trainable parameter set containing three rotation angle parameters independently for each relation. ; ; in , and All are of dimension The real vectors correspond to the three rotation angle parameters in the universal single-qubit rotation gate; 2) Construct a parameterized quantum gate and a rotation matrix by multiplying three rotation matrices; For relationship In dimensions Define the rotation matrix The parameterized form is: ; ; in, , , For dimension The following three rotation angle parameters; Represents the rotation matrix; 3) Decompose complex-field quantum operations into real-field matrix operations and perform relational transformations on the physical quantum states; The transformation relationship is as follows: ; in, , For the input quantum state in dimension The real part and the imaginary part; , For the relationship The real and imaginary components are output after mapping.
4. The quantum circuit-enhanced knowledge graph reasoning method according to claim 3, characterized in that, The quantum exchange test is performed on the head entity quantum state and the tail entity quantum state after relation transformation. The scoring function that generates a semantic association score with global phase invariance by calculating the real part of the inner product of the two states is as follows: ; in, For triples Quantum semantic similarity score; Indicates the head entity. Indicates the tail entity. Indicates a relationship; Represents the quantum state of the head entity after relational transformation; Represents the tail entity quantum state; express and The complex vector inner product, This indicates taking the real part.
5. The quantum circuit-enhanced knowledge graph reasoning method according to claim 4, characterized in that, The expression for the probability of a triple being true is: ; in, To create a label for the triplet. Represents the head entity embedding vector Tail entity embedding vector splicing operation; For relationship The dedicated weight vector, " is the matrix transpose; For bias terms; This is the sigmoid function.
6. The quantum circuit-enhanced knowledge graph reasoning method according to claim 5, characterized in that, In S3, based on mean-field theory, the approximate posterior distribution is decomposed into a product of first-order logic rule instantiations, and a Bernoulli distribution is established for each predicate; including: Approximate posterior distribution Defined as the product of the distributions corresponding to all instantiation rules: ; in, Representation rules The corresponding set of instantiation rules, For rules Instantiation rules For rules The constitutive instantiation predicate; For instantiating predicates The truth value of , This indicates that the facts are true; For each corresponding triple Instantiated predicates The truth model is a Bernoulli distribution: ; in, For instantiating predicates The true prediction probability is generated through quantum semantic similarity calculation, and its mathematical expression is: ; in, For quantum semantic similarity function, For rules The weight vector, , Head entities Tail-end entity quantum embedding vector, For bias terms, It is the sigmoid activation function.
7. The quantum circuit-enhanced knowledge graph reasoning method according to claim 6, characterized in that, In S3, the constructed joint probability Defined as: ; in, For known facts, For unknown facts, For rules The assigned learnable weights, Representation rules The corresponding set of instantiation rules, To instantiate the rules, For rules The constitutive instantiation predicate; The normalization constant is It is a set of rules.
8. The quantum circuit-enhanced knowledge graph reasoning method according to claim 7, characterized in that, In S3, the optimization objective function under rule constraints is derived; ; Among them, rules , It is a set of first-order logic rules.
9. The quantum circuit-enhanced knowledge graph reasoning method according to claim 8, characterized in that, In S4, a gradient-based optimization method is used to update the parameters of the objective function; Among them, the model parameter set The iterative update rule is as follows: ; In the formula, For learning rate, Describe the objective function About parameter set In iteration step gradient at; ; in, The joint gradient of the rule score and entropy penalty with respect to the predicate probability is given. The gradient of the quantum semantic similarity score with respect to the model parameters.
Citation Information
Patent Citations
Uncertain knowledge graph reasoning method based on rule mining
CN120104809A
Smart library reading promotion management method based on knowledge graph
CN120525698A