<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD with MathML3 v1.1d2 20140930//EN" "JATS-journalpublishing1-mathml3.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.1d2" xml:lang="en">
  <front>
    <journal-meta>
      <journal-id journal-id-type="nlm-ta">CJIF</journal-id>
      <journal-id journal-id-type="publisher-id">ICCK</journal-id>
      <journal-title-group>
        <journal-title>Chinese Journal of Information Fusion</journal-title>
      </journal-title-group>
      <issn pub-type="ppub" publication-format="print">2998-3363</issn>
      <issn pub-type="epub" publication-format="electronic">2998-3371</issn>
      <publisher>
        <publisher-name>Institute of Central Computation and Knowledge Inc</publisher-name>
        <publisher-loc>522 W RIVERSIDE AVE STE N, SPOKANE, WA, 99201-0508, UNITED STATES</publisher-loc>
      </publisher>
    </journal-meta>
    <article-meta>
      <article-id pub-id-type="doi">10.62762/CJIF.2025.552445</article-id>
      <article-categories>
        <subj-group subj-group-type="heading">
          <subject>Research Article</subject>
        </subj-group>
      </article-categories>
      <title-group>
        <article-title>Knowledge Graph Reasoning with Quantum-Inspired Reinforcement Learning</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <contrib-id contrib-id-type="orcid">https://orcid.org/0009-0000-1927-8027</contrib-id>
          <name>
            <surname>Chen</surname>
            <given-names>Junliang</given-names>
          </name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <name>
            <surname>Zhang</surname>
            <given-names>Xianchao</given-names>
          </name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <name>
            <surname>Sun</surname>
            <given-names>Fengsong</given-names>
          </name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <name>
            <surname>Lu</surname>
            <given-names>Jun</given-names>
          </name>
          <xref ref-type="aff" rid="aff2">2</xref>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <aff id="aff1"><label>1</label>School of Information and Communication Engineering, Beijing University of Posts and Telecommunications, Beijing 100876, China</aff>
        <aff id="aff2"><label>2</label>Provincial Key Laboratory of Multimodal Perceiving and Intelligent Systems, Jiaxing University, Jiaxing 314001, China</aff>
        <aff id="aff3"><label>3</label>China Academy of Electronics and Information Technology, Beijing 100049, China</aff>
      </contrib-group>
      <author-notes>
        <corresp id="cor2">Corresponding Author: Xianchao Zhang. Email: <email>zhangxianchao@zjxu.edu.cn</email></corresp>
        <corresp id="cor4">Corresponding Author: Jun Lu. Email: <email>lujun_cetc@163.com</email></corresp>
      </author-notes>
      <pub-date date-type="pub" pub-type="epub" publication-format="online">
        <day>25</day>
        <month>5</month>
        <year>2025</year>
      </pub-date>
      <volume>2</volume>
      <issue>2</issue>
      <fpage>144</fpage>
      <lpage>156</lpage>
      <history>
        <date date-type="received">
          <day>25</day>
          <month>2</month>
          <year>2025</year>
        </date>
        <date date-type="accepted">
          <day>28</day>
          <month>4</month>
          <year>2025</year>
        </date>
      </history>
      <permissions>
        <copyright-statement>© 2025 by the Authors. Published by Institute of Central Computation and Knowledge. This is an open access article under the CC BY license (https://creativecommons.org/licenses/by/4.0/).</copyright-statement>
        <copyright-year>2025</copyright-year>
        <copyright-holder>The Authors</copyright-holder>
        <license xlink:href="https://creativecommons.org/licenses/by/4.0/">
        </license>
      </permissions>
      <self-uri xlink:href="https://www.icck.org/article/abs/cjif.2025.552445">This article is available from https://www.icck.org/article/abs/cjif.2025.552445</self-uri>
      <abstract>
        <p>Knowledge reasoning is a critical task in information fusion systems, and its core step is reasoning missing information from existing facts to improve the knowledge graphs. Embedding-based reasoning methods and path-based reasoning methods are two mainstream knowledge reasoning methods. Embedding-based reasoning methods enable fast and direct reasoning but are limited to simple relationships between entities and exhibit poor performance in reasoning complex logical relationships. Path-based reasoning methods perform better in complex reasoning tasks, but suffer from high computational complexity, a large number of model parameters, and low reasoning efficiency. To address the aforementioned issues, this paper introduces a knowledge reasoning model called Quantum-Inspired Reinforcement Learning (QIRL). QIRL leverages quantum reinforcement learning to train a strategy network via a quantum circuit, aiming to generate and optimize reasoning paths. Quantum circuit achieves complex nonlinear operations through limited quantum reasoning paths gate operations, reducing computational complexity. In addition, this article utilizes the quantum entanglement property to encode high-dimensional data, reducing the number of model training parameters. This article evaluates the QIRL method on entity prediction task and proves that the QIRL method can effectively reduce the number of model training parameters.</p>
      </abstract>
      <kwd-group kwd-group-type="author" xml:lang="en">
        <kwd>knowledge graph</kwd>
        <kwd>knowledge reasoning</kwd>
        <kwd>reinforcement learning</kwd>
        <kwd>quantum circuit</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="S1">
      <label>1.</label>
      <title>Introduction</title>
      <p id="S1.p1">Knowledge Graphs (KGs) serve as a foundational tool for information fusion, providing a structured representation of knowledge that facilitates data integration and semantic modeling. However, during the construction of KGs, the occurrence of missing facts, resulting from incomplete, inconsistent, or dynamically evolving data, limits their practical applicability. To address this issue, knowledge reasoning, as a core task in knowledge graph research, aims to complete missing facts based on existing ones. Embedded-based reasoning method is one of the mainstream [<xref rid="ref001" ref-type="bibr">1</xref>]. This method captures semantic information [<xref rid="ref002" ref-type="bibr">2</xref>] and reasoning out missing facts by learning low dimensional vector representations of entities and relationships in KGs and utilizing the relative positions and geometric structures between these embedded vectors. Embedding-based reasoning methods are computationally simple, efficient, and suitable for various applications. However, their representational capacity is limited, making it challenging to reason about complex relationships between entities. For complex reasoning tasks, path-based reasoning methods can effectively capture and model multi-level relationship structures and search for multi-hop paths between entities in the KG, using structural information to reason about missing facts and complete the KG. The path-based reasoning method can effectively handle complex relational reasoning tasks [<xref rid="ref003" ref-type="bibr">3</xref>], but the path search and matching process usually requires traversing a large number of graph structures, resulting in high computational complexity and significantly increasing the consumption of computing resources. Reducing the number of model parameters can decrease computational complexity, enhance reasoning efficiency, and reduce computational costs.</p>
      <p id="S1.p2">Traditional methods, while reducing the number of parameters to some extent, still face a trade-off between model performance and computational efficiency. As an emerging computing paradigm, quantum circuit, with their unique quantum advantages, can significantly reduce the number of model training parameters while maintaining or improving model performance, thereby further optimizing computational efficiency and reasoning effectiveness. Arute et al. [<xref rid="ref007" ref-type="bibr">7</xref>] used a quantum processor called Sycamore to perform an extremely difficult random number generation task and compared it with traditional supercomputers. The experimental results indicate that the time required for Sycamore to complete the task is much shorter than that of classical computers, demonstrating the computational advantage of quantum computers over traditional computers in specific tasks. With the deepening of quantum computing research, variational quantum circuit (VQC) have emerged [<xref rid="ref008" ref-type="bibr">8</xref>]. This method draws on the principles and structures of artificial neural networks, enabling quantum computing to be effectively applied to machine learning tasks. Chen et al. [<xref rid="ref010" ref-type="bibr">10</xref>] demonstrated that the parameter space complexity of VQC is <inline-formula><mml:math alttext="O(N)" display="inline"><mml:mrow><mml:mi>O</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi>N</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, while that of the traditional neural network DON is <inline-formula><mml:math alttext="O(N^{2})" display="inline"><mml:mrow><mml:mi>O</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:msup><mml:mi>N</mml:mi><mml:mn>2</mml:mn></mml:msup><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>. For KGs, which involve large state and action spaces, VQC can greatly reduce model parameters and computational complexity.</p>
      <p id="S1.p3">In order to address the challenges of computational complexity and resource consumption in knowledge reasoning models, this paper proposes quantum-inspired reinforcement learning (QIRL), which trains a reinforcement learning strategy network based on quantum circuit and searches for reasoning paths in KGs. Specifically, this paper proposes an embedding-based approach to map the state information of the knowledge graph (KG) into a continuous vector space. This representation is then quantum encoded and input into a strategy network based on quantum circuits for training. Ultimately, the network outputs the probability distribution for the next action. The strategy network based on quantum circuit gradually expands the reasoning path until all reasoning paths in the KG are found. QIRL utilizes the parallelism and entanglement properties of quantum computing, greatly reducing the number of model training parameters, lowering computational complexity, and reducing computational resource consumption. The main contributions of this paper are as follows:</p>
      <p>
        <list list-type="order" id="S1.I1">
          <list-item id="S1.I1.i1">
            <p id="S1.I1.i1.p1">This article proposes a knowledge reasoning model based on quantum circuit training reinforcement learning strategy network for the first time, which uses known facts to supervise the training of quantum circuit, update its parameters, and perform knowledge reasoning;</p>
          </list-item>
          <list-item id="S1.I1.i2">
            <p id="S1.I1.i2.p1">This article utilizes the parallelism and entanglement properties of quantum computing to reduce computational complexity, The experimental results show that the QIRL method proposed in this paper can significantly reduce the number of model training parameters.</p>
          </list-item>
        </list>
      </p>
    </sec>
    <sec id="S2">
      <label>2.</label>
      <title>Related Work</title>
      <sec id="S2.SS1">
        <label>2.1</label>
        <title>Embedded-Based Reasoning Methods</title>
        <p id="S2.SS1.p1">The embedding-based reasoning methods map entities and relationships in KGs to a low dimensional vector space, allowing their semantic and structural information to be expressed in the form of geometric relationships, thereby efficiently handling reasoning tasks in large-scale KGs. Early methods such as TransE [<xref rid="ref011" ref-type="bibr">11</xref>], TransH [<xref rid="ref012" ref-type="bibr">12</xref>] and DistlMult [<xref rid="ref013" ref-type="bibr">13</xref>] focused on studying geometric relationships such as translation, projection, and linear transformation between embedded vectors of entities and relationships, providing efficient and semantic knowledge representation for knowledge reasoning. Lu et al. [<xref rid="ref014" ref-type="bibr">14</xref>] proposed the DensE method, which decomposes each relationship into rotation and scaling operators in three-dimensional Euclidean space, which can better represent composite relationships. Pavlovic et al. [<xref rid="ref015" ref-type="bibr">15</xref>] proposed the ExpressivE method, which uses the spatial relationships of super parallel quadrilaterals to represent the semantic structural information between entities and relationships, providing intuitive geometric explanations for knowledge reasoning tasks. Although embedding based reasoning methods have shown good performance in large-scale KGs reasoning tasks, they are difficult to handle relationships with multi-level semantics or nonlinear structures, and have weak modeling capabilities for complex relationships.</p>
      </sec>
      <sec id="S2.SS2">
        <label>2.2</label>
        <title>Path-Based Reasoning Methods</title>
        <p id="S2.SS2.p1">The path-based reasoning methods utilizes the powerful expressive power of neural networks to optimize the reasoning process, which can effectively handle reasoning tasks in large-scale KGs. Dettmers et al. [<xref rid="ref016" ref-type="bibr">16</xref>] proposed a multi-layer convolutional network mode called ConvE for link prediction, which captures the relationship information between entities through convolutional networks and effectively reasons over large-scale KGs. Yang et al. [<xref rid="ref017" ref-type="bibr">17</xref>] proposed the hyper relation aware multi-view model HyRel, which learns the globally transferable structure of a graph to reason about unseen graphs, offering high flexibility and usability. Xiong et al. [<xref rid="ref018" ref-type="bibr">18</xref>] proposed a reinforcement learning framework for learning multi-hop relational paths, which effectively handles complex reasoning tasks with ambiguous answers and scales to large KGs. The path-based reasoning methods perform well in large-scale KG reasoning, but the model requires a large number of training parameters, high computational complexity, and demand significant computing and storage resources.</p>
      </sec>
      <sec id="S2.SS3">
        <label>2.3</label>
        <title>Applications of Quantum Computing</title>
        <p id="S2.SS3.p1">The superposition and entanglement properties of quantum computing give it unique advantages in solving certain computational tasks that traditional computers do not have. Chen et al. [<xref rid="ref010" ref-type="bibr">10</xref>] explored the potential of quantum computing to enhance reinforcement learning and demonstrated the potential of quantum algorithms in improving time and space complexity in simple environments. Chen et al. [<xref rid="ref004" ref-type="bibr">4</xref>] proposed the asynchronous training of advantage actor-critic variational quantum policies, which reduces the training time of quantum reinforcement learning. As the application of quantum computing in reinforcement learning progresses, quantum reinforcement learning has been extensively explored and applied across various fields. Kim et al. [<xref rid="ref005" ref-type="bibr">5</xref>] integrated quantum reinforcement learning into reusable rocket control systems, enhancing both computational efficiency and model stability. Ansere et al. [<xref rid="ref006" ref-type="bibr">6</xref>] proposed a Quantum-empowered Deep Reinforcement Learning (Qe-DRL) approach to enhance computational learning speed and task processing efficiency for IoT devices under quantum uncertainty and time-varying channel conditions. In addition, quantum reinforcement learning is widely used in fields such as biochemistry and medicine, and has shown good performance. However, the above application scenarios are generally relatively simple, usually requiring only a limited number of qubits and small state and action spaces. KGs typically contain large states and action spaces. To reduce the computational complexity of reasoning models in large-scale KGs, this paper proposes a quantum reinforcement learning based knowledge reasoning model QIRL, which greatly reduces the training parameters of the model by utilizing quantum advantages. The performance of the proposed model is validated on universal datasets. In contrast to emerging LLM-based reasoning methods [<xref rid="ref009" ref-type="bibr">9</xref>], our approach emphasizes computational efficiency and parameter reduction via quantum-inspired techniques.</p>
      </sec>
    </sec>
    <sec id="S3">
      <label>3.</label>
      <title>Problem Description</title>
      <p id="S3.p1">A KG contains a large amount of entity and relational data. Given a graph <inline-formula><mml:math alttext="{G=\{E,\epsilon,R\}}" display="inline"><mml:mrow><mml:mi>G</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mo stretchy="false">{</mml:mo><mml:mi>E</mml:mi><mml:mo>,</mml:mo><mml:mi>ϵ</mml:mi><mml:mo>,</mml:mo><mml:mi>R</mml:mi><mml:mo stretchy="false">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math alttext="{E}" display="inline"><mml:mi>E</mml:mi></mml:math></inline-formula> represents the set of entities and <inline-formula><mml:math alttext="R" display="inline"><mml:mi>R</mml:mi></mml:math></inline-formula> represents the set of relationships between entities. <inline-formula><mml:math alttext="\epsilon=\{(h_{i},r_{i},t_{i})|h_{i},t_{i}\in E,r_{i}\in R\}" display="inline"><mml:mrow><mml:mi>ϵ</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mo stretchy="false">{</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo lspace="0em" rspace="0em">|</mml:mo><mml:mrow><mml:mrow><mml:mrow><mml:msub><mml:mi>h</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mo>∈</mml:mo><mml:mi>E</mml:mi></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>∈</mml:mo><mml:mi>R</mml:mi></mml:mrow></mml:mrow><mml:mo stretchy="false">}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> is the set of triplets in a KG, each triplet consisting of a head entity <inline-formula><mml:math alttext="h_{i}" display="inline"><mml:msub><mml:mi>h</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>, a relationship <inline-formula><mml:math alttext="r_{i}" display="inline"><mml:msub><mml:mi>r</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>, and a tail entity <inline-formula><mml:math alttext="t_{i}" display="inline"><mml:msub><mml:mi>t</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>. Due to incomplete data sources and insufficient information extraction, KGs often have missing elements, which can be filled in through knowledge reasoning. According to the type of missing elements, knowledge reasoning tasks can be divided into head reasoning <inline-formula><mml:math alttext="(?,r_{i},t_{i})" display="inline"><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi mathvariant="normal">?</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula>, tail reasoning <inline-formula><mml:math alttext="(h_{i},r_{i},?)" display="inline"><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi mathvariant="normal">?</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula> and relational reasoning <inline-formula><mml:math alttext="(h_{i},?,t_{i})" display="inline"><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi mathvariant="normal">?</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula>, among which <inline-formula><mml:math alttext="?" display="inline"><mml:mi mathvariant="normal">?</mml:mi></mml:math></inline-formula> indicates missing elements. The path-based knowledge reasoning methods reason about missing facts by searching for paths between entities. As the number of entities and relationships in the KG increases, the number of possible reasoning paths increases exponentially, which makes a comprehensive analysis of these paths computationally complex. Therefore, how to reduce computational complexity while ensuring reasoning accuracy has become a key challenge in current research.</p>
      <p id="S3.p2">To address the above issues, this paper proposes a quantum reinforcement learning-based knowledge reasoning method, QIRL, which utilizes quantum circuits to train the strategy network and reduce the computational complexity of the training process. The QIRL method consists of two main components: the external environment and the quantum strategy network. The quantum strategy network is primarily composed of quantum circuits, which in turn consist of quantum bits, quantum gates, and measurement operations [<xref rid="ref005" ref-type="bibr">5</xref>]. Quantum bits are the fundamental units used to construct quantum circuits, while quantum gates serve as the basic units for manipulating quantum bits. Quantum gates perform linear transformations on the states of quantum bits, create entanglement between them, and enable parallelism in quantum computation. This allows quantum circuits to simultaneously process data from multiple quantum bits, significantly reducing the number of model training parameters and lowering computational complexity. After the quantum circuit processes the data of <inline-formula><mml:math alttext="n" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula> quantum bits in parallel, a measurement is performed on these <inline-formula><mml:math alttext="n" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula> quantum bits to obtain the output of the quantum strategy network. The quantum strategy network generates the next action based on the current external environment state and continuously updates its parameters until the reasoning process is completed. This paper mainly focuses on tail reasoning tasks, while the other two types of reasoning tasks can be similarly transformed into the form of tail reasoning tasks.</p>
    </sec>
    <sec id="S4">
      <label>4.</label>
      <title>QIRL Model</title>
      <p id="S4.p1">In this section, an overview of the proposed QIRL method is first introduced. The QIRL method trains a reinforcement learning strategy network based on quantum circuit and continuously updates the quantum circuit parameters according to the state of the agent. Afterwards, the training and reasoning process of the QIRL method were described in detail.</p>
      <sec id="S4.SS1">
        <label>4.1</label>
        <title>Modeling</title>
        <p id="S4.SS1.p1">The QIRL method updates the parameters of the quantum policy network by continuously interacting with the environment to find the optimal reasoning paths. In this paper, the environment is modeled as a Markov Decision Process (MDP) and the interaction dynamics between the agent and the KG are specified. MDP can be represented by tuple <inline-formula><mml:math alttext="\left\langle S,R,P,R^{\prime}\right\rangle" display="inline"><mml:mrow><mml:mo>⟨</mml:mo><mml:mi>S</mml:mi><mml:mo>,</mml:mo><mml:mi>R</mml:mi><mml:mo>,</mml:mo><mml:mi>P</mml:mi><mml:mo>,</mml:mo><mml:msup><mml:mi>R</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>⟩</mml:mo></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math alttext="S=\left\{{{s_{1}},{s_{2}},\cdots,{s_{n}}}\right\}" display="inline"><mml:mrow><mml:mi>S</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:msub><mml:mi>s</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>s</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi mathvariant="normal">⋯</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>s</mml:mi><mml:mi>n</mml:mi></mml:msub><mml:mo>}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> represents the continuous state space of the KG as input to the quantum policy network. <inline-formula><mml:math alttext="R=\left\{{{r_{1}},{r_{2}},\cdots,{r_{n}}}\right\}" display="inline"><mml:mrow><mml:mi>R</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mi mathvariant="normal">⋯</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mi>n</mml:mi></mml:msub><mml:mo>}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> represents the set of relationships in the KG, that is, the set of all next optional actions output by the quantum policy network. <inline-formula><mml:math alttext="P\left({{S_{i+1}}={s^{,}}|{S_{i}}=s,{R_{i}}=r}\right)" class="ltx_math_unparsed" display="inline"><mml:mrow><mml:mi>P</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mi>s</mml:mi><mml:mo>,</mml:mo></mml:msup><mml:mo fence="false" rspace="0.167em" stretchy="false">|</mml:mo><mml:msub><mml:mi>S</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>s</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>R</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>r</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> is a state transition probability function that represents the probability of the QIRL policy network transitioning from state <inline-formula><mml:math alttext="s" display="inline"><mml:mi>s</mml:mi></mml:math></inline-formula> to state <inline-formula><mml:math alttext="s^{\prime}" display="inline"><mml:msup><mml:mi>s</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:math></inline-formula> upon selecting action <inline-formula><mml:math alttext="r" display="inline"><mml:mi>r</mml:mi></mml:math></inline-formula>. <inline-formula><mml:math alttext="{R^{\prime}}\left({s,r}\right)" display="inline"><mml:mrow><mml:msup><mml:mi>R</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>⁢</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mi>s</mml:mi><mml:mo>,</mml:mo><mml:mi>r</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> is the reward function for each pair <inline-formula><mml:math alttext="\left({s,r}\right)" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>s</mml:mi><mml:mo>,</mml:mo><mml:mi>r</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, designed to encourage the agent to learn the optimal strategy. The specific settings of the QIRL method are as follows:</p>
        <p>
          <list list-type="bullet" id="S4.I1">
            <list-item id="S4.I1.i1">
              <p id="S4.I1.i1.p1">Actions: The actions of the quantum policy network can be represented by the relationship <inline-formula><mml:math alttext="r" display="inline"><mml:mi>r</mml:mi></mml:math></inline-formula> in the KG. For the entity pair <inline-formula><mml:math alttext="\left({{h_{i}},{t_{i}}}\right)" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, starting from the head entity <inline-formula><mml:math alttext="{h_{i}}" display="inline"><mml:msub><mml:mi>h</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>, the agent selects the action with the highest probability as the next action <inline-formula><mml:math alttext="{r_{i}}" display="inline"><mml:msub><mml:mi>r</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> based on the output action probability distribution of the quantum policy network, to extend the path until reaching the real tail entity <inline-formula><mml:math alttext="{t_{i}}" display="inline"><mml:msub><mml:mi>t</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>; To ensure the consistency of the output dimension of the strategy network, this paper defines the action space as all relationships and their inverse relationships in the KG, and the dimension of the action space is consistent with the number of quantum bits in the quantum circuit.</p>
            </list-item>
            <list-item id="S4.I1.i2">
              <p id="S4.I1.i2.p1">States: KGs contain a large number of entities and relationships, which are discrete symbols, while policy network training needs to be conducted in a continuous space. In order for the policy network to better capture semantic information, it is necessary to transform entities and relationships into continuous vectors. This model employs the translation-based embedding method TransE, which maps the discrete symbols of entities and relationships into a continuous vector space, capturing the agent's position in the KG and enabling transitions from the current entity to the next via the selected relationship. The state of the agent in step i can be represented by the following vector:</p>
              <p>
                <disp-formula id="S4.E1">
                  <mml:math alttext="{s_{i}}=\left({{e_{i}},{e_{t}}-{e_{i}}}\right)" display="block">
                    <mml:mrow>
                      <mml:msub>
                        <mml:mi>s</mml:mi>
                        <mml:mi>i</mml:mi>
                      </mml:msub>
                      <mml:mo>=</mml:mo>
                      <mml:mrow>
                        <mml:mo>(</mml:mo>
                        <mml:msub>
                          <mml:mi>e</mml:mi>
                          <mml:mi>i</mml:mi>
                        </mml:msub>
                        <mml:mo>,</mml:mo>
                        <mml:mrow>
                          <mml:msub>
                            <mml:mi>e</mml:mi>
                            <mml:mi>t</mml:mi>
                          </mml:msub>
                          <mml:mo>−</mml:mo>
                          <mml:msub>
                            <mml:mi>e</mml:mi>
                            <mml:mi>i</mml:mi>
                          </mml:msub>
                        </mml:mrow>
                        <mml:mo>)</mml:mo>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:math>
                </disp-formula>
              </p>
              <p>where <inline-formula><mml:math alttext="{e_{i}}" display="inline"><mml:msub><mml:mi>e</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> represents the embedding vector of the current entity, <inline-formula><mml:math alttext="{e_{t}}" display="inline"><mml:msub><mml:mi>e</mml:mi><mml:mi>t</mml:mi></mml:msub></mml:math></inline-formula> represents the embedding vector of the tail entity, and <inline-formula><mml:math alttext="{e_{t}}-{e_{i}}" display="inline"><mml:mrow><mml:msub><mml:mi>e</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:mo>−</mml:mo><mml:msub><mml:mi>e</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> represents the distance between the target entity and the current entity in the vector space. After the embedding vectors of entities and relationships are trained, they still need to undergo quantum encoding before being input into the quantum circuit of the strategy function for processing. Quantum amplitude coding is an efficient mapping method from classical data to quantum states where <inline-formula><mml:math alttext="n" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula> qubits can encode states with a dimension of <inline-formula><mml:math alttext="2^{n}" display="inline"><mml:msup><mml:mn>2</mml:mn><mml:mi>n</mml:mi></mml:msup></mml:math></inline-formula>, achieving compressed representation of high-dimensional input data. This paper uses quantum amplitude coding to encode states <inline-formula><mml:math alttext="{s_{i}}" display="inline"><mml:msub><mml:mi>s</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>. The state <inline-formula><mml:math alttext="{s_{i}}" display="inline"><mml:msub><mml:mi>s</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> is normalized to <inline-formula><mml:math alttext="{\bar{s}_{i}}" display="inline"><mml:msub><mml:mover accent="true"><mml:mi>s</mml:mi><mml:mo>¯</mml:mo></mml:mover><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>, where <inline-formula><mml:math alttext="\left\|{{s_{i}}}\right\|" display="inline"><mml:mrow><mml:mo>‖</mml:mo><mml:msub><mml:mi>s</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>‖</mml:mo></mml:mrow></mml:math></inline-formula> denotes the norm of <inline-formula><mml:math alttext="{s_{i}}" display="inline"><mml:msub><mml:mi>s</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>.</p>
              <p>
                <disp-formula id="S4.E2">
                  <mml:math alttext="{\bar{s}_{i}}=\frac{{{s_{i}}}}{{\left\|{{s_{i}}}\right\|}}" display="block">
                    <mml:mrow>
                      <mml:msub>
                        <mml:mover accent="true">
                          <mml:mi>s</mml:mi>
                          <mml:mo>¯</mml:mo>
                        </mml:mover>
                        <mml:mi>i</mml:mi>
                      </mml:msub>
                      <mml:mo>=</mml:mo>
                      <mml:mfrac>
                        <mml:msub>
                          <mml:mi>s</mml:mi>
                          <mml:mi>i</mml:mi>
                        </mml:msub>
                        <mml:mrow>
                          <mml:mo>‖</mml:mo>
                          <mml:msub>
                            <mml:mi>s</mml:mi>
                            <mml:mi>i</mml:mi>
                          </mml:msub>
                          <mml:mo>‖</mml:mo>
                        </mml:mrow>
                      </mml:mfrac>
                    </mml:mrow>
                  </mml:math>
                </disp-formula>
              </p>
              <p>assuming that the dimension of <inline-formula><mml:math alttext="{s_{i}}" display="inline"><mml:msub><mml:mi>s</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> is <inline-formula><mml:math alttext="{2^{n}}" display="inline"><mml:msup><mml:mn>2</mml:mn><mml:mi>n</mml:mi></mml:msup></mml:math></inline-formula>, it can be encoded into an n-qubit quantum state expressed as:</p>
              <p>
                <disp-formula-group id="S7.EGx1">
                  <disp-formula id="S4.E3">
                    <mml:math alttext="\displaystyle\left|\varphi\right\rangle={\bar{s}_{i,0}}\cdot\left|{00\cdots 0}%&#10;\right\rangle+{\bar{s}_{i,1}}\cdot\left|{00\cdots 1}\right\rangle+\cdots" display="inline">
                      <mml:mrow>
                        <mml:mrow>
                          <mml:mo>|</mml:mo>
                          <mml:mi>φ</mml:mi>
                          <mml:mo>⟩</mml:mo>
                        </mml:mrow>
                        <mml:mo>=</mml:mo>
                        <mml:mrow>
                          <mml:mrow>
                            <mml:msub>
                              <mml:mover accent="true">
                                <mml:mi>s</mml:mi>
                                <mml:mo>¯</mml:mo>
                              </mml:mover>
                              <mml:mrow>
                                <mml:mi>i</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mn>0</mml:mn>
                              </mml:mrow>
                            </mml:msub>
                            <mml:mo lspace="0.222em" rspace="0.222em">⋅</mml:mo>
                            <mml:mrow>
                              <mml:mo>|</mml:mo>
                              <mml:mrow>
                                <mml:mn>00</mml:mn>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi mathvariant="normal">⋯</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mn>0</mml:mn>
                              </mml:mrow>
                              <mml:mo>⟩</mml:mo>
                            </mml:mrow>
                          </mml:mrow>
                          <mml:mo>+</mml:mo>
                          <mml:mrow>
                            <mml:msub>
                              <mml:mover accent="true">
                                <mml:mi>s</mml:mi>
                                <mml:mo>¯</mml:mo>
                              </mml:mover>
                              <mml:mrow>
                                <mml:mi>i</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:mn>1</mml:mn>
                              </mml:mrow>
                            </mml:msub>
                            <mml:mo lspace="0.222em" rspace="0.222em">⋅</mml:mo>
                            <mml:mrow>
                              <mml:mo>|</mml:mo>
                              <mml:mrow>
                                <mml:mn>00</mml:mn>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi mathvariant="normal">⋯</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mn>1</mml:mn>
                              </mml:mrow>
                              <mml:mo>⟩</mml:mo>
                            </mml:mrow>
                          </mml:mrow>
                          <mml:mo>+</mml:mo>
                          <mml:mi mathvariant="normal">⋯</mml:mi>
                        </mml:mrow>
                      </mml:mrow>
                    </mml:math>
                  </disp-formula>
                  <disp-formula id="S4.Ex1">
                    <mml:math alttext="\displaystyle+{\bar{s}_{i,{2^{n}}-1}}\cdot\left|{11\cdots 1}\right\rangle" display="inline">
                      <mml:mrow>
                        <mml:mo>+</mml:mo>
                        <mml:mrow>
                          <mml:msub>
                            <mml:mover accent="true">
                              <mml:mi>s</mml:mi>
                              <mml:mo>¯</mml:mo>
                            </mml:mover>
                            <mml:mrow>
                              <mml:mi>i</mml:mi>
                              <mml:mo>,</mml:mo>
                              <mml:mrow>
                                <mml:msup>
                                  <mml:mn>2</mml:mn>
                                  <mml:mi>n</mml:mi>
                                </mml:msup>
                                <mml:mo>−</mml:mo>
                                <mml:mn>1</mml:mn>
                              </mml:mrow>
                            </mml:mrow>
                          </mml:msub>
                          <mml:mo lspace="0.222em" rspace="0.222em">⋅</mml:mo>
                          <mml:mrow>
                            <mml:mo>|</mml:mo>
                            <mml:mrow>
                              <mml:mn>11</mml:mn>
                              <mml:mo>⁢</mml:mo>
                              <mml:mi mathvariant="normal">⋯</mml:mi>
                              <mml:mo>⁢</mml:mo>
                              <mml:mn>1</mml:mn>
                            </mml:mrow>
                            <mml:mo>⟩</mml:mo>
                          </mml:mrow>
                        </mml:mrow>
                      </mml:mrow>
                    </mml:math>
                  </disp-formula>
                </disp-formula-group>
              </p>
              <p>where <inline-formula><mml:math alttext="\left|{00\cdots 0}\right\rangle,\left|{00\cdots 1}\right\rangle,\cdots" display="inline"><mml:mrow><mml:mrow><mml:mo>|</mml:mo><mml:mrow><mml:mn>00</mml:mn><mml:mo>⁢</mml:mo><mml:mi mathvariant="normal">⋯</mml:mi><mml:mo>⁢</mml:mo><mml:mn>0</mml:mn></mml:mrow><mml:mo>⟩</mml:mo></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mo>|</mml:mo><mml:mrow><mml:mn>00</mml:mn><mml:mo>⁢</mml:mo><mml:mi mathvariant="normal">⋯</mml:mi><mml:mo>⁢</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo>⟩</mml:mo></mml:mrow><mml:mo>,</mml:mo><mml:mi mathvariant="normal">⋯</mml:mi></mml:mrow></mml:math></inline-formula> represent the possible states of the n-qubit system.</p>
            </list-item>
            <list-item id="S4.I1.i3">
              <p id="S4.I1.i3.p1">Rewards: Select actions one by one from the head entity until reaching the real tail entity, and this action sequence is the reasoning path of the quantum policy network. Due to the large action space available to agents, there are far more incorrect action decision sequences than correct ones, and the number of incorrect decision sequences increases exponentially with the length of the reasoning path. To encourage agents to find the correct reasoning path, this paper defines the reward function of the policy network as:</p>
              <p>
                <disp-formula id="S4.E4">
                  <mml:math alttext="R_{total}^{\prime}=r_{GLOBAL}^{\prime}+r_{EFFICIENCY}^{\prime}+r_{DIVERSITY}^{\prime}" display="block">
                    <mml:mrow>
                      <mml:msubsup>
                        <mml:mi>R</mml:mi>
                        <mml:mrow>
                          <mml:mi>t</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>o</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>t</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>a</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>l</mml:mi>
                        </mml:mrow>
                        <mml:mo>′</mml:mo>
                      </mml:msubsup>
                      <mml:mo>=</mml:mo>
                      <mml:mrow>
                        <mml:msubsup>
                          <mml:mi>r</mml:mi>
                          <mml:mrow>
                            <mml:mi>G</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>L</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>O</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>B</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>A</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>L</mml:mi>
                          </mml:mrow>
                          <mml:mo>′</mml:mo>
                        </mml:msubsup>
                        <mml:mo>+</mml:mo>
                        <mml:msubsup>
                          <mml:mi>r</mml:mi>
                          <mml:mrow>
                            <mml:mi>E</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>F</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>F</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>I</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>C</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>I</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>E</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>N</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>C</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>Y</mml:mi>
                          </mml:mrow>
                          <mml:mo>′</mml:mo>
                        </mml:msubsup>
                        <mml:mo>+</mml:mo>
                        <mml:msubsup>
                          <mml:mi>r</mml:mi>
                          <mml:mrow>
                            <mml:mi>D</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>I</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>V</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>E</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>R</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>S</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>I</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>T</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>Y</mml:mi>
                          </mml:mrow>
                          <mml:mo>′</mml:mo>
                        </mml:msubsup>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:math>
                </disp-formula>
              </p>
              <p>where <inline-formula><mml:math alttext="r_{GLOBAL}^{\prime}" display="inline"><mml:msubsup><mml:mi>r</mml:mi><mml:mrow><mml:mi>G</mml:mi><mml:mo>⁢</mml:mo><mml:mi>L</mml:mi><mml:mo>⁢</mml:mo><mml:mi>O</mml:mi><mml:mo>⁢</mml:mo><mml:mi>B</mml:mi><mml:mo>⁢</mml:mo><mml:mi>A</mml:mi><mml:mo>⁢</mml:mo><mml:mi>L</mml:mi></mml:mrow><mml:mo>′</mml:mo></mml:msubsup></mml:math></inline-formula> represents the overall reward, which can be expressed by the following formula:</p>
              <p>
                <disp-formula id="S4.E5">
                  <mml:math alttext="r_{GLOBAL^{\prime}}=\left\{\begin{aligned} +1,&amp;ifthepathreachest_{i}\\&#10;-1,&amp;otherwise\end{aligned}\right." class="ltx_math_unparsed" display="block">
                    <mml:mrow>
                      <mml:msub>
                        <mml:mi>r</mml:mi>
                        <mml:mrow>
                          <mml:mi>G</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>L</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>O</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>B</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>A</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:msup>
                            <mml:mi>L</mml:mi>
                            <mml:mo>′</mml:mo>
                          </mml:msup>
                        </mml:mrow>
                      </mml:msub>
                      <mml:mo>=</mml:mo>
                      <mml:mrow>
                        <mml:mo>{</mml:mo>
                        <mml:mtable columnspacing="0pt" displaystyle="true" rowspacing="6.0pt">
                          <mml:mtr>
                            <mml:mtd class="ltx_align_right" columnalign="right">
                              <mml:mrow>
                                <mml:mrow>
                                  <mml:mo>+</mml:mo>
                                  <mml:mn>1</mml:mn>
                                </mml:mrow>
                                <mml:mo>,</mml:mo>
                              </mml:mrow>
                            </mml:mtd>
                            <mml:mtd class="ltx_align_left" columnalign="left">
                              <mml:mrow>
                                <mml:mi>i</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>f</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>t</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>h</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>e</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>p</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>a</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>t</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>h</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>r</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>e</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>a</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>c</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>h</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>e</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>s</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:msub>
                                  <mml:mi>t</mml:mi>
                                  <mml:mi>i</mml:mi>
                                </mml:msub>
                              </mml:mrow>
                            </mml:mtd>
                          </mml:mtr>
                          <mml:mtr>
                            <mml:mtd class="ltx_align_right" columnalign="right">
                              <mml:mrow>
                                <mml:mrow>
                                  <mml:mo>−</mml:mo>
                                  <mml:mn>1</mml:mn>
                                </mml:mrow>
                                <mml:mo>,</mml:mo>
                              </mml:mrow>
                            </mml:mtd>
                            <mml:mtd class="ltx_align_left" columnalign="left">
                              <mml:mrow>
                                <mml:mi>o</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>t</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>h</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>e</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>r</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>w</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>i</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>s</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>e</mml:mi>
                              </mml:mrow>
                            </mml:mtd>
                          </mml:mtr>
                        </mml:mtable>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:math>
                </disp-formula>
              </p>
              <p>if the agent reaches the real tail entity after selecting a series of actions, it will receive a positive reward +l; otherwise, it will receive a negative reward -1. The length of the reasoning path also has a significant impact on the reasoning results. As the path length increases, the accuracy and reliability of the information decrease, accompanied by cumulative errors. Therefore, shorter reasoning paths are generally more reliable than longer ones. This paper reduces path length and improves reasoning efficiency by limiting the interaction length between the agent and the environment. The definition of the efficiency reward function is as follows:</p>
              <p>
                <disp-formula id="S4.E6">
                  <mml:math alttext="r_{EFFICIENCY^{\prime}}=\frac{1}{{length\left(p\right)}}" display="block">
                    <mml:mrow>
                      <mml:msub>
                        <mml:mi>r</mml:mi>
                        <mml:mrow>
                          <mml:mi>E</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>F</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>F</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>I</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>C</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>I</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>E</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>N</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>C</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:msup>
                            <mml:mi>Y</mml:mi>
                            <mml:mo>′</mml:mo>
                          </mml:msup>
                        </mml:mrow>
                      </mml:msub>
                      <mml:mo>=</mml:mo>
                      <mml:mfrac>
                        <mml:mn>1</mml:mn>
                        <mml:mrow>
                          <mml:mi>l</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>e</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>n</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>g</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>t</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>h</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mrow>
                            <mml:mo>(</mml:mo>
                            <mml:mi>p</mml:mi>
                            <mml:mo>)</mml:mo>
                          </mml:mrow>
                        </mml:mrow>
                      </mml:mfrac>
                    </mml:mrow>
                  </mml:math>
                </disp-formula>
              </p>
              <p>where <inline-formula><mml:math alttext="P:{r_{1}}{r_{2}}\cdots{r_{n}}" display="inline"><mml:mrow><mml:mi>P</mml:mi><mml:mo lspace="0.278em" rspace="0.278em">:</mml:mo><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo>⁢</mml:mo><mml:mi mathvariant="normal">⋯</mml:mi><mml:mo>⁢</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mi>n</mml:mi></mml:msub></mml:mrow></mml:mrow></mml:math></inline-formula> represents the reasoning paths. The agent search for reasoning paths by learning normal samples, which have similar representations in vector space. This makes the agent more inclined to search for reasoning paths with similar semantics, which often contain redundant information. To enable the agent to find different paths as much as possible, this paper defines the path diversity reward function as follows:</p>
              <p>
                <disp-formula id="S4.E7">
                  <mml:math alttext="r_{DIVERSITY^{\prime}}=-\frac{1}{{\left|F\right|}}\sum\limits_{i=1}^{\left|F%&#10;\right|}{\cos\left({p,{p_{i}}}\right)}" display="block">
                    <mml:mrow>
                      <mml:msub>
                        <mml:mi>r</mml:mi>
                        <mml:mrow>
                          <mml:mi>D</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>I</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>V</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>E</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>R</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>S</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>I</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>T</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:msup>
                            <mml:mi>Y</mml:mi>
                            <mml:mo>′</mml:mo>
                          </mml:msup>
                        </mml:mrow>
                      </mml:msub>
                      <mml:mo>=</mml:mo>
                      <mml:mrow>
                        <mml:mo>−</mml:mo>
                        <mml:mrow>
                          <mml:mfrac>
                            <mml:mn>1</mml:mn>
                            <mml:mrow>
                              <mml:mo>|</mml:mo>
                              <mml:mi>F</mml:mi>
                              <mml:mo>|</mml:mo>
                            </mml:mrow>
                          </mml:mfrac>
                          <mml:mo>⁢</mml:mo>
                          <mml:mrow>
                            <mml:munderover>
                              <mml:mo movablelimits="false">∑</mml:mo>
                              <mml:mrow>
                                <mml:mi>i</mml:mi>
                                <mml:mo>=</mml:mo>
                                <mml:mn>1</mml:mn>
                              </mml:mrow>
                              <mml:mrow>
                                <mml:mo>|</mml:mo>
                                <mml:mi>F</mml:mi>
                                <mml:mo>|</mml:mo>
                              </mml:mrow>
                            </mml:munderover>
                            <mml:mrow>
                              <mml:mi>cos</mml:mi>
                              <mml:mo>⁡</mml:mo>
                              <mml:mrow>
                                <mml:mo>(</mml:mo>
                                <mml:mi>p</mml:mi>
                                <mml:mo>,</mml:mo>
                                <mml:msub>
                                  <mml:mi>p</mml:mi>
                                  <mml:mi>i</mml:mi>
                                </mml:msub>
                                <mml:mo>)</mml:mo>
                              </mml:mrow>
                            </mml:mrow>
                          </mml:mrow>
                        </mml:mrow>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:math>
                </disp-formula>
              </p>
              <p>where <inline-formula><mml:math alttext="p=\sum\nolimits_{i=1}^{l}{{r_{i}}}" display="inline"><mml:mrow><mml:mi>p</mml:mi><mml:mo rspace="0.111em">=</mml:mo><mml:mrow><mml:msubsup><mml:mo>∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mi>l</mml:mi></mml:msubsup><mml:msub><mml:mi>r</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mrow></mml:math></inline-formula> represents the path embedding of the reasoning path <inline-formula><mml:math alttext="P" display="inline"><mml:mi>P</mml:mi></mml:math></inline-formula>, and <inline-formula><mml:math alttext="F" display="inline"><mml:mi>F</mml:mi></mml:math></inline-formula> represents the total number of reasoning paths. The strategy network updates the parameters of quantum circuit by constantly interacting with the environment.</p>
            </list-item>
            <list-item id="S4.I1.i4">
              <p id="S4.I1.i4.p1">Policy network: This paper trains a quantum policy function <inline-formula><mml:math alttext="\pi\left({r\left|{\xi\left({{s_{i}}}\right);w}\right.}\right)=p\left({r|{s_{i}%&#10;};w}\right)" display="inline"><mml:mrow><mml:mrow><mml:mi>π</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>r</mml:mi><mml:mo fence="false" stretchy="true">|</mml:mo><mml:mrow><mml:mrow><mml:mi>ξ</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>s</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>;</mml:mo><mml:mi>w</mml:mi></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>r</mml:mi><mml:mo fence="false">|</mml:mo><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>;</mml:mo><mml:mi>w</mml:mi></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mrow></mml:math></inline-formula> based on the quantum circuit, where <inline-formula><mml:math alttext="w" display="inline"><mml:mi>w</mml:mi></mml:math></inline-formula> represents the parameters of the quantum circuit, <inline-formula><mml:math alttext="\xi\left({{s_{i}}}\right)" display="inline"><mml:mrow><mml:mi>ξ</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>s</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> represents the quantum amplitude encoding of the state <inline-formula><mml:math alttext="{s_{i}}" display="inline"><mml:msub><mml:mi>s</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>, and <inline-formula><mml:math alttext="\pi\left({r\left|{\xi\left({{s_{i}}}\right);w}\right.}\right)" display="inline"><mml:mrow><mml:mi>π</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>r</mml:mi><mml:mo fence="false" stretchy="true">|</mml:mo><mml:mrow><mml:mrow><mml:mi>ξ</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>s</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>;</mml:mo><mml:mi>w</mml:mi></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> represents the probability of selecting the action <inline-formula><mml:math alttext="r" display="inline"><mml:mi>r</mml:mi></mml:math></inline-formula> in state <inline-formula><mml:math alttext="{s_{i}}" display="inline"><mml:msub><mml:mi>s</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> when the parameters of the quantum circuit are <inline-formula><mml:math alttext="w" display="inline"><mml:mi>w</mml:mi></mml:math></inline-formula>. The quantum strategy network constantly interacts with the external environment, updating the parameters of the quantum circuit under the constraint of the reward function to find the optimal reasoning paths.</p>
            </list-item>
          </list>
        </p>
        <p>
          <fig id="F1">
            <label>Figure 1.</label>
            <caption>
              <p>Mimic octopus.</p>
            </caption>
            <graphic xlink:href="figures/fig1.jpg"/>
          </fig>
        </p>
        <p id="S4.SS1.p3">When training the policy network using the QIRL method, the current environmental state <inline-formula><mml:math alttext="s" display="inline"><mml:mi>s</mml:mi></mml:math></inline-formula> is first input into the quantum policy network and quantum encoded to initialize the input state of the quantum circuit. After quantum computing, measure the probability distribution of actions, select the action with the highest probability as the next action <inline-formula><mml:math alttext="r" display="inline"><mml:mi>r</mml:mi></mml:math></inline-formula>, and update the environmental state to <inline-formula><mml:math alttext="{s^{\prime}}" display="inline"><mml:msup><mml:mi>s</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:math></inline-formula>. The reward function calculates the reward value <inline-formula><mml:math alttext="{R^{\prime}}" display="inline"><mml:msup><mml:mi>R</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:math></inline-formula> based on the current environmental state and inputs it together with <inline-formula><mml:math alttext="{s^{\prime}}" display="inline"><mml:msup><mml:mi>s</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:math></inline-formula> into the optimizer of the quantum strategy network to update the quantum circuit parameters <inline-formula><mml:math alttext="w" display="inline"><mml:mi>w</mml:mi></mml:math></inline-formula>. After training, the quantum strategy network generates reasoning paths as logical rules for entity reasoning to reason about missing entities. The flow of the QIRL method is illustrated in Figure <xref ref-type="fig" rid="F1">1</xref>.</p>
      </sec>
      <sec id="S4.SS2">
        <label>4.2</label>
        <title>Strategy Network Training</title>
        <p id="S4.SS2.p1">For each entity pair <inline-formula><mml:math alttext="\left({{h_{i}},{t_{i}}}\right)" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, a random breadth first search (BFS) is used to find all paths between the entity pairs. This paper introduces a random mechanism in the BFS algorithm, which randomly selects an intermediate node instead of directly searching for paths between the head entity <inline-formula><mml:math alttext="{h_{i}}" display="inline"><mml:msub><mml:mi>h</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> and tail entity <inline-formula><mml:math alttext="{t_{i}}" display="inline"><mml:msub><mml:mi>t</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>. Then perform two BFS between <inline-formula><mml:math alttext="\left({{h_{i}},inte{r_{\mathop{\rm i}\nolimits}}}\right)" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>n</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mo>i</mml:mo></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math alttext="\left({inte{r_{\mathop{\rm i}\nolimits}},{t_{i}}}\right)" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>n</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mo>i</mml:mo></mml:msub></mml:mrow><mml:mo>,</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> to search for the correct paths faster and improve the convergence speed of the model. For entity pairs <inline-formula><mml:math alttext="\left({h,t}\right)" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, randomly select the inter mediate entity <inline-formula><mml:math alttext="inter" display="inline"><mml:mrow><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>n</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>r</mml:mi></mml:mrow></mml:math></inline-formula> and perform BFS between <inline-formula><mml:math alttext="\left({h,inter}\right)" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>,</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>n</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>r</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math alttext="\left({inter,t}\right)" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>n</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>r</mml:mi></mml:mrow><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> to find paths. Entities are usually associated with multiple different relationships. Assuming that the head entity <inline-formula><mml:math alttext="h" display="inline"><mml:mi>h</mml:mi></mml:math></inline-formula> connected to the new entity <inline-formula><mml:math alttext="{e_{1}}" display="inline"><mml:msub><mml:mi>e</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:math></inline-formula> through the relationship <inline-formula><mml:math alttext="{r_{1}}" display="inline"><mml:msub><mml:mi>r</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:math></inline-formula>, and then <inline-formula><mml:math alttext="{e_{1}}" display="inline"><mml:msub><mml:mi>e</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:math></inline-formula> connected to the entity <inline-formula><mml:math alttext="inter" display="inline"><mml:mrow><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>n</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>r</mml:mi></mml:mrow></mml:math></inline-formula> through the relationship <inline-formula><mml:math alttext="{r_{2}}" display="inline"><mml:msub><mml:mi>r</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula>, a reasoning path <inline-formula><mml:math alttext="{r_{1}}\to{r_{2}}" display="inline"><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo stretchy="false">→</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> is obtained. <inline-formula><mml:math alttext="inter" display="inline"><mml:mrow><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>n</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>r</mml:mi></mml:mrow></mml:math></inline-formula> connected to the new entity <inline-formula><mml:math alttext="{e_{2}}" display="inline"><mml:msub><mml:mi>e</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula> through relationship <inline-formula><mml:math alttext="{r_{3}}" display="inline"><mml:msub><mml:mi>r</mml:mi><mml:mn>3</mml:mn></mml:msub></mml:math></inline-formula>, and <inline-formula><mml:math alttext="{e_{2}}" display="inline"><mml:msub><mml:mi>e</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula> is connected to the tail entity <inline-formula><mml:math alttext="t" display="inline"><mml:mi>t</mml:mi></mml:math></inline-formula> through relationship <inline-formula><mml:math alttext="{r_{4}}" display="inline"><mml:msub><mml:mi>r</mml:mi><mml:mn>4</mml:mn></mml:msub></mml:math></inline-formula>. Therefore, the reasoning path is <inline-formula><mml:math alttext="{r_{3}}\to{r_{4}}" display="inline"><mml:mrow><mml:msub><mml:mi>r</mml:mi><mml:mn>3</mml:mn></mml:msub><mml:mo stretchy="false">→</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mn>4</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>. Combining the two reasoning paths together, the final reasoning path between <inline-formula><mml:math alttext="\left({h,t}\right)" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is <inline-formula><mml:math alttext="P={r_{1}}\to{r_{2}}\to{r_{3}}\to{r_{4}}" display="inline"><mml:mrow><mml:mi>P</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo stretchy="false">→</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo stretchy="false">→</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mn>3</mml:mn></mml:msub><mml:mo stretchy="false">→</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mn>4</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>.</p>
        <p id="S4.SS2.p2">This paper conducts supervised training on the quantum policy network of QIRL method based on the paths between entity pairs searched by random BFS method. The quantum strategy network maximizes the expected cumulative reward by continuously updating the parameters of the quantum circuit <inline-formula><mml:math alttext="w" display="inline"><mml:mi>w</mml:mi></mml:math></inline-formula>. The expected cumulative reward <inline-formula><mml:math alttext="J\left(w\right)" display="inline"><mml:mrow><mml:mi>J</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mi>w</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> is expressed as follows:</p>
        <p>
          <disp-formula id="S4.E8">
            <mml:math alttext="J\left(w\right)=\sum\limits_{i}{\sum\limits_{r\in R}{\pi\left({r\left|{\xi%&#10;\left({{s_{i}}}\right);w}\right.}\right)R_{{s_{i}},{r_{i}}}^{\prime}}}" display="block">
              <mml:mrow>
                <mml:mrow>
                  <mml:mi>J</mml:mi>
                  <mml:mo>⁢</mml:mo>
                  <mml:mrow>
                    <mml:mo>(</mml:mo>
                    <mml:mi>w</mml:mi>
                    <mml:mo>)</mml:mo>
                  </mml:mrow>
                </mml:mrow>
                <mml:mo rspace="0.111em">=</mml:mo>
                <mml:mrow>
                  <mml:munder>
                    <mml:mo movablelimits="false" rspace="0em">∑</mml:mo>
                    <mml:mi>i</mml:mi>
                  </mml:munder>
                  <mml:mrow>
                    <mml:munder>
                      <mml:mo movablelimits="false">∑</mml:mo>
                      <mml:mrow>
                        <mml:mi>r</mml:mi>
                        <mml:mo>∈</mml:mo>
                        <mml:mi>R</mml:mi>
                      </mml:mrow>
                    </mml:munder>
                    <mml:mrow>
                      <mml:mi>π</mml:mi>
                      <mml:mo>⁢</mml:mo>
                      <mml:mrow>
                        <mml:mo>(</mml:mo>
                        <mml:mrow>
                          <mml:mi>r</mml:mi>
                          <mml:mo fence="false" stretchy="true">|</mml:mo>
                          <mml:mrow>
                            <mml:mrow>
                              <mml:mi>ξ</mml:mi>
                              <mml:mo>⁢</mml:mo>
                              <mml:mrow>
                                <mml:mo>(</mml:mo>
                                <mml:msub>
                                  <mml:mi>s</mml:mi>
                                  <mml:mi>i</mml:mi>
                                </mml:msub>
                                <mml:mo>)</mml:mo>
                              </mml:mrow>
                            </mml:mrow>
                            <mml:mo>;</mml:mo>
                            <mml:mi>w</mml:mi>
                          </mml:mrow>
                        </mml:mrow>
                        <mml:mo>)</mml:mo>
                      </mml:mrow>
                      <mml:mo>⁢</mml:mo>
                      <mml:msubsup>
                        <mml:mi>R</mml:mi>
                        <mml:mrow>
                          <mml:msub>
                            <mml:mi>s</mml:mi>
                            <mml:mi>i</mml:mi>
                          </mml:msub>
                          <mml:mo>,</mml:mo>
                          <mml:msub>
                            <mml:mi>r</mml:mi>
                            <mml:mi>i</mml:mi>
                          </mml:msub>
                        </mml:mrow>
                        <mml:mo>′</mml:mo>
                      </mml:msubsup>
                    </mml:mrow>
                  </mml:mrow>
                </mml:mrow>
              </mml:mrow>
            </mml:math>
          </disp-formula>
        </p>
        <p>where <inline-formula><mml:math alttext="R_{{s_{i}},{r_{i}}}^{\prime}" display="inline"><mml:msubsup><mml:mi>R</mml:mi><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mo>′</mml:mo></mml:msubsup></mml:math></inline-formula> represents the reward value obtained by selecting action <inline-formula><mml:math alttext="{r_{i}}" display="inline"><mml:msub><mml:mi>r</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> in state <inline-formula><mml:math alttext="{s_{i}}" display="inline"><mml:msub><mml:mi>s</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>. For each supervised path, the agent receives a reward of +1 for each successful search and updates the quantum circuit parameters using the approximate gradient of the Monte Carlo strategy gradient:</p>
        <p>
          <disp-formula-group id="S7.EGx2">
            <disp-formula id="S4.E9">
              <mml:math alttext="\displaystyle{\nabla_{w}}J\left(w\right)=\sum\limits_{i}{\sum\limits_{r\in A}{%&#10;\pi\left({r\left|{\xi\left({{s_{i}}}\right);w}\right.}\right){\nabla_{w}}\log%&#10;\pi\left({r\left|{\xi\left({{s_{i}}}\right);w}\right.}\right)}}" display="inline">
                <mml:mrow>
                  <mml:mrow>
                    <mml:mrow>
                      <mml:msub>
                        <mml:mo>∇</mml:mo>
                        <mml:mi>w</mml:mi>
                      </mml:msub>
                      <mml:mi>J</mml:mi>
                    </mml:mrow>
                    <mml:mo>⁢</mml:mo>
                    <mml:mrow>
                      <mml:mo>(</mml:mo>
                      <mml:mi>w</mml:mi>
                      <mml:mo>)</mml:mo>
                    </mml:mrow>
                  </mml:mrow>
                  <mml:mo>=</mml:mo>
                  <mml:mrow>
                    <mml:mstyle displaystyle="true">
                      <mml:munder>
                        <mml:mo movablelimits="false">∑</mml:mo>
                        <mml:mi>i</mml:mi>
                      </mml:munder>
                    </mml:mstyle>
                    <mml:mrow>
                      <mml:mstyle displaystyle="true">
                        <mml:munder>
                          <mml:mo movablelimits="false">∑</mml:mo>
                          <mml:mrow>
                            <mml:mi>r</mml:mi>
                            <mml:mo>∈</mml:mo>
                            <mml:mi>A</mml:mi>
                          </mml:mrow>
                        </mml:munder>
                      </mml:mstyle>
                      <mml:mrow>
                        <mml:mi>π</mml:mi>
                        <mml:mo>⁢</mml:mo>
                        <mml:mrow>
                          <mml:mo>(</mml:mo>
                          <mml:mrow>
                            <mml:mi>r</mml:mi>
                            <mml:mo fence="false" stretchy="true">|</mml:mo>
                            <mml:mrow>
                              <mml:mrow>
                                <mml:mi>ξ</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mrow>
                                  <mml:mo>(</mml:mo>
                                  <mml:msub>
                                    <mml:mi>s</mml:mi>
                                    <mml:mi>i</mml:mi>
                                  </mml:msub>
                                  <mml:mo>)</mml:mo>
                                </mml:mrow>
                              </mml:mrow>
                              <mml:mo>;</mml:mo>
                              <mml:mi>w</mml:mi>
                            </mml:mrow>
                          </mml:mrow>
                          <mml:mo>)</mml:mo>
                        </mml:mrow>
                        <mml:mo lspace="0.167em">⁢</mml:mo>
                        <mml:mrow>
                          <mml:mrow>
                            <mml:msub>
                              <mml:mo rspace="0.167em">∇</mml:mo>
                              <mml:mi>w</mml:mi>
                            </mml:msub>
                            <mml:mi>log</mml:mi>
                          </mml:mrow>
                          <mml:mo lspace="0.167em">⁡</mml:mo>
                          <mml:mi>π</mml:mi>
                        </mml:mrow>
                        <mml:mo>⁢</mml:mo>
                        <mml:mrow>
                          <mml:mo>(</mml:mo>
                          <mml:mrow>
                            <mml:mi>r</mml:mi>
                            <mml:mo fence="false" stretchy="true">|</mml:mo>
                            <mml:mrow>
                              <mml:mrow>
                                <mml:mi>ξ</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mrow>
                                  <mml:mo>(</mml:mo>
                                  <mml:msub>
                                    <mml:mi>s</mml:mi>
                                    <mml:mi>i</mml:mi>
                                  </mml:msub>
                                  <mml:mo>)</mml:mo>
                                </mml:mrow>
                              </mml:mrow>
                              <mml:mo>;</mml:mo>
                              <mml:mi>w</mml:mi>
                            </mml:mrow>
                          </mml:mrow>
                          <mml:mo>)</mml:mo>
                        </mml:mrow>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:mrow>
                </mml:mrow>
              </mml:math>
            </disp-formula>
            <disp-formula id="S4.Ex2">
              <mml:math alttext="\displaystyle={\nabla_{w}}\sum\limits_{i}{\log\pi\left({r={r_{i}}\left|{\xi%&#10;\left({{s_{i}}}\right);w}\right.}\right)}" display="inline">
                <mml:mrow>
                  <mml:mi/>
                  <mml:mo>=</mml:mo>
                  <mml:mrow>
                    <mml:msub>
                      <mml:mo>∇</mml:mo>
                      <mml:mi>w</mml:mi>
                    </mml:msub>
                    <mml:mo lspace="0.167em">⁢</mml:mo>
                    <mml:mrow>
                      <mml:mstyle displaystyle="true">
                        <mml:munder>
                          <mml:mo movablelimits="false">∑</mml:mo>
                          <mml:mi>i</mml:mi>
                        </mml:munder>
                      </mml:mstyle>
                      <mml:mrow>
                        <mml:mrow>
                          <mml:mi>log</mml:mi>
                          <mml:mo lspace="0.167em">⁡</mml:mo>
                          <mml:mi>π</mml:mi>
                        </mml:mrow>
                        <mml:mo>⁢</mml:mo>
                        <mml:mrow>
                          <mml:mo>(</mml:mo>
                          <mml:mrow>
                            <mml:mi>r</mml:mi>
                            <mml:mo>=</mml:mo>
                            <mml:mrow>
                              <mml:msub>
                                <mml:mi>r</mml:mi>
                                <mml:mi>i</mml:mi>
                              </mml:msub>
                              <mml:mo fence="false" stretchy="true">|</mml:mo>
                              <mml:mrow>
                                <mml:mrow>
                                  <mml:mi>ξ</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mrow>
                                    <mml:mo>(</mml:mo>
                                    <mml:msub>
                                      <mml:mi>s</mml:mi>
                                      <mml:mi>i</mml:mi>
                                    </mml:msub>
                                    <mml:mo>)</mml:mo>
                                  </mml:mrow>
                                </mml:mrow>
                                <mml:mo>;</mml:mo>
                                <mml:mi>w</mml:mi>
                              </mml:mrow>
                            </mml:mrow>
                          </mml:mrow>
                          <mml:mo>)</mml:mo>
                        </mml:mrow>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:mrow>
                </mml:mrow>
              </mml:math>
            </disp-formula>
          </disp-formula-group>
        </p>
        <p>where <inline-formula><mml:math alttext="{r_{i}}" display="inline"><mml:msub><mml:mi>r</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> belongs to path <inline-formula><mml:math alttext="P" display="inline"><mml:mi>P</mml:mi></mml:math></inline-formula>, which represents the action with the highest probability of the quantum circuit output in step <inline-formula><mml:math alttext="i" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula>.</p>
        <p id="S4.SS2.p3">In the pretraining process of the quantum strategy network mentioned above, the reasoning paths obtained often contain a large amount of redundant information and similar paths. To improve reasoning efficiency, this paper retrains the quantum policy network using a reward function to find a more efficient reasoning path controlled by the reward function. For each entity pair <inline-formula><mml:math alttext="\left({{h_{i}},{t_{i}}}\right)" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, the agent selects an action from the head entity <inline-formula><mml:math alttext="{h_{i}}" display="inline"><mml:msub><mml:mi>h</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> based on the output value of the quantum policy function <inline-formula><mml:math alttext="\pi\left({r\left|{\xi\left({{s_{i}}}\right);w}\right.}\right)" display="inline"><mml:mrow><mml:mi>π</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>r</mml:mi><mml:mo fence="false" stretchy="true">|</mml:mo><mml:mrow><mml:mrow><mml:mi>ξ</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>s</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>;</mml:mo><mml:mi>w</mml:mi></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> to expand the reasoning paths. If the selected action cannot connect to any entity, the agent receives a negative reward and remains in its original state. Since agents follow the quantum policy function to extend the reasoning paths, they will not get stuck due to repeating incorrect steps. This paper improves training efficiency by limiting the maximum length of the reasoning paths. If the agent finds the correct tail entity <inline-formula><mml:math alttext="{t_{i}}" display="inline"><mml:msub><mml:mi>t</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> within the maximum path length, a new reasoning path is generated. Conversely, if the agent fails to locate the correct tail entity <inline-formula><mml:math alttext="{t_{i}}" display="inline"><mml:msub><mml:mi>t</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> within the constrained path length, the current training iteration is terminated. The gradient function of the quantum strategy network during the retraining process is as follows:</p>
        <p>
          <disp-formula id="S4.E10">
            <mml:math alttext="{\nabla_{w}}J\left(w\right)={\nabla_{w}}\sum\limits_{i}{\log\pi\left({r={r_{i}%&#10;}\left|{\xi\left({{s_{i}}}\right);w}\right.}\right)R_{total}^{\prime}}" display="block">
              <mml:mrow>
                <mml:mrow>
                  <mml:mrow>
                    <mml:msub>
                      <mml:mo>∇</mml:mo>
                      <mml:mi>w</mml:mi>
                    </mml:msub>
                    <mml:mi>J</mml:mi>
                  </mml:mrow>
                  <mml:mo>⁢</mml:mo>
                  <mml:mrow>
                    <mml:mo>(</mml:mo>
                    <mml:mi>w</mml:mi>
                    <mml:mo>)</mml:mo>
                  </mml:mrow>
                </mml:mrow>
                <mml:mo>=</mml:mo>
                <mml:mrow>
                  <mml:msub>
                    <mml:mo>∇</mml:mo>
                    <mml:mi>w</mml:mi>
                  </mml:msub>
                  <mml:mo>⁢</mml:mo>
                  <mml:mrow>
                    <mml:munder>
                      <mml:mo movablelimits="false">∑</mml:mo>
                      <mml:mi>i</mml:mi>
                    </mml:munder>
                    <mml:mrow>
                      <mml:mrow>
                        <mml:mi>log</mml:mi>
                        <mml:mo lspace="0.167em">⁡</mml:mo>
                        <mml:mi>π</mml:mi>
                      </mml:mrow>
                      <mml:mo>⁢</mml:mo>
                      <mml:mrow>
                        <mml:mo>(</mml:mo>
                        <mml:mrow>
                          <mml:mi>r</mml:mi>
                          <mml:mo>=</mml:mo>
                          <mml:mrow>
                            <mml:msub>
                              <mml:mi>r</mml:mi>
                              <mml:mi>i</mml:mi>
                            </mml:msub>
                            <mml:mo fence="false" stretchy="true">|</mml:mo>
                            <mml:mrow>
                              <mml:mrow>
                                <mml:mi>ξ</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mrow>
                                  <mml:mo>(</mml:mo>
                                  <mml:msub>
                                    <mml:mi>s</mml:mi>
                                    <mml:mi>i</mml:mi>
                                  </mml:msub>
                                  <mml:mo>)</mml:mo>
                                </mml:mrow>
                              </mml:mrow>
                              <mml:mo>;</mml:mo>
                              <mml:mi>w</mml:mi>
                            </mml:mrow>
                          </mml:mrow>
                        </mml:mrow>
                        <mml:mo>)</mml:mo>
                      </mml:mrow>
                      <mml:mo>⁢</mml:mo>
                      <mml:msubsup>
                        <mml:mi>R</mml:mi>
                        <mml:mrow>
                          <mml:mi>t</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>o</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>t</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>a</mml:mi>
                          <mml:mo>⁢</mml:mo>
                          <mml:mi>l</mml:mi>
                        </mml:mrow>
                        <mml:mo>′</mml:mo>
                      </mml:msubsup>
                    </mml:mrow>
                  </mml:mrow>
                </mml:mrow>
              </mml:mrow>
            </mml:math>
          </disp-formula>
        </p>
        <p id="S4.SS2.p4">The retraining process of the model is shown in Algorithm <xref rid="algorithm1">1</xref>, where <inline-formula><mml:math alttext="w" display="inline"><mml:mi>w</mml:mi></mml:math></inline-formula> is the parameters of the quantum circuit, <inline-formula><mml:math alttext="\xi(s_{t})" display="inline"><mml:mrow><mml:mi>ξ</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>s</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula> is the quantum amplitude encoding of the input state <inline-formula><mml:math alttext="{s_{t}}" display="inline"><mml:msub><mml:mi>s</mml:mi><mml:mi>t</mml:mi></mml:msub></mml:math></inline-formula>, and <inline-formula><mml:math alttext="M_{n}eg" display="inline"><mml:mrow><mml:msub><mml:mi>M</mml:mi><mml:mi>n</mml:mi></mml:msub><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>g</mml:mi></mml:mrow></mml:math></inline-formula> represents the set of negative steps.</p>
      </sec>
      <sec id="S4.SS3">
        <label>4.3</label>
        <title>Entity Reasoning</title>
        <p id="S4.SS3.p1">Entity reasoning refers to reasoning about missing entity information from known entities and their relationships through the relationships or attributes between entities in a KG. Due to the large number of complex relationships between entities in KGs, conducting path searches one by one will result in high time costs. The bidirectional path constrained search algorithm [<xref rid="ref018" ref-type="bibr">18</xref>] is an efficient path search algorithm that can simultaneously search for paths from both positive and negative directions, significantly reducing the number of search paths. Therefore, this paper adopts a bidirectional path constrained search algorithm to search for paths between entity pairs, significantly reducing the search space and improving the efficiency of path search.</p>
        <p id="S4.SS3.p2">For an entity pair <inline-formula><mml:math alttext="\left({h,t}\right)" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, the reasoning path <inline-formula><mml:math alttext="{P^{\prime}}" display="inline"><mml:msup><mml:mi>P</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:math></inline-formula> trained by the QIRL method is used as a logical formula, starting from the head entity <inline-formula><mml:math alttext="h" display="inline"><mml:mi>h</mml:mi></mml:math></inline-formula> and tail entity <inline-formula><mml:math alttext="t" display="inline"><mml:mi>t</mml:mi></mml:math></inline-formula> respectively, and gradually expanding the reasoning paths through a bidirectional path constraint search algorithm. If the intersection of the path entities in both directions of the bidirectional path constraint search algorithm is not empty, the true tail entity can be successfully found based on the reasoning path <inline-formula><mml:math alttext="{P^{\prime}}" display="inline"><mml:msup><mml:mi>P</mml:mi><mml:mo>′</mml:mo></mml:msup></mml:math></inline-formula>. Otherwise, the tail entity cannot be successfully reasoned.</p>
        <boxed-text id="algorithm1">
          <label>Algorithm 1</label>
          <caption>
            <p>Retraining the policy function</p>
          </caption>
          <list>
            <list-item>
              <p/>
            </list-item>
            <list-item>
              <p>
                <bold>Data:</bold>
                <inline-formula>
                  <mml:math alttext="w" display="inline">
                    <mml:mi>w</mml:mi>
                  </mml:math>
                </inline-formula>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold>for episode &lt; <inline-formula><mml:math alttext="N" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula> do </bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> Initialize state vector </bold>
                <inline-formula>
                  <mml:math alttext="s_{i}\leftarrow s_{0}" display="inline">
                    <mml:mrow>
                      <mml:msub>
                        <mml:mi>s</mml:mi>
                        <mml:mi>i</mml:mi>
                      </mml:msub>
                      <mml:mo stretchy="false">←</mml:mo>
                      <mml:msub>
                        <mml:mi>s</mml:mi>
                        <mml:mn>0</mml:mn>
                      </mml:msub>
                    </mml:mrow>
                  </mml:math>
                </inline-formula>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> Initialize episode length </bold>
                <inline-formula>
                  <mml:math alttext="steps\leftarrow 0" display="inline">
                    <mml:mrow>
                      <mml:mrow>
                        <mml:mi>s</mml:mi>
                        <mml:mo>⁢</mml:mo>
                        <mml:mi>t</mml:mi>
                        <mml:mo>⁢</mml:mo>
                        <mml:mi>e</mml:mi>
                        <mml:mo>⁢</mml:mo>
                        <mml:mi>p</mml:mi>
                        <mml:mo>⁢</mml:mo>
                        <mml:mi>s</mml:mi>
                      </mml:mrow>
                      <mml:mo stretchy="false">←</mml:mo>
                      <mml:mn>0</mml:mn>
                    </mml:mrow>
                  </mml:math>
                </inline-formula>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> encode </bold>
                <inline-formula>
                  <mml:math alttext="s_{i}" display="inline">
                    <mml:msub>
                      <mml:mi>s</mml:mi>
                      <mml:mi>i</mml:mi>
                    </mml:msub>
                  </mml:math>
                </inline-formula>
                <bold> with Amplitude Encoding </bold>
                <inline-formula>
                  <mml:math alttext="\xi(s_{i})" display="inline">
                    <mml:mrow>
                      <mml:mi>ξ</mml:mi>
                      <mml:mo>⁢</mml:mo>
                      <mml:mrow>
                        <mml:mo stretchy="false">(</mml:mo>
                        <mml:msub>
                          <mml:mi>s</mml:mi>
                          <mml:mi>i</mml:mi>
                        </mml:msub>
                        <mml:mo stretchy="false">)</mml:mo>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:math>
                </inline-formula>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> while </bold>
                <italic>steps &lt; max length</italic>
                <bold> do </bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> </bold>
                <bold> </bold>
                <bold> Probability distribution of action </bold>
                <inline-formula>
                  <mml:math alttext="r\sim\pi(r|\xi(s_{i}))" display="inline">
                    <mml:mrow>
                      <mml:mi>r</mml:mi>
                      <mml:mo>∼</mml:mo>
                      <mml:mrow>
                        <mml:mi>π</mml:mi>
                        <mml:mo>⁢</mml:mo>
                        <mml:mrow>
                          <mml:mo stretchy="false">(</mml:mo>
                          <mml:mrow>
                            <mml:mi>r</mml:mi>
                            <mml:mo fence="false">|</mml:mo>
                            <mml:mrow>
                              <mml:mi>ξ</mml:mi>
                              <mml:mo>⁢</mml:mo>
                              <mml:mrow>
                                <mml:mo stretchy="false">(</mml:mo>
                                <mml:msub>
                                  <mml:mi>s</mml:mi>
                                  <mml:mi>i</mml:mi>
                                </mml:msub>
                                <mml:mo stretchy="false">)</mml:mo>
                              </mml:mrow>
                            </mml:mrow>
                          </mml:mrow>
                          <mml:mo stretchy="false">)</mml:mo>
                        </mml:mrow>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:math>
                </inline-formula>
                <bold>;</bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> </bold>
                <bold> </bold>
                <bold> Observe reward </bold>
                <inline-formula>
                  <mml:math alttext="R^{\prime}_{i}" display="inline">
                    <mml:msubsup>
                      <mml:mi>R</mml:mi>
                      <mml:mi>i</mml:mi>
                      <mml:mo>′</mml:mo>
                    </mml:msubsup>
                  </mml:math>
                </inline-formula>
                <bold>, next state </bold>
                <inline-formula>
                  <mml:math alttext="\xi(s_{(}i+1))" class="ltx_math_unparsed" display="inline">
                    <mml:mrow>
                      <mml:mi>ξ</mml:mi>
                      <mml:mrow>
                        <mml:mo stretchy="false">(</mml:mo>
                        <mml:msub>
                          <mml:mi>s</mml:mi>
                          <mml:mo stretchy="false">(</mml:mo>
                        </mml:msub>
                        <mml:mi>i</mml:mi>
                        <mml:mo>+</mml:mo>
                        <mml:mn>1</mml:mn>
                        <mml:mo stretchy="false">)</mml:mo>
                      </mml:mrow>
                      <mml:mo stretchy="false">)</mml:mo>
                    </mml:mrow>
                  </mml:math>
                </inline-formula>
                <bold>;</bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> </bold>
                <bold> </bold>
                <bold> if </bold>
                <italic>
                  <inline-formula>
                    <mml:math alttext="R^{\prime}_{i}=-1" display="inline">
                      <mml:mrow>
                        <mml:msubsup>
                          <mml:mi>R</mml:mi>
                          <mml:mi>i</mml:mi>
                          <mml:mo>′</mml:mo>
                        </mml:msubsup>
                        <mml:mo>=</mml:mo>
                        <mml:mrow>
                          <mml:mo>−</mml:mo>
                          <mml:mn>1</mml:mn>
                        </mml:mrow>
                      </mml:mrow>
                    </mml:math>
                  </inline-formula>
                </italic>
                <bold> then </bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> </bold>
                <bold>  </bold>
                <bold> </bold>
                <bold>Save </bold>
                <inline-formula>
                  <mml:math alttext="&lt;\xi(s_{i}),r&gt;" class="ltx_math_unparsed" display="inline">
                    <mml:mrow>
                      <mml:mo>&lt;</mml:mo>
                      <mml:mi>ξ</mml:mi>
                      <mml:mrow>
                        <mml:mo stretchy="false">(</mml:mo>
                        <mml:msub>
                          <mml:mi>s</mml:mi>
                          <mml:mi>i</mml:mi>
                        </mml:msub>
                        <mml:mo stretchy="false">)</mml:mo>
                      </mml:mrow>
                      <mml:mo>,</mml:mo>
                      <mml:mi>r</mml:mi>
                      <mml:mo>&gt;</mml:mo>
                    </mml:mrow>
                  </mml:math>
                </inline-formula>
                <bold> to </bold>
                <inline-formula>
                  <mml:math alttext="M_{n}eg" display="inline">
                    <mml:mrow>
                      <mml:msub>
                        <mml:mi>M</mml:mi>
                        <mml:mi>n</mml:mi>
                      </mml:msub>
                      <mml:mo>⁢</mml:mo>
                      <mml:mi>e</mml:mi>
                      <mml:mo>⁢</mml:mo>
                      <mml:mi>g</mml:mi>
                    </mml:mrow>
                  </mml:math>
                </inline-formula>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> </bold>
                <bold> </bold>
                <bold> end if</bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> </bold>
                <bold> </bold>
                <bold>if </bold>
                <italic>success or steps=max length</italic>
                <bold> then </bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> </bold>
                <bold>  </bold>
                <bold> </bold>
                <bold>then Break</bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> </bold>
                <bold> </bold>
                <bold> end if</bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> </bold>
                <bold> </bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> end while</bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold>Increase steps</bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> Update </bold>
                <inline-formula>
                  <mml:math alttext="w" display="inline">
                    <mml:mi>w</mml:mi>
                  </mml:math>
                </inline-formula>
                <bold> using</bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold/>
                <p>
                  <disp-formula id="S4.Ex3">
                    <mml:math alttext="g\propto{\nabla_{w}}\sum\limits_{{M_{neg}}}{\log\pi\left({r={r_{i}}\left|{\xi%&#10;\left({{s_{i}}}\right);w}\right.}\right)\left({-1}\right)}" display="block">
                      <mml:mrow>
                        <mml:mi>g</mml:mi>
                        <mml:mo>∝</mml:mo>
                        <mml:mrow>
                          <mml:msub>
                            <mml:mo>∇</mml:mo>
                            <mml:mi>w</mml:mi>
                          </mml:msub>
                          <mml:mo>⁢</mml:mo>
                          <mml:mrow>
                            <mml:munder>
                              <mml:mo movablelimits="false">∑</mml:mo>
                              <mml:msub>
                                <mml:mi>M</mml:mi>
                                <mml:mrow>
                                  <mml:mi>n</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>e</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>g</mml:mi>
                                </mml:mrow>
                              </mml:msub>
                            </mml:munder>
                            <mml:mrow>
                              <mml:mrow>
                                <mml:mi>log</mml:mi>
                                <mml:mo lspace="0.167em">⁡</mml:mo>
                                <mml:mi>π</mml:mi>
                              </mml:mrow>
                              <mml:mo>⁢</mml:mo>
                              <mml:mrow>
                                <mml:mo>(</mml:mo>
                                <mml:mrow>
                                  <mml:mi>r</mml:mi>
                                  <mml:mo>=</mml:mo>
                                  <mml:mrow>
                                    <mml:msub>
                                      <mml:mi>r</mml:mi>
                                      <mml:mi>i</mml:mi>
                                    </mml:msub>
                                    <mml:mo fence="false" stretchy="true">|</mml:mo>
                                    <mml:mrow>
                                      <mml:mrow>
                                        <mml:mi>ξ</mml:mi>
                                        <mml:mo>⁢</mml:mo>
                                        <mml:mrow>
                                          <mml:mo>(</mml:mo>
                                          <mml:msub>
                                            <mml:mi>s</mml:mi>
                                            <mml:mi>i</mml:mi>
                                          </mml:msub>
                                          <mml:mo>)</mml:mo>
                                        </mml:mrow>
                                      </mml:mrow>
                                      <mml:mo>;</mml:mo>
                                      <mml:mi>w</mml:mi>
                                    </mml:mrow>
                                  </mml:mrow>
                                </mml:mrow>
                                <mml:mo>)</mml:mo>
                              </mml:mrow>
                              <mml:mo>⁢</mml:mo>
                              <mml:mrow>
                                <mml:mo>(</mml:mo>
                                <mml:mrow>
                                  <mml:mo>−</mml:mo>
                                  <mml:mn>1</mml:mn>
                                </mml:mrow>
                                <mml:mo>)</mml:mo>
                              </mml:mrow>
                            </mml:mrow>
                          </mml:mrow>
                        </mml:mrow>
                      </mml:mrow>
                    </mml:math>
                  </disp-formula>
                </p>
                <bold> If success then</bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold/>
                <p>
                  <disp-formula-group id="S7.EGx3">
                    <disp-formula id="S4.Ex4">
                      <mml:math alttext="\displaystyle R_{t}otal\leftarrow\lambda_{1}r_{GLOBAL}+\lambda_{2}r_{EFFICIENCY}" display="inline">
                        <mml:mrow>
                          <mml:mrow>
                            <mml:msub>
                              <mml:mi>R</mml:mi>
                              <mml:mi>t</mml:mi>
                            </mml:msub>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>o</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>t</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>a</mml:mi>
                            <mml:mo>⁢</mml:mo>
                            <mml:mi>l</mml:mi>
                          </mml:mrow>
                          <mml:mo stretchy="false">←</mml:mo>
                          <mml:mrow>
                            <mml:mrow>
                              <mml:msub>
                                <mml:mi>λ</mml:mi>
                                <mml:mn>1</mml:mn>
                              </mml:msub>
                              <mml:mo>⁢</mml:mo>
                              <mml:msub>
                                <mml:mi>r</mml:mi>
                                <mml:mrow>
                                  <mml:mi>G</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>L</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>O</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>B</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>A</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>L</mml:mi>
                                </mml:mrow>
                              </mml:msub>
                            </mml:mrow>
                            <mml:mo>+</mml:mo>
                            <mml:mrow>
                              <mml:msub>
                                <mml:mi>λ</mml:mi>
                                <mml:mn>2</mml:mn>
                              </mml:msub>
                              <mml:mo>⁢</mml:mo>
                              <mml:msub>
                                <mml:mi>r</mml:mi>
                                <mml:mrow>
                                  <mml:mi>E</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>F</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>F</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>I</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>C</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>I</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>E</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>N</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>C</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>Y</mml:mi>
                                </mml:mrow>
                              </mml:msub>
                            </mml:mrow>
                          </mml:mrow>
                        </mml:mrow>
                      </mml:math>
                    </disp-formula>
                    <disp-formula id="S4.Ex5">
                      <mml:math alttext="\displaystyle+\lambda_{3}r_{DIVERSITY}" display="inline">
                        <mml:mrow>
                          <mml:mo>+</mml:mo>
                          <mml:mrow>
                            <mml:msub>
                              <mml:mi>λ</mml:mi>
                              <mml:mn>3</mml:mn>
                            </mml:msub>
                            <mml:mo>⁢</mml:mo>
                            <mml:msub>
                              <mml:mi>r</mml:mi>
                              <mml:mrow>
                                <mml:mi>D</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>I</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>V</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>E</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>R</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>S</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>I</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>T</mml:mi>
                                <mml:mo>⁢</mml:mo>
                                <mml:mi>Y</mml:mi>
                              </mml:mrow>
                            </mml:msub>
                          </mml:mrow>
                        </mml:mrow>
                      </mml:math>
                    </disp-formula>
                  </disp-formula-group>
                </p>
                <bold> Update </bold>
                <inline-formula>
                  <mml:math alttext="w" display="inline">
                    <mml:mi>w</mml:mi>
                  </mml:math>
                </inline-formula>
                <bold> using </bold>
                <p>
                  <disp-formula id="S4.Ex6">
                    <mml:math alttext="g\propto{\nabla_{w}}\sum\limits_{i}{\log\pi\left({r={r_{i}}\left|{\xi\left({{s%&#10;_{i}}}\right);w}\right.}\right)R_{total}^{\prime}}" display="block">
                      <mml:mrow>
                        <mml:mi>g</mml:mi>
                        <mml:mo>∝</mml:mo>
                        <mml:mrow>
                          <mml:msub>
                            <mml:mo>∇</mml:mo>
                            <mml:mi>w</mml:mi>
                          </mml:msub>
                          <mml:mo>⁢</mml:mo>
                          <mml:mrow>
                            <mml:munder>
                              <mml:mo movablelimits="false">∑</mml:mo>
                              <mml:mi>i</mml:mi>
                            </mml:munder>
                            <mml:mrow>
                              <mml:mrow>
                                <mml:mi>log</mml:mi>
                                <mml:mo lspace="0.167em">⁡</mml:mo>
                                <mml:mi>π</mml:mi>
                              </mml:mrow>
                              <mml:mo>⁢</mml:mo>
                              <mml:mrow>
                                <mml:mo>(</mml:mo>
                                <mml:mrow>
                                  <mml:mi>r</mml:mi>
                                  <mml:mo>=</mml:mo>
                                  <mml:mrow>
                                    <mml:msub>
                                      <mml:mi>r</mml:mi>
                                      <mml:mi>i</mml:mi>
                                    </mml:msub>
                                    <mml:mo fence="false" stretchy="true">|</mml:mo>
                                    <mml:mrow>
                                      <mml:mrow>
                                        <mml:mi>ξ</mml:mi>
                                        <mml:mo>⁢</mml:mo>
                                        <mml:mrow>
                                          <mml:mo>(</mml:mo>
                                          <mml:msub>
                                            <mml:mi>s</mml:mi>
                                            <mml:mi>i</mml:mi>
                                          </mml:msub>
                                          <mml:mo>)</mml:mo>
                                        </mml:mrow>
                                      </mml:mrow>
                                      <mml:mo>;</mml:mo>
                                      <mml:mi>w</mml:mi>
                                    </mml:mrow>
                                  </mml:mrow>
                                </mml:mrow>
                                <mml:mo>)</mml:mo>
                              </mml:mrow>
                              <mml:mo>⁢</mml:mo>
                              <mml:msubsup>
                                <mml:mi>R</mml:mi>
                                <mml:mrow>
                                  <mml:mi>t</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>o</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>t</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>a</mml:mi>
                                  <mml:mo>⁢</mml:mo>
                                  <mml:mi>l</mml:mi>
                                </mml:mrow>
                                <mml:mo>′</mml:mo>
                              </mml:msubsup>
                            </mml:mrow>
                          </mml:mrow>
                        </mml:mrow>
                      </mml:mrow>
                    </mml:math>
                  </disp-formula>
                </p>
                <bold> If reach </bold>
                <inline-formula>
                  <mml:math alttext="t_{i}" display="inline">
                    <mml:msub>
                      <mml:mi>t</mml:mi>
                      <mml:mi>i</mml:mi>
                    </mml:msub>
                  </mml:math>
                </inline-formula>
                <bold> then</bold>
              </p>
            </list-item>
            <list-item>
              <p>
                <bold> reasoning Path </bold>
                <inline-formula>
                  <mml:math alttext="{P^{\prime}}\leftarrow{r_{1}}{r_{2}}\cdots{r_{i}}" display="inline">
                    <mml:mrow>
                      <mml:msup>
                        <mml:mi>P</mml:mi>
                        <mml:mo>′</mml:mo>
                      </mml:msup>
                      <mml:mo stretchy="false">←</mml:mo>
                      <mml:mrow>
                        <mml:msub>
                          <mml:mi>r</mml:mi>
                          <mml:mn>1</mml:mn>
                        </mml:msub>
                        <mml:mo>⁢</mml:mo>
                        <mml:msub>
                          <mml:mi>r</mml:mi>
                          <mml:mn>2</mml:mn>
                        </mml:msub>
                        <mml:mo>⁢</mml:mo>
                        <mml:mi mathvariant="normal">⋯</mml:mi>
                        <mml:mo>⁢</mml:mo>
                        <mml:msub>
                          <mml:mi>r</mml:mi>
                          <mml:mi>i</mml:mi>
                        </mml:msub>
                      </mml:mrow>
                    </mml:mrow>
                  </mml:math>
                </inline-formula>
                <bold/>
              </p>
            </list-item>
          </list>
        </boxed-text>
        <p id="S4.SS3.p3">Assuming there is a reasoning path <inline-formula><mml:math alttext="P={r_{1}}\to{r_{2}}" display="inline"><mml:mrow><mml:mi>P</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo stretchy="false">→</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula>, perform bidirectional path constraint search on entity pair <inline-formula><mml:math alttext="\left({h,t}\right)" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>. Starting from the head entity <inline-formula><mml:math alttext="h" display="inline"><mml:mi>h</mml:mi></mml:math></inline-formula> and connecting to the entity <inline-formula><mml:math alttext="e" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> through relationship <inline-formula><mml:math alttext="{r_{1}}" display="inline"><mml:msub><mml:mi>r</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:math></inline-formula>, the forward entity collection is <inline-formula><mml:math alttext="left=\left\{e\right\}" display="inline"><mml:mrow><mml:mrow><mml:mi>l</mml:mi><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>f</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:mi>e</mml:mi><mml:mo>}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>. At this point, if the length of the forward entity set <inline-formula><mml:math alttext="left" display="inline"><mml:mrow><mml:mi>l</mml:mi><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>f</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula> is 1 and the length of the reverse entity set <inline-formula><mml:math alttext="right" display="inline"><mml:mrow><mml:mi>r</mml:mi><mml:mo>⁢</mml:mo><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>g</mml:mi><mml:mo>⁢</mml:mo><mml:mi>h</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula> is 0, the next step is to expand <inline-formula><mml:math alttext="right" display="inline"><mml:mrow><mml:mi>r</mml:mi><mml:mo>⁢</mml:mo><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>g</mml:mi><mml:mo>⁢</mml:mo><mml:mi>h</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula>. Starting from the tail entity <inline-formula><mml:math alttext="t" display="inline"><mml:mi>t</mml:mi></mml:math></inline-formula> and connecting to the entity <inline-formula><mml:math alttext="e" display="inline"><mml:mi>e</mml:mi></mml:math></inline-formula> through relationship <inline-formula><mml:math alttext="{r_{2}}" display="inline"><mml:msub><mml:mi>r</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula>, <inline-formula><mml:math alttext="right=\left\{e\right\}" display="inline"><mml:mrow><mml:mrow><mml:mi>r</mml:mi><mml:mo>⁢</mml:mo><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>g</mml:mi><mml:mo>⁢</mml:mo><mml:mi>h</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:mi>e</mml:mi><mml:mo>}</mml:mo></mml:mrow></mml:mrow></mml:math></inline-formula>, at this point, the intersection of <inline-formula><mml:math alttext="left" display="inline"><mml:mrow><mml:mi>l</mml:mi><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>f</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math alttext="right" display="inline"><mml:mrow><mml:mi>r</mml:mi><mml:mo>⁢</mml:mo><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>g</mml:mi><mml:mo>⁢</mml:mo><mml:mi>h</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula> is not empty, the tail entity is successfully reasoned out.</p>
      </sec>
    </sec>
    <sec id="S5">
      <label>5.</label>
      <title>Comparison and Analysis of Model Parameters</title>
      <p id="S5.p1">Quantum circuit is mainly composed of three parts: quantum bits, quantum gates, and measurements. Quantum bits exhibit unique quantum advantages compared to classical bits due to their properties of superposition states. Quantum amplitude coding is an efficient method for mapping classical data to quantum states. It encodes states with <inline-formula><mml:math alttext="{2^{{N_{q}}}}" display="inline"><mml:msup><mml:mn>2</mml:mn><mml:msub><mml:mi>N</mml:mi><mml:mi>q</mml:mi></mml:msub></mml:msup></mml:math></inline-formula> dimensions into amplitude values of <inline-formula><mml:math alttext="{N_{q}}" display="inline"><mml:msub><mml:mi>N</mml:mi><mml:mi>q</mml:mi></mml:msub></mml:math></inline-formula> quantum bits, achieving compressed representation of high-dimensional input data. The number of quantum bits in a quantum circuit depends on the dimensions of the state and action space of the KG. Assuming that the state space dimension is <inline-formula><mml:math alttext="{\dim_{s}}" display="inline"><mml:msub><mml:mo>dim</mml:mo><mml:mi>s</mml:mi></mml:msub></mml:math></inline-formula> and the action space dimension is <inline-formula><mml:math alttext="{\dim_{a}}" display="inline"><mml:msub><mml:mo>dim</mml:mo><mml:mi>a</mml:mi></mml:msub></mml:math></inline-formula>, the number of quantum bits <inline-formula><mml:math alttext="{N_{q}}" display="inline"><mml:msub><mml:mi>N</mml:mi><mml:mi>q</mml:mi></mml:msub></mml:math></inline-formula> needs to satisfy:</p>
      <p>
        <disp-formula-group id="S5.E1">
          <disp-formula id="S5.E1X">
            <mml:math alttext="\displaystyle{2^{{N_{q}}}}\geq{\dim_{s}}" display="inline">
              <mml:mrow>
                <mml:msup>
                  <mml:mn>2</mml:mn>
                  <mml:msub>
                    <mml:mi>N</mml:mi>
                    <mml:mi>q</mml:mi>
                  </mml:msub>
                </mml:msup>
                <mml:mo rspace="0.1389em">≥</mml:mo>
                <mml:msub>
                  <mml:mo lspace="0.1389em">dim</mml:mo>
                  <mml:mi>s</mml:mi>
                </mml:msub>
              </mml:mrow>
            </mml:math>
          </disp-formula>
          <disp-formula id="S5.E1Xa">
            <mml:math alttext="\displaystyle{N_{q}}\geq{\dim_{a}}" display="inline">
              <mml:mrow>
                <mml:msub>
                  <mml:mi>N</mml:mi>
                  <mml:mi>q</mml:mi>
                </mml:msub>
                <mml:mo rspace="0.1389em">≥</mml:mo>
                <mml:msub>
                  <mml:mo lspace="0.1389em">dim</mml:mo>
                  <mml:mi>a</mml:mi>
                </mml:msub>
              </mml:mrow>
            </mml:math>
          </disp-formula>
        </disp-formula-group>
      </p>
      <p>Quantum gate is the fundamental unit that operates on qubits, achieving entangled states between qubits by linearly transforming their states, and establishing complex connections between multiple qubits. CNOT gates are commonly used to generate entangled states between quantum bits, achieving parallelism in quantum computing. After passing through the CNOT gate, the quantum bits of the input circuit are rotated through the Rot gate to achieve precise control over the state of the quantum bits. The <inline-formula><mml:math alttext="x,y,z" display="inline"><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>,</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:math></inline-formula> Rot gate in quantum circuit manipulates a three-dimensional weight vector <inline-formula><mml:math alttext="\left({{W_{x}},{W_{y}},{W_{z}}}\right)" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mi>W</mml:mi><mml:mi>x</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>W</mml:mi><mml:mi>y</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>W</mml:mi><mml:mi>z</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> to achieve rotation of quantum bits in three dimensions. Therefore, the parameter number of each layer of the Rot gate in quantum circuit is:</p>
      <p>
        <disp-formula id="S5.E2">
          <mml:math alttext="3\times{N_{q}}" display="block">
            <mml:mrow>
              <mml:mn>3</mml:mn>
              <mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo>
              <mml:msub>
                <mml:mi>N</mml:mi>
                <mml:mi>q</mml:mi>
              </mml:msub>
            </mml:mrow>
          </mml:math>
        </disp-formula>
      </p>
      <p>if the number of layers in a quantum circuit is <inline-formula><mml:math alttext="{L_{q}}" display="inline"><mml:msub><mml:mi>L</mml:mi><mml:mi>q</mml:mi></mml:msub></mml:math></inline-formula>, the parameter number of the entire quantum circuit's Rot gate, denoted as <inline-formula><mml:math alttext="{N_{R}}" display="inline"><mml:msub><mml:mi>N</mml:mi><mml:mi>R</mml:mi></mml:msub></mml:math></inline-formula>,is:</p>
      <p>
        <disp-formula id="S5.E3">
          <mml:math alttext="{N_{R}}=3\times{N_{q}}\times{L_{q}}" display="block">
            <mml:mrow>
              <mml:msub>
                <mml:mi>N</mml:mi>
                <mml:mi>R</mml:mi>
              </mml:msub>
              <mml:mo>=</mml:mo>
              <mml:mrow>
                <mml:mn>3</mml:mn>
                <mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo>
                <mml:msub>
                  <mml:mi>N</mml:mi>
                  <mml:mi>q</mml:mi>
                </mml:msub>
                <mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo>
                <mml:msub>
                  <mml:mi>L</mml:mi>
                  <mml:mi>q</mml:mi>
                </mml:msub>
              </mml:mrow>
            </mml:mrow>
          </mml:math>
        </disp-formula>
      </p>
      <p>for each quantum circuit, if a bias vector is set as <inline-formula><mml:math alttext="B" display="inline"><mml:mi>B</mml:mi></mml:math></inline-formula>, the parameter number of the bias term <inline-formula><mml:math alttext="{N_{B}}" display="inline"><mml:msub><mml:mi>N</mml:mi><mml:mi>B</mml:mi></mml:msub></mml:math></inline-formula> is:</p>
      <p>
        <disp-formula id="S5.E4">
          <mml:math alttext="{N_{B}}={N_{q}}" display="block">
            <mml:mrow>
              <mml:msub>
                <mml:mi>N</mml:mi>
                <mml:mi>B</mml:mi>
              </mml:msub>
              <mml:mo>=</mml:mo>
              <mml:msub>
                <mml:mi>N</mml:mi>
                <mml:mi>q</mml:mi>
              </mml:msub>
            </mml:mrow>
          </mml:math>
        </disp-formula>
      </p>
      <p>the parameter number of the entire quantum circuit <inline-formula><mml:math alttext="N" display="inline"><mml:mi>N</mml:mi></mml:math></inline-formula>, can be expressed as:</p>
      <p>
        <disp-formula id="S5.E5">
          <mml:math alttext="N={N_{R}}+{N_{B}}=3\times{N_{q}}\times{L_{q}}+{N_{q}}=\left({3{L_{q}}+1}\right%&#10;){N_{q}}" display="block">
            <mml:mrow>
              <mml:mi>N</mml:mi>
              <mml:mo>=</mml:mo>
              <mml:mrow>
                <mml:msub>
                  <mml:mi>N</mml:mi>
                  <mml:mi>R</mml:mi>
                </mml:msub>
                <mml:mo>+</mml:mo>
                <mml:msub>
                  <mml:mi>N</mml:mi>
                  <mml:mi>B</mml:mi>
                </mml:msub>
              </mml:mrow>
              <mml:mo>=</mml:mo>
              <mml:mrow>
                <mml:mrow>
                  <mml:mn>3</mml:mn>
                  <mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo>
                  <mml:msub>
                    <mml:mi>N</mml:mi>
                    <mml:mi>q</mml:mi>
                  </mml:msub>
                  <mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo>
                  <mml:msub>
                    <mml:mi>L</mml:mi>
                    <mml:mi>q</mml:mi>
                  </mml:msub>
                </mml:mrow>
                <mml:mo>+</mml:mo>
                <mml:msub>
                  <mml:mi>N</mml:mi>
                  <mml:mi>q</mml:mi>
                </mml:msub>
              </mml:mrow>
              <mml:mo>=</mml:mo>
              <mml:mrow>
                <mml:mrow>
                  <mml:mo>(</mml:mo>
                  <mml:mrow>
                    <mml:mrow>
                      <mml:mn>3</mml:mn>
                      <mml:mo>⁢</mml:mo>
                      <mml:msub>
                        <mml:mi>L</mml:mi>
                        <mml:mi>q</mml:mi>
                      </mml:msub>
                    </mml:mrow>
                    <mml:mo>+</mml:mo>
                    <mml:mn>1</mml:mn>
                  </mml:mrow>
                  <mml:mo>)</mml:mo>
                </mml:mrow>
                <mml:mo>⁢</mml:mo>
                <mml:msub>
                  <mml:mi>N</mml:mi>
                  <mml:mi>q</mml:mi>
                </mml:msub>
              </mml:mrow>
            </mml:mrow>
          </mml:math>
        </disp-formula>
      </p>
      <p id="S5.p2">DeepPath [<xref rid="ref018" ref-type="bibr">18</xref>] is trained on a reinforcement learning network, which consists of two hidden layers and one output layer. Assuming that the state space dimension <inline-formula><mml:math alttext="{\dim_{s}}=200" display="inline"><mml:mrow><mml:msub><mml:mo>dim</mml:mo><mml:mi>s</mml:mi></mml:msub><mml:mo lspace="0.278em">=</mml:mo><mml:mn>200</mml:mn></mml:mrow></mml:math></inline-formula>, the action space dimension <inline-formula><mml:math alttext="{\dim_{a}}=16" display="inline"><mml:mrow><mml:msub><mml:mo>dim</mml:mo><mml:mi>a</mml:mi></mml:msub><mml:mo lspace="0.278em">=</mml:mo><mml:mn>16</mml:mn></mml:mrow></mml:math></inline-formula>, and the dimension of the first hidden layer is 512, the total number of parameters from input to the first hidden layer <inline-formula><mml:math alttext="N_{{D_{1}}}" display="inline"><mml:msub><mml:mi>N</mml:mi><mml:msub><mml:mi>D</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:msub></mml:math></inline-formula> is:</p>
      <p>
        <disp-formula id="S5.E6">
          <mml:math alttext="N_{{D_{1}}}=200\times 512+512=102912" display="block">
            <mml:mrow>
              <mml:msub>
                <mml:mi>N</mml:mi>
                <mml:msub>
                  <mml:mi>D</mml:mi>
                  <mml:mn>1</mml:mn>
                </mml:msub>
              </mml:msub>
              <mml:mo>=</mml:mo>
              <mml:mrow>
                <mml:mrow>
                  <mml:mn>200</mml:mn>
                  <mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo>
                  <mml:mn>512</mml:mn>
                </mml:mrow>
                <mml:mo>+</mml:mo>
                <mml:mn>512</mml:mn>
              </mml:mrow>
              <mml:mo>=</mml:mo>
              <mml:mn>102912</mml:mn>
            </mml:mrow>
          </mml:math>
        </disp-formula>
      </p>
      <p>the dimension of the second hidden layer is 1024, so the total number of parameters from the first hidden layer to the second hidden layer <inline-formula><mml:math alttext="{N_{2}}" display="inline"><mml:msub><mml:mi>N</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula> is:</p>
      <p>
        <disp-formula id="S5.E7">
          <mml:math alttext="N_{{D_{2}}}=512\times 1024+1024=525312" display="block">
            <mml:mrow>
              <mml:msub>
                <mml:mi>N</mml:mi>
                <mml:msub>
                  <mml:mi>D</mml:mi>
                  <mml:mn>2</mml:mn>
                </mml:msub>
              </mml:msub>
              <mml:mo>=</mml:mo>
              <mml:mrow>
                <mml:mrow>
                  <mml:mn>512</mml:mn>
                  <mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo>
                  <mml:mn>1024</mml:mn>
                </mml:mrow>
                <mml:mo>+</mml:mo>
                <mml:mn>1024</mml:mn>
              </mml:mrow>
              <mml:mo>=</mml:mo>
              <mml:mn>525312</mml:mn>
            </mml:mrow>
          </mml:math>
        </disp-formula>
      </p>
      <p>the total number of parameters from the second hidden layer to the output layer <inline-formula><mml:math alttext="{N_{3}}" display="inline"><mml:msub><mml:mi>N</mml:mi><mml:mn>3</mml:mn></mml:msub></mml:math></inline-formula> is:</p>
      <p>
        <disp-formula id="S5.E8">
          <mml:math alttext="N_{{D_{3}}}=1024\times 16+16=16400" display="block">
            <mml:mrow>
              <mml:msub>
                <mml:mi>N</mml:mi>
                <mml:msub>
                  <mml:mi>D</mml:mi>
                  <mml:mn>3</mml:mn>
                </mml:msub>
              </mml:msub>
              <mml:mo>=</mml:mo>
              <mml:mrow>
                <mml:mrow>
                  <mml:mn>1024</mml:mn>
                  <mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo>
                  <mml:mn>16</mml:mn>
                </mml:mrow>
                <mml:mo>+</mml:mo>
                <mml:mn>16</mml:mn>
              </mml:mrow>
              <mml:mo>=</mml:mo>
              <mml:mn>16400</mml:mn>
            </mml:mrow>
          </mml:math>
        </disp-formula>
      </p>
      <p>the total number of parameters for the DeepPath network <inline-formula><mml:math alttext="{N_{D}}" display="inline"><mml:msub><mml:mi>N</mml:mi><mml:mi>D</mml:mi></mml:msub></mml:math></inline-formula> is:</p>
      <p>
        <disp-formula id="S5.E9">
          <mml:math alttext="{N_{D}}={N_{{D_{1}}}}+{N_{{D_{2}}}}+{N_{{D_{3}}}}=1271824" display="block">
            <mml:mrow>
              <mml:msub>
                <mml:mi>N</mml:mi>
                <mml:mi>D</mml:mi>
              </mml:msub>
              <mml:mo>=</mml:mo>
              <mml:mrow>
                <mml:msub>
                  <mml:mi>N</mml:mi>
                  <mml:msub>
                    <mml:mi>D</mml:mi>
                    <mml:mn>1</mml:mn>
                  </mml:msub>
                </mml:msub>
                <mml:mo>+</mml:mo>
                <mml:msub>
                  <mml:mi>N</mml:mi>
                  <mml:msub>
                    <mml:mi>D</mml:mi>
                    <mml:mn>2</mml:mn>
                  </mml:msub>
                </mml:msub>
                <mml:mo>+</mml:mo>
                <mml:msub>
                  <mml:mi>N</mml:mi>
                  <mml:msub>
                    <mml:mi>D</mml:mi>
                    <mml:mn>3</mml:mn>
                  </mml:msub>
                </mml:msub>
              </mml:mrow>
              <mml:mo>=</mml:mo>
              <mml:mn>1271824</mml:mn>
            </mml:mrow>
          </mml:math>
        </disp-formula>
      </p>
      <p>The NCRL [<xref rid="ref024" ref-type="bibr">24</xref>] is trained based on a neural network that includes an Embedding layer, an LSTM layer, a Linear layer, and an Attention layer. Assuming the action space dimension is 16 and the Embedding layer dimension is 1024, the number of parameters in the Embedding layer <inline-formula><mml:math alttext="{N_{{N_{1}}}}" display="inline"><mml:msub><mml:mi>N</mml:mi><mml:msub><mml:mi>N</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:msub></mml:math></inline-formula> is:</p>
      <p>
        <disp-formula id="S5.E10">
          <mml:math alttext="{N_{{N_{1}}}}=\left({16+1}\right)\times 1024=17408" display="block">
            <mml:mrow>
              <mml:msub>
                <mml:mi>N</mml:mi>
                <mml:msub>
                  <mml:mi>N</mml:mi>
                  <mml:mn>1</mml:mn>
                </mml:msub>
              </mml:msub>
              <mml:mo>=</mml:mo>
              <mml:mrow>
                <mml:mrow>
                  <mml:mo>(</mml:mo>
                  <mml:mrow>
                    <mml:mn>16</mml:mn>
                    <mml:mo>+</mml:mo>
                    <mml:mn>1</mml:mn>
                  </mml:mrow>
                  <mml:mo rspace="0.055em">)</mml:mo>
                </mml:mrow>
                <mml:mo rspace="0.222em">×</mml:mo>
                <mml:mn>1024</mml:mn>
              </mml:mrow>
              <mml:mo>=</mml:mo>
              <mml:mn>17408</mml:mn>
            </mml:mrow>
          </mml:math>
        </disp-formula>
      </p>
      <p>the parameters of the LSTM layer include the weights and biases for the input-to-hidden and hidden-to-hidden connections. Assuming both the input and hidden layer dimensions are 1024, the number of parameters in the LSTM layer <inline-formula><mml:math alttext="{N_{{N_{2}}}}" display="inline"><mml:msub><mml:mi>N</mml:mi><mml:msub><mml:mi>N</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:msub></mml:math></inline-formula> is:</p>
      <p>
        <disp-formula-group id="S7.EGx4">
          <disp-formula id="S5.E11">
            <mml:math alttext="\displaystyle{N_{{N_{2}}}}=4\times\left({1024\times 1024+1024+1024\times 1024+%&#10;1024}\right)" display="inline">
              <mml:mrow>
                <mml:msub>
                  <mml:mi>N</mml:mi>
                  <mml:msub>
                    <mml:mi>N</mml:mi>
                    <mml:mn>2</mml:mn>
                  </mml:msub>
                </mml:msub>
                <mml:mo>=</mml:mo>
                <mml:mrow>
                  <mml:mn>4</mml:mn>
                  <mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo>
                  <mml:mrow>
                    <mml:mo>(</mml:mo>
                    <mml:mrow>
                      <mml:mrow>
                        <mml:mn>1024</mml:mn>
                        <mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo>
                        <mml:mn>1024</mml:mn>
                      </mml:mrow>
                      <mml:mo>+</mml:mo>
                      <mml:mn>1024</mml:mn>
                      <mml:mo>+</mml:mo>
                      <mml:mrow>
                        <mml:mn>1024</mml:mn>
                        <mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo>
                        <mml:mn>1024</mml:mn>
                      </mml:mrow>
                      <mml:mo>+</mml:mo>
                      <mml:mn>1024</mml:mn>
                    </mml:mrow>
                    <mml:mo>)</mml:mo>
                  </mml:mrow>
                </mml:mrow>
              </mml:mrow>
            </mml:math>
          </disp-formula>
          <disp-formula id="S5.Ex1">
            <mml:math alttext="\displaystyle=8396800" display="inline">
              <mml:mrow>
                <mml:mi/>
                <mml:mo>=</mml:mo>
                <mml:mn>8396800</mml:mn>
              </mml:mrow>
            </mml:math>
          </disp-formula>
        </disp-formula-group>
      </p>
      <p>assuming the input and output dimensions of the Linear layer are both 1024, the number of parameters <inline-formula><mml:math alttext="{N_{{N_{3}}}}" display="inline"><mml:msub><mml:mi>N</mml:mi><mml:msub><mml:mi>N</mml:mi><mml:mn>3</mml:mn></mml:msub></mml:msub></mml:math></inline-formula> can be expressed as:</p>
      <p>
        <disp-formula id="S5.E12">
          <mml:math alttext="{N_{{N_{3}}}}=1024\times 1+1=1025" display="block">
            <mml:mrow>
              <mml:msub>
                <mml:mi>N</mml:mi>
                <mml:msub>
                  <mml:mi>N</mml:mi>
                  <mml:mn>3</mml:mn>
                </mml:msub>
              </mml:msub>
              <mml:mo>=</mml:mo>
              <mml:mrow>
                <mml:mrow>
                  <mml:mn>1024</mml:mn>
                  <mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo>
                  <mml:mn>1</mml:mn>
                </mml:mrow>
                <mml:mo>+</mml:mo>
                <mml:mn>1</mml:mn>
              </mml:mrow>
              <mml:mo>=</mml:mo>
              <mml:mn>1025</mml:mn>
            </mml:mrow>
          </mml:math>
        </disp-formula>
      </p>
      <p>the Attention layer consists of three Linear layers, so the number of parameters in the Attention layer <inline-formula><mml:math alttext="{N_{{N_{4}}}}" display="inline"><mml:msub><mml:mi>N</mml:mi><mml:msub><mml:mi>N</mml:mi><mml:mn>4</mml:mn></mml:msub></mml:msub></mml:math></inline-formula> can be expressed as:</p>
      <p>
        <disp-formula id="S5.E13">
          <mml:math alttext="{N_{{N_{4}}}}=3\times\left({1024\times 1024+1024}\right)=3148800" display="block">
            <mml:mrow>
              <mml:msub>
                <mml:mi>N</mml:mi>
                <mml:msub>
                  <mml:mi>N</mml:mi>
                  <mml:mn>4</mml:mn>
                </mml:msub>
              </mml:msub>
              <mml:mo>=</mml:mo>
              <mml:mrow>
                <mml:mn>3</mml:mn>
                <mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo>
                <mml:mrow>
                  <mml:mo>(</mml:mo>
                  <mml:mrow>
                    <mml:mrow>
                      <mml:mn>1024</mml:mn>
                      <mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo>
                      <mml:mn>1024</mml:mn>
                    </mml:mrow>
                    <mml:mo>+</mml:mo>
                    <mml:mn>1024</mml:mn>
                  </mml:mrow>
                  <mml:mo>)</mml:mo>
                </mml:mrow>
              </mml:mrow>
              <mml:mo>=</mml:mo>
              <mml:mn>3148800</mml:mn>
            </mml:mrow>
          </mml:math>
        </disp-formula>
      </p>
      <p>therefore, the total number of parameters in the NCRL model <inline-formula><mml:math alttext="{N_{N}}" display="inline"><mml:msub><mml:mi>N</mml:mi><mml:mi>N</mml:mi></mml:msub></mml:math></inline-formula> is:</p>
      <p>
        <disp-formula id="S5.E14">
          <mml:math alttext="{N_{N}}=17408+8396800+1025+3148800=11564033" display="block">
            <mml:mrow>
              <mml:msub>
                <mml:mi>N</mml:mi>
                <mml:mi>N</mml:mi>
              </mml:msub>
              <mml:mo>=</mml:mo>
              <mml:mrow>
                <mml:mn>17408</mml:mn>
                <mml:mo>+</mml:mo>
                <mml:mn>8396800</mml:mn>
                <mml:mo>+</mml:mo>
                <mml:mn>1025</mml:mn>
                <mml:mo>+</mml:mo>
                <mml:mn>3148800</mml:mn>
              </mml:mrow>
              <mml:mo>=</mml:mo>
              <mml:mn>11564033</mml:mn>
            </mml:mrow>
          </mml:math>
        </disp-formula>
      </p>
      <p>Under the same parameter settings, the number of parameters required for quantum circuit is <inline-formula><mml:math alttext="N=\left({3\times 3+1}\right)\times 16=160" display="inline"><mml:mrow><mml:mi>N</mml:mi><mml:mo>=</mml:mo><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mrow><mml:mn>3</mml:mn><mml:mo lspace="0.222em" rspace="0.222em">×</mml:mo><mml:mn>3</mml:mn></mml:mrow><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo rspace="0.055em">)</mml:mo></mml:mrow><mml:mo rspace="0.222em">×</mml:mo><mml:mn>16</mml:mn></mml:mrow><mml:mo>=</mml:mo><mml:mn>160</mml:mn></mml:mrow></mml:math></inline-formula>, significantly reducing the number of parameters needed for model training.</p>
      <p id="S5.p3">Quantum circuits, through quantum superposition and entanglement, can represent high-dimensional states with a small number of qubits. However, this compression capability has not been fully realized in current classical-based quantum simulators, where the storage and computational demands far exceed those required for actual operation on quantum hardware [<xref rid="ref027" ref-type="bibr">27</xref>]. Classical simulators need to explicitly store the entire quantum state vector, i.e., all amplitudes [<xref rid="ref026" ref-type="bibr">26</xref>], whereas in actual quantum hardware, these values are implicitly encoded in the physical system and do not require explicit storage. Furthermore, classical simulators cannot achieve exponential parallelism via quantum superposition states as quantum hardware can, and thus must simulate all possible paths sequentially, increasing the processing time requirement.</p>
    </sec>
    <sec id="S6">
      <label>6.</label>
      <title>Experiments</title>
      <p id="S6.p1">In this section, we first introduce the experimental setup, including the dataset, baseline, evaluation metrics, and parameter settings. Then, the main results of the proposed model were introduced, and all baselines were compared on two benchmark datasets. Furthermore, the training parameter quantities of different models were analyzed and compared.</p>
      <sec id="S6.SS1">
        <label>6.1</label>
        <title>Database and Settings</title>
        <p id="S6.SS1.p1">To evaluate the performance of the QIRL method in entity prediction tasks, partial KG data was extracted from two benchmark datasets, Kinship and YAGO3-10, for testing. The Kinship dataset is small but logically complex, testing the model's reasoning ability with sparse data. The YAGO3-10 dataset is large and diverse, evaluating the model's scalability and generalization.The increase in the number of relationships in knowledge reasoning enhances the completeness of reasoning paths and improves the accuracy of knowledge reasoning. Constrained by the computational hardware's processing capabilities, the quantum reinforcement learning model in this paper contains 16 qubits and can handle 16 relationships in the dataset. To find the reasoning path more efficiently, breadth first search is performed from both the head entity and tail entity directions. The action space includes the relationships between entities and their inverse relationships. The statistical data of the extracted dataset is shown in Table <xref rid="T1" ref-type="table">1</xref>:</p>
        <p>
          <table-wrap id="T1">
            <label>Table 1</label>
            <caption>
              <p>Statistical data of the dataset.</p>
            </caption>
            <table>
              <thead>
                <tr>
                  <th style="border-top: 1px solid black;" align="center">
                    <bold>Dataset</bold>
                  </th>
                  <th style="border-top: 1px solid black;" align="center">
                    <bold>entities</bold>
                  </th>
                  <th style="border-top: 1px solid black;" align="center">
                    <bold>rel</bold>
                  </th>
                  <th style="border-top: 1px solid black;" align="center">
                    <bold>train</bold>
                  </th>
                  <th style="border-top: 1px solid black;" align="center">
                    <bold>Test</bold>
                  </th>
                  <th style="border-top: 1px solid black;" align="center">
                    <bold>valid</bold>
                  </th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <th style="border-top: 1px solid black;" align="center">Kinship</th>
                  <td style="border-top: 1px solid black;" align="center">104</td>
                  <td style="border-top: 1px solid black;" align="center">16</td>
                  <td style="border-top: 1px solid black;" align="center">4897</td>
                  <td style="border-top: 1px solid black;" align="center">1226</td>
                  <td style="border-top: 1px solid black;" align="center">581</td>
                </tr>
                <tr>
                  <th style="border-bottom: 1px solid black;" align="center">YAGO3-10</th>
                  <td style="border-bottom: 1px solid black;" align="center">123183</td>
                  <td style="border-bottom: 1px solid black;" align="center">16</td>
                  <td style="border-bottom: 1px solid black;" align="center">313569</td>
                  <td style="border-bottom: 1px solid black;" align="center">3867</td>
                  <td style="border-bottom: 1px solid black;" align="center">3572</td>
                </tr>
              </tbody>
            </table>
          </table-wrap>
        </p>
        <p id="S6.SS1.p2">The QIRL model parameters proposed in this paper include the quantum bit count <inline-formula><mml:math alttext="num_{q}ubits" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>⁢</mml:mo><mml:mi>u</mml:mi><mml:mo>⁢</mml:mo><mml:msub><mml:mi>m</mml:mi><mml:mi>q</mml:mi></mml:msub><mml:mo>⁢</mml:mo><mml:mi>u</mml:mi><mml:mo>⁢</mml:mo><mml:mi>b</mml:mi><mml:mo>⁢</mml:mo><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi><mml:mo>⁢</mml:mo><mml:mi>s</mml:mi></mml:mrow></mml:math></inline-formula> of the quantum circuit, the learning rate <inline-formula><mml:math alttext="lr" display="inline"><mml:mrow><mml:mi>l</mml:mi><mml:mo>⁢</mml:mo><mml:mi>r</mml:mi></mml:mrow></mml:math></inline-formula> of the model training, the entity embedding dimension <inline-formula><mml:math alttext="embedding_{d}im" display="inline"><mml:mrow><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>m</mml:mi><mml:mo>⁢</mml:mo><mml:mi>b</mml:mi><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>d</mml:mi><mml:mo>⁢</mml:mo><mml:mi>d</mml:mi><mml:mo>⁢</mml:mo><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>n</mml:mi><mml:mo>⁢</mml:mo><mml:msub><mml:mi>g</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>⁢</mml:mo><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>m</mml:mi></mml:mrow></mml:math></inline-formula>, the reinforcement learning discount rate <inline-formula><mml:math alttext="\gamma" display="inline"><mml:mi>γ</mml:mi></mml:math></inline-formula>, the maximum number of attempted steps for reasoning path search <inline-formula><mml:math alttext="max_{l}ength" display="inline"><mml:mrow><mml:mi>m</mml:mi><mml:mo>⁢</mml:mo><mml:mi>a</mml:mi><mml:mo>⁢</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>n</mml:mi><mml:mo>⁢</mml:mo><mml:mi>g</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi><mml:mo>⁢</mml:mo><mml:mi>h</mml:mi></mml:mrow></mml:math></inline-formula>, etc., where num_qubits is the number of relationships contained in the dataset. To improve the generalization ability and accuracy of the model, this paper generates positive and negative samples of the test set data based on pra [<xref rid="ref025" ref-type="bibr">25</xref>]. This paper uses a TransE based method to train embedding vector representations of entities and relationships. The optimal parameters for the model are <inline-formula><mml:math alttext="embedding_{d}im=100" display="inline"><mml:mrow><mml:mrow><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>m</mml:mi><mml:mo>⁢</mml:mo><mml:mi>b</mml:mi><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>d</mml:mi><mml:mo>⁢</mml:mo><mml:mi>d</mml:mi><mml:mo>⁢</mml:mo><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>n</mml:mi><mml:mo>⁢</mml:mo><mml:msub><mml:mi>g</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>⁢</mml:mo><mml:mi>i</mml:mi><mml:mo>⁢</mml:mo><mml:mi>m</mml:mi></mml:mrow><mml:mo>=</mml:mo><mml:mn>100</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math alttext="\gamma=0.99" display="inline"><mml:mrow><mml:mi>γ</mml:mi><mml:mo>=</mml:mo><mml:mn>0.99</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math alttext="max_{l}ength=50" display="inline"><mml:mrow><mml:mrow><mml:mi>m</mml:mi><mml:mo>⁢</mml:mo><mml:mi>a</mml:mi><mml:mo>⁢</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>l</mml:mi></mml:msub><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi><mml:mo>⁢</mml:mo><mml:mi>n</mml:mi><mml:mo>⁢</mml:mo><mml:mi>g</mml:mi><mml:mo>⁢</mml:mo><mml:mi>t</mml:mi><mml:mo>⁢</mml:mo><mml:mi>h</mml:mi></mml:mrow><mml:mo>=</mml:mo><mml:mn>50</mml:mn></mml:mrow></mml:math></inline-formula>.</p>
      </sec>
      <sec id="S6.SS2">
        <label>6.2</label>
        <title>Baseline and Evaluation Index</title>
        <p id="S6.SS2.p1">This paper compares embedding-based methods and path-based methods to explore their performance on the dataset used in this paper. Embedding-based methods include translation-based method TransE [<xref rid="ref011" ref-type="bibr">11</xref>], rotation-based method RotalE [<xref rid="ref019" ref-type="bibr">19</xref>] and complex vector space-based method CompleEx [<xref rid="ref020" ref-type="bibr">20</xref>]. Path-based methods include neural network-based and logical reasoning combined method NeuralLP [<xref rid="ref021" ref-type="bibr">21</xref>], deep learning-based and relational reasoning combined method DRUM [<xref rid="ref022" ref-type="bibr">22</xref>], rule-based method RulE [<xref rid="ref023" ref-type="bibr">23</xref>], neural network-based and symbolic reasoning combined method NCRL [<xref rid="ref024" ref-type="bibr">24</xref>], and reinforcement learning-based method DeepPath [<xref rid="ref018" ref-type="bibr">18</xref>]. In order to ensure the fairness of the experiment., this paper used the publicly released source code of each model and adopted the best hyperparameters provided in the original text for the experiment.</p>
        <p>
          <table-wrap id="T2">
            <label>Table 2</label>
            <caption>
              <p>Comparison of relationship path numbers.</p>
            </caption>
            <table>
              <thead>
                <tr>
                  <th style="border-top: 1px solid black;" align="center">
                    <bold>Dataset</bold>
                  </th>
                  <th style="border-top: 1px solid black;" align="center">
                    <bold>Average Path number</bold>
                  </th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <th style="border-top: 1px solid black;" align="center">Kinship</th>
                  <td style="border-top: 1px solid black;" align="center">69</td>
                </tr>
                <tr>
                  <th style="border-bottom: 1px solid black;" align="center">YAGO3-10</th>
                  <td style="border-bottom: 1px solid black;" align="center">5</td>
                </tr>
              </tbody>
            </table>
          </table-wrap>
        </p>
        <p>
          <fig id="F2">
            <label>Figure 2.</label>
            <caption>
              <p>Comparison of relationship path numbers.</p>
            </caption>
            <p>
              <fig id="F2.sf1">
                <label>(a)</label>
                <caption>
                  <p>Relationship Path Numbers of YAGO3-10</p>
                </caption>
                <graphic xlink:href="fig2.png"/>
              </fig>
            </p>
            <p>
              <fig id="F2.sf2">
                <label>(b)</label>
                <caption>
                  <p>Relationship Path Numbers of Kinship</p>
                </caption>
                <graphic xlink:href="fig3.png"/>
              </fig>
            </p>
          </fig>
        </p>
        <p id="S6.SS2.p2">In this experiment, Mean Average Precision (MAP) and Accuracy were used as evaluation metrics. This paper primarily focuses on the tail reasoning task and evaluates it on the tail entity reasoning task, namely predicting the entity represented by <inline-formula><mml:math alttext="?" display="inline"><mml:mi mathvariant="normal">?</mml:mi></mml:math></inline-formula> in <inline-formula><mml:math alttext="(h_{i},r_{i},?)" display="inline"><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi mathvariant="normal">?</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula>. For each test triplet <inline-formula><mml:math alttext="(h_{i},r_{i},?)" display="inline"><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>h</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>r</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi mathvariant="normal">?</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:math></inline-formula>, start from the head entity and search for the tail entity based on the generated reasoning paths. Tail reasoning tasks are the main focus of this paper, while head reasoning tasks and relationship reasoning tasks can also be converted into this paradigm.</p>
      </sec>
      <sec id="S6.SS3">
        <label>6.3</label>
        <title>Main Results</title>
        <p id="S6.SS3.p1">Figure <xref ref-type="fig" rid="">2</xref> shows the entity reasoning MAP values of the QIRL method on different relationships between the Kinship and YAGO3-10 datasets, and Table <xref rid="T2" ref-type="table">2</xref> lists the number of reasoning paths found by the QIRL method on the Kinship and YAGO3-10 datasets. The agent found more reasoning paths in the Kinship dataset than in the YAGO3-10 dataset, which means the agent can find strongly correlated reasoning paths in the YAGO3-10 dataset and filter out similar or unrelated ones, but it is difficult to find the most relevant reasoning paths in the Kinship dataset. In addition, when the number of reasoning paths is too small, it is also difficult to find sufficient reasoning evidence to obtain reasoning results.</p>
        <p id="S6.SS3.p2">As shown in Table <xref rid="T3" ref-type="table">3</xref>, the test results of QIRL method on YAGO3-10 are better than those on Kinship, because the correlation between entities in Kinship is low, and QIRL cannot find sufficient reasoning evidence on Kinship. However, in YAGO3-10, the correlation between entities is high and the QIRL method can find sufficient reasoning evidence for reasoning, thus obtaining good test results.</p>
        <p>
          <table-wrap id="T3">
            <label>Table 3</label>
            <caption>
              <p>Reasoning results.</p>
            </caption>
            <table>
              <thead>
                <tr>
                  <th style="border-top: 1px solid black;" rowspan="2" align="center">
                    <bold>Model</bold>
                  </th>
                  <th style="border-top: 1px solid black;" colspan="2" align="center">
                    <bold>Kinship</bold>
                  </th>
                  <th style="border-top: 1px solid black;" colspan="2" align="center">
                    <bold>YAGO3-10</bold>
                  </th>
                </tr>
                <tr>
                  <th align="center">
                    <bold>MAP</bold>
                  </th>
                  <th align="center">
                    <bold>Accuracy</bold>
                  </th>
                  <th align="center">
                    <bold>MAP</bold>
                  </th>
                  <th align="center">
                    <bold>Accuracy</bold>
                  </th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td style="border-top: 1px solid black;" align="center">TransE[<xref rid="ref011" ref-type="bibr">11</xref>]</td>
                  <td style="border-top: 1px solid black;" align="center">0.325</td>
                  <td style="border-top: 1px solid black;" align="center">0.237</td>
                  <td style="border-top: 1px solid black;" align="center">0.072</td>
                  <td style="border-top: 1px solid black;" align="center">0.099</td>
                </tr>
                <tr>
                  <td align="center">RotalE[<xref rid="ref019" ref-type="bibr">19</xref>]</td>
                  <td align="center">0.875</td>
                  <td align="center">0.744</td>
                  <td align="center">0.071</td>
                  <td align="center">0.082</td>
                </tr>
                <tr>
                  <td align="center">ComplEx[<xref rid="ref020" ref-type="bibr">20</xref>]</td>
                  <td align="center">0.806</td>
                  <td align="center">0.651</td>
                  <td align="center">0.041</td>
                  <td align="center">0.051</td>
                </tr>
                <tr>
                  <td align="center">NCRL[<xref rid="ref024" ref-type="bibr">24</xref>]</td>
                  <td align="center">0.366</td>
                  <td align="center">0.337</td>
                  <td align="center">0.950</td>
                  <td align="center">0.950</td>
                </tr>
                <tr>
                  <td align="center">NeuralLP[<xref rid="ref021" ref-type="bibr">21</xref>]</td>
                  <td align="center">-</td>
                  <td align="center">0.088</td>
                  <td align="center">-</td>
                  <td align="center">0.001</td>
                </tr>
                <tr>
                  <td align="center">DRUM[<xref rid="ref022" ref-type="bibr">22</xref>]</td>
                  <td align="center">-</td>
                  <td align="center">0.135</td>
                  <td align="center">-</td>
                  <td align="center">0.004</td>
                </tr>
                <tr>
                  <td align="center">RulE[<xref rid="ref023" ref-type="bibr">23</xref>]</td>
                  <td align="center">0.665</td>
                  <td align="center">0.649</td>
                  <td align="center">0.713</td>
                  <td align="center">0.697</td>
                </tr>
                <tr>
                  <td align="center">DeepPath[<xref rid="ref018" ref-type="bibr">18</xref>]</td>
                  <td align="center">0.307</td>
                  <td align="center">0.314</td>
                  <td align="center">0.658</td>
                  <td align="center">0.594</td>
                </tr>
                <tr>
                  <td style="border-bottom: 1px solid black;" align="center">QIRL</td>
                  <td style="border-bottom: 1px solid black;" align="center">0.326</td>
                  <td style="border-bottom: 1px solid black;" align="center">0.312</td>
                  <td style="border-bottom: 1px solid black;" align="center">0.661</td>
                  <td style="border-bottom: 1px solid black;" align="center">0.594</td>
                </tr>
              </tbody>
            </table>
          </table-wrap>
        </p>
        <p>
          <table-wrap id="T4">
            <label>Table 4</label>
            <caption>
              <p>Comparison of parameter numbers in different models.</p>
            </caption>
            <table>
              <thead>
                <tr>
                  <th style="border-top: 1px solid black;" align="center">
                    <bold>Model</bold>
                  </th>
                  <th style="border-top: 1px solid black;" align="center">
                    <bold>Parameter number</bold>
                  </th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <th style="border-top: 1px solid black;" align="center">QIRL</th>
                  <td style="border-top: 1px solid black;" align="center">160</td>
                </tr>
                <tr>
                  <th align="center">DeepPath</th>
                  <td align="center">644624</td>
                </tr>
                <tr>
                  <th align="center">NeuralLP</th>
                  <td align="center">139936</td>
                </tr>
                <tr>
                  <th align="center">DRUM</th>
                  <td align="center">204513</td>
                </tr>
                <tr>
                  <th align="center">RulE</th>
                  <td align="center">4722205</td>
                </tr>
                <tr>
                  <th style="border-bottom: 1px solid black;" align="center">NCRL</th>
                  <td style="border-bottom: 1px solid black;" align="center">11564033</td>
                </tr>
              </tbody>
            </table>
          </table-wrap>
        </p>
        <p>
          <table-wrap id="T5">
            <label>Table 5</label>
            <caption>
              <p>Comparison of model performance on accuracy and parameter number.</p>
            </caption>
            <table>
              <thead>
                <tr>
                  <th style="border-top: 1px solid black;" rowspan="2" align="center">
                    <bold>Model</bold>
                  </th>
                  <th style="border-top: 1px solid black;" colspan="2" align="center">
                    <bold>Kinship</bold>
                  </th>
                  <th style="border-top: 1px solid black;" colspan="2" align="center">
                    <bold>YAGO3-10</bold>
                  </th>
                  <th style="border-top: 1px solid black;" rowspan="2" align="center">
                    <p>
                      <table-wrap>
                        <table>
                          <tr>
                            <td align="center">
                              <bold>Parameter</bold>
                            </td>
                          </tr>
                          <tr>
                            <td align="center">
                              <bold>number</bold>
                            </td>
                          </tr>
                        </table>
                      </table-wrap>
                    </p>
                  </th>
                  <th style="border-top: 1px solid black;" rowspan="2" align="center">
                    <p>
                      <bold>Parameter number</bold>
                    </p>
                    <p>
                      <bold>Improvement</bold>
                    </p>
                  </th>
                </tr>
                <tr>
                  <th style="border-top: 1px solid black;" align="center">
                    <bold>MAP</bold>
                  </th>
                  <th style="border-top: 1px solid black;" align="center">
                    <bold>Accuracy</bold>
                  </th>
                  <th style="border-top: 1px solid black;" align="center">
                    <bold>MAP</bold>
                  </th>
                  <th style="border-top: 1px solid black;" align="center">
                    <bold>Accuracy</bold>
                  </th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td style="border-top: 1px solid black;" align="center">DeepPath[<xref rid="ref018" ref-type="bibr">18</xref>]</td>
                  <td style="border-top: 1px solid black;" align="center">0.314</td>
                  <td style="border-top: 1px solid black;" align="center">-</td>
                  <td style="border-top: 1px solid black;" align="center">0.594</td>
                  <td style="border-top: 1px solid black;" align="center">-</td>
                  <td style="border-top: 1px solid black;" align="center">644624</td>
                  <td style="border-top: 1px solid black;" align="center">-</td>
                </tr>
                <tr>
                  <td align="center">NeuralLP[<xref rid="ref021" ref-type="bibr">21</xref>]</td>
                  <td align="center">0.088</td>
                  <td align="center">-71.975%</td>
                  <td align="center">0.001</td>
                  <td align="center">-99.832%</td>
                  <td align="center">139936</td>
                  <td align="center">+78.292%</td>
                </tr>
                <tr>
                  <td align="center">DRUM[<xref rid="ref022" ref-type="bibr">22</xref>]</td>
                  <td align="center">0.135</td>
                  <td align="center">-57.006%</td>
                  <td align="center">0.004</td>
                  <td align="center">-99.327%</td>
                  <td align="center">204513</td>
                  <td align="center">+68.274%</td>
                </tr>
                <tr>
                  <td align="center">NCRL[<xref rid="ref024" ref-type="bibr">24</xref>]</td>
                  <td align="center">0.337</td>
                  <td align="center">7.325%</td>
                  <td align="center">0.950</td>
                  <td align="center">59.33%</td>
                  <td align="center">11564033</td>
                  <td align="center">-1693.919%</td>
                </tr>
                <tr>
                  <td align="center">RulE[<xref rid="ref023" ref-type="bibr">23</xref>]</td>
                  <td align="center">0.649</td>
                  <td align="center">106.688%</td>
                  <td align="center">0.697</td>
                  <td align="center">17.340%</td>
                  <td align="center">4722205</td>
                  <td align="center">-632.552%</td>
                </tr>
                <tr>
                  <td style="border-bottom: 1px solid black;" align="center">QIRL</td>
                  <td style="border-bottom: 1px solid black;" align="center">0.326</td>
                  <td style="border-bottom: 1px solid black;" align="center">-0.637%</td>
                  <td style="border-bottom: 1px solid black;" align="center">0.594</td>
                  <td style="border-bottom: 1px solid black;" align="center">-</td>
                  <td style="border-bottom: 1px solid black;" align="center">160</td>
                  <td style="border-bottom: 1px solid black;" align="center">+99.975%</td>
                </tr>
              </tbody>
            </table>
          </table-wrap>
        </p>
        <p id="S6.SS3.p3">Compared with embedding-based methods, path-based methods such as QIRL perform worse on Kinship. Embedding-based methods are reasoning through distance or similarity measures. The relationships in Kinship are mostly simple and symmetrical, and most relationships can be directly learned through geometric relationships in the embedding space. However, path-based methods such as QIRL do not fully utilize the simple structures in the data, so embedding-based models can better leverage their advantages. On YAGO3-10, the performance of embedding-based methods significantly decreases due to the complexity of YAGO3-10 relationship reasoning tasks. At this point, path-based methods such as QIRL can better capture the complex relationships between entities.</p>
        <p id="S6.SS3.p4">The performance of QIRL on Kinship and YAGO3-10 is inferior to path-based methods such as RulE and NCRL. RulE learns explicit logical rules for reasoning and directly utilizes the inherent structure and relationships in the data. Therefore, it can achieve better results on Kinship dataset with clear regularity in relationships. NCRL combines neural networks and logical reasoning, using graph neural networks to process graph structured data, which can effectively learn potential patterns between entities and relationships. Therefore, it can achieve good results in the YAGO3-10 dataset with complex relationships and no clear rules.</p>
        <p id="S6.SS3.p5">Table <xref rid="T4" ref-type="table">4</xref> shows the number of network training parameters for different models. Through comparative analysis, it can be clearly seen that compared to other methods, the QIRL algorithm requires significantly fewer parameters in the model training process, only requiring hundreds of parameters to effectively train the model and achieve excellent results. This feature enables the QIRL algorithm to significantly reduce the computational resource consumption of the model while maintaining efficient training. By significantly reducing the number of parameters, QIRL not only demonstrates significant advantages in memory and computing resources, but also effectively avoids problems such as overfitting, thereby improving the model's generalization ability and robustness in practical applications. Overall, the QIRL algorithm has improved model performance and significantly enhanced computational efficiency by optimizing the number of parameters, demonstrating its potential in complex tasks.</p>
        <p id="S6.SS3.p6">As shown in Table <xref rid="T5" ref-type="table">5</xref>, QIRL significantly reduces the number of model parameter while maintaining high model accuracy. In contrast, other methods typically increase the training parameters to improve accuracy or sacrifice model accuracy in order to reduce the number of parameter. Table <xref rid="T5" ref-type="table">5</xref> compares exclusively neural network-based methods to ensure parameter computability.</p>
      </sec>
    </sec>
    <sec id="S7">
      <label>7.</label>
      <title>Conclusion</title>
      <p id="S7.p1">This paper proposes a quantum reinforcement learning-based knowledge reasoning method, QIRL, which significantly reduces the number of model's training parameter and computational complexity by leveraging quantum advantages through the construction of a quantum circuit to train the policy network. However, most quantum computing still relies on classical computer simulators to test and validate quantum algorithms, and these simulators have much higher storage and computational demands compared to the actual requirements when running on quantum hardware. In the future, further optimization of the quantum reinforcement learning model's performance is expected, aiming to reduce the number of model's training parameter while improving reasoning accuracy.</p>
    </sec>
  </body>
  <back>
    <ack>
      <title>Acknowledgments</title>
      <p id="ack.p1">This work was supported by the Project of Natural Science Foundation of Zhejiang Province under Grant LD24F020009.</p>
    </ack>
    <sec id="sec0100" sec-type="COI-statement">
      <title>Conflict of interest</title>
      <p>The authors declare no conflicts of interest.</p>
    </sec>
    <ref-list>
      <title>References</title>
      <ref id="ref001">
        <label>[1]</label>
        <mixed-citation> Chen, Y., Li, H., Li, H., Liu, W., Wu, Y., Huang, Q., &amp; Wan, S. (2022). An overview of knowledge graph reasoning: key technologies and applications. <italic>Journal of Sensor and Actuator Networks, 11</italic>(4), 78. [<uri>https://doi.org/10.3390/jsan11040078</uri>] </mixed-citation>
      </ref>
      <ref id="ref002">
        <label>[2]</label>
        <mixed-citation> Chen, S., Yang, X., &amp; Li, Z. (2023). Improving semantic segmentation with knowledge reasoning network. <italic>Journal of Visual Communication and Image Representation, 96</italic>, 103923. [<uri>https://doi.org/10.1016/j.jvcir.2023.103923</uri>] </mixed-citation>
      </ref>
      <ref id="ref003">
        <label>[3]</label>
        <mixed-citation> Zhang, Y., &amp; Yao, Q. (2022). Knowledge graph reasoning with relational digraph. <italic>Proceedings of the ACM Web Conference 2022</italic>, 912–924. [<uri>https://doi.org/10.1145/3485447.3512008</uri>] </mixed-citation>
      </ref>
      <ref id="ref004">
        <label>[4]</label>
        <mixed-citation> Chen, S. Y. C. (2023). Asynchronous training of quantum reinforcement learning. <italic>Procedia Computer Science, 222</italic>, 321–330. [<uri>https://doi.org/10.1016/j.procs.2023.08.171</uri>] </mixed-citation>
      </ref>
      <ref id="ref005">
        <label>[5]</label>
        <mixed-citation> Kim, G. S., Chung, J., &amp; Park, S. (2024). Realizing Stabilized Landing for Computation-Limited Reusable Rockets: A Quantum Reinforcement Learning Approach. <italic>IEEE Transactions on Vehicular Technology, 73</italic>(8), 12252–12257. [<uri>https://doi.org/10.1109/TVT.2024.3373901</uri>] </mixed-citation>
      </ref>
      <ref id="ref006">
        <label>[6]</label>
        <mixed-citation> Ansere, J. A., Gyamfi, E., Sharma, V., Shin, H., Dobre, O. A., &amp; Duong, T. Q. (2024). Quantum Deep Reinforcement Learning for Dynamic Resource Allocation in Mobile Edge Computing-Based IoT Systems. <italic>IEEE Transactions on Wireless Communications, 23</italic>(6), 6221–6233. [<uri>https://doi.org/10.1109/TWC.2023.3330868</uri>] </mixed-citation>
      </ref>
      <ref id="ref007">
        <label>[7]</label>
        <mixed-citation> Arute, F., Arya, K., Babbush, R., Bacon, D., Bardin, J. C., Barends, R., … &amp; Boixo, S. (2019). Quantum supremacy using a programmable superconducting processor. <italic>Nature, 574</italic>(7779), 505–510. [<uri>https://doi.org/10.1038/s41586-019-1666-5</uri>] </mixed-citation>
      </ref>
      <ref id="ref008">
        <label>[8]</label>
        <mixed-citation> Kruse, G., Dragan, T., Wille, R., &amp; Lorenz, J. M. (2023). Variational Quantum Circuit Design for Quantum Reinforcement Learning on Continuous Environments. <italic>International Conference on Agents and Artificial Intelligence</italic>. [<uri>https://doi.org/10.5220/0012353100003636</uri>] </mixed-citation>
      </ref>
      <ref id="ref009">
        <label>[9]</label>
        <mixed-citation> Guo, T., Yang, Q., Wang, C., Liu, Y., Li, P., Tang, J., Li, D., &amp; Wen, Y. (2024). Knowledgenavigator: Leveraging large language models for enhanced reasoning over knowledge graph. <italic>Complex &amp; Intelligent Systems, 10</italic>(5), 7063–7076. [<uri>https://doi.org/10.1007/s40747-024-01527-8</uri>] </mixed-citation>
      </ref>
      <ref id="ref010">
        <label>[10]</label>
        <mixed-citation> Chen, S. Y. C., Yang, C. H. H., Qi, J., Chen, P. Y., Ma, X., &amp; Goan, H. S. (2020). Variational quantum circuits for deep reinforcement learning. <italic>IEEE Access, 8</italic>, 141007–141024. [<uri>https://doi.org/10.1109/ACCESS.2020.3010470</uri>] </mixed-citation>
      </ref>
      <ref id="ref011">
        <label>[11]</label>
        <mixed-citation> Bordes, A., Usunier, N., Garcia-Duran, A., Weston, J., &amp; Yakhnenko, O. (2013). Translating embeddings for modeling multi-relational data. <italic>Advances in Neural Information Processing Systems, 26</italic>. </mixed-citation>
      </ref>
      <ref id="ref012">
        <label>[12]</label>
        <mixed-citation> Wang, Z., Zhang, J., Feng, J., &amp; Chen, Z. (2014). Knowledge graph embedding by translating on hyperplanes. <italic>Proceedings of the AAAI Conference on Artificial Intelligence, 28</italic>(1). [<uri>https://doi.org/10.1609/aaai.v28i1.8870</uri>] </mixed-citation>
      </ref>
      <ref id="ref013">
        <label>[13]</label>
        <mixed-citation> Yang, B., Yih, W. T., He, X., Gao, J., &amp; Deng, L. (2014). Embedding Entities and Relations for Learning and Inference in Knowledge Bases. <italic>International Conference on Learning Representations</italic>. [<uri>https://doi.org/10.48550/arXiv.1412.6575</uri>] </mixed-citation>
      </ref>
      <ref id="ref014">
        <label>[14]</label>
        <mixed-citation> Lu, H., Hu, H., &amp; Lin, X. (2022). DensE: An enhanced non-commutative representation for knowledge graph embedding with adaptive semantic hierarchy. <italic>Neurocomputing, 476</italic>, 115–125. [<uri>https://doi.org/10.1016/j.neucom.2021.12.079</uri>] </mixed-citation>
      </ref>
      <ref id="ref015">
        <label>[15]</label>
        <mixed-citation> Pavlović, A., &amp; Sallinger, E. (2023). ExpressivE: A Spatio-Functional Embedding For Knowledge Graph Completion. <italic>The Eleventh International Conference on Learning Representations</italic>. [<uri>https://doi.org/10.34726/5422</uri>] </mixed-citation>
      </ref>
      <ref id="ref016">
        <label>[16]</label>
        <mixed-citation> Dettmers, T., Minervini, P., Stenetorp, P., &amp; Riedel, S. (2018). Convolutional 2d knowledge graph embeddings. <italic>Proceedings of the AAAI Conference on Artificial Intelligence, 32</italic>(1). [<uri>https://doi.org/10.1609/aaai.v32i1.11573</uri>] </mixed-citation>
      </ref>
      <ref id="ref017">
        <label>[17]</label>
        <mixed-citation> Yang, J., Jiang, X., Gao, Y., Yang, L. T., &amp; Yang, J. (2024). Generalize to Fully Unseen Graphs: Learn Transferable Hyper-Relation Structures for Inductive Link Prediction. <italic>Proceedings of the 32nd ACM International Conference on Multimedia</italic>, 1274–1282. </mixed-citation>
      </ref>
      <ref id="ref018">
        <label>[18]</label>
        <mixed-citation> Xiong, W., Hoang, T., &amp; Wang, W. Y. (2017). DeepPath: A Reinforcement Learning Method for Knowledge Graph Reasoning. <italic>Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing</italic>, 564–573. [<uri>https://doi.org/10.18653/v1/d17-1060</uri>] </mixed-citation>
      </ref>
      <ref id="ref019">
        <label>[19]</label>
        <mixed-citation> Sun, Z., Deng, Z. H., Nie, J. Y., &amp; Tang, J. (2019). RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space. <italic>International Conference on Learning Representations</italic>. </mixed-citation>
      </ref>
      <ref id="ref020">
        <label>[20]</label>
        <mixed-citation> Trouillon, T., Welbl, J., Riedel, S., Gaussier, E., &amp; Bouchard, G. (2016). Complex embeddings for simple link prediction. <italic>International Conference on Machine Learning</italic>, 2071–2080. [<uri>https://doi.org/10.5555/3045390.3045609</uri>] </mixed-citation>
      </ref>
      <ref id="ref021">
        <label>[21]</label>
        <mixed-citation> Yang, F., Yang, Z., &amp; Cohen, W. W. (2017). Differentiable learning of logical rules for knowledge base reasoning. <italic>Advances in Neural Information Processing Systems, 30</italic>. [<uri>https://doi.org/10.5555/3294771.3294992</uri>] </mixed-citation>
      </ref>
      <ref id="ref022">
        <label>[22]</label>
        <mixed-citation> Sadeghian, A., Armandpour, M., Ding, P., &amp; Wang, D. Z. (2019). Drum: End-to-end differentiable rule mining on knowledge graphs. <italic>Advances in Neural Information Processing Systems, 32</italic>. [<uri>https://doi.org/10.5555/3454287.3455662</uri>] </mixed-citation>
      </ref>
      <ref id="ref023">
        <label>[23]</label>
        <mixed-citation> Tang, X., Zhu, S. C., Liang, Y., &amp; Zhang, M. (2024). RulE: Knowledge Graph Reasoning with Rule Embedding. <italic>Findings of the Association for Computational Linguistics: ACL 2024</italic>, 4316–4335. [<uri>https://doi.org/10.18653/v1/2024.findings-acl.256</uri>] </mixed-citation>
      </ref>
      <ref id="ref024">
        <label>[24]</label>
        <mixed-citation> Cheng, K., Ahmed, N., &amp; Sun, Y. (2023). Neural Compositional Rule Learning for Knowledge Graph Reasoning. <italic>The Eleventh International Conference on Learning Representations</italic>. </mixed-citation>
      </ref>
      <ref id="ref025">
        <label>[25]</label>
        <mixed-citation> Lao, N., &amp; Cohen, W. W. (2010). Relational retrieval using a combination of path-constrained random walks. <italic>Machine Learning, 81</italic>, 53–67. [<uri>https://doi.org/10.1007/s10994-010-5205-8</uri>] </mixed-citation>
      </ref>
      <ref id="ref026">
        <label>[26]</label>
        <mixed-citation> Buluta, I., &amp; Nori, F. (2009). Quantum Simulators. <italic>Science, 326</italic>(5949), 108–111. [<uri>https://doi.org/10.1126/science.1177838</uri>] </mixed-citation>
      </ref>
      <ref id="ref027">
        <label>[27]</label>
        <mixed-citation> Zhou, Y., Stoudenmire, E. M., &amp; Waintal, X. (2020). What Limits the Simulation of Quantum Computers? <italic>Phys. Rev. X, 10</italic>(4), 041038. [<uri>https://doi.org/10.1103/PhysRevX.10.041038</uri>] </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>
