<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.1 20151215//EN" "http://jats.nlm.nih.gov/publishing/1.1/JATS-journalpublishing1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xml:lang="en" article-type="research-article" dtd-version="1.1">
<front>
<journal-meta>
<journal-id journal-id-type="pmc">CMES</journal-id>
<journal-id journal-id-type="nlm-ta">CMES</journal-id>
<journal-id journal-id-type="publisher-id">CMES</journal-id>
<journal-title-group>
<journal-title>Computer Modeling in Engineering &#x0026; Sciences</journal-title>
</journal-title-group>
<issn pub-type="epub">1526-1506</issn>
<issn pub-type="ppub">1526-1492</issn>
<publisher>
<publisher-name>Tech Science Press</publisher-name>
<publisher-loc>USA</publisher-loc>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="publisher-id">52374</article-id>
<article-id pub-id-type="doi">10.32604/cmes.2024.052374</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Article</subject>
</subj-group>
</article-categories>
<title-group>
<article-title>A Novel Framework to Construct S-Box Quantum Circuits Using System Modeling: Application to 4-Bit S-Boxes</article-title>
<alt-title alt-title-type="left-running-head">A Novel Framework to Construct S-Box Quantum Circuits Using System Modeling: Application to 4-bit S-Boxes</alt-title>
<alt-title alt-title-type="right-running-head">A Novel Framework to Construct S-Box Quantum Circuits Using System Modeling: Application to 4-bit S-Boxes</alt-title>
</title-group>
<contrib-group>
<contrib id="author-1" contrib-type="author">
<name name-style="western"><surname>Jeon</surname><given-names>Yongjin</given-names></name></contrib>
<contrib id="author-2" contrib-type="author">
<name name-style="western"><surname>Baek</surname><given-names>Seungjun</given-names></name><xref ref-type="author-notes" rid="fn1"><sup>#</sup></xref></contrib>
<contrib id="author-3" contrib-type="author" corresp="yes">
<name name-style="western"><surname>Kim</surname><given-names>Jongsung</given-names></name><email>jskim@kookmin.ac.kr</email></contrib>
<aff><institution>Department of Financial Information Security, Kookmin University</institution>, <addr-line>Seoul, 02707</addr-line>, <country>Republic of Korea</country></aff>
</contrib-group>
<author-notes>
<corresp id="cor1"><label>&#x002A;</label>Corresponding Author: Jongsung Kim. Email: <email>jskim@kookmin.ac.kr</email></corresp>
<fn id="fn1"><p><sup>#</sup>Co-first author: Seungjun Baek</p>
</fn>
</author-notes>
<pub-date date-type="collection" publication-format="electronic">
<year>2024</year></pub-date>
<pub-date date-type="pub" publication-format="electronic"><day>20</day><month>8</month><year>2024</year></pub-date>
<volume>141</volume>
<issue>1</issue>
<fpage>545</fpage>
<lpage>561</lpage>
<history>
<date date-type="received">
<day>31</day>
<month>3</month>
<year>2024</year>
</date>
<date date-type="accepted">
<day>06</day>
<month>6</month>
<year>2024</year>
</date>
</history>
<permissions>
<copyright-statement>&#x00A9; 2024 The Authors.</copyright-statement>
<copyright-year>2024</copyright-year>
<copyright-holder>Published by Tech Science Press.</copyright-holder>
<license xlink:href="https://creativecommons.org/licenses/by/4.0/">
<license-p>This work is licensed under a <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</ext-link>, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
</license>
</permissions>
<self-uri content-type="pdf" xlink:href="TSP_CMES_52374.pdf"></self-uri>
<abstract>
<p>Quantum computers accelerate many algorithms based on the superposition principle of quantum mechanics. The Grover algorithm provides significant performance to malicious users attacking symmetric key systems. Since the performance of attacks using quantum computers depends on the efficiency of the quantum circuit of the encryption algorithms, research research on the implementation of quantum circuits is essential. This paper presents a new framework to construct quantum circuits of substitution boxes (S-boxes) using system modeling. We model the quantum circuits of S-boxes using two layers: Toffoli and linear layers. We generate vector spaces based on the values of qubits used in the linear layers and apply them to find quantum circuits. The framework finds the circuit by matching elements of vector spaces generated from the input and output of a given S-box, using the forward search or the meet-in-the-middle strategy. We developed a tool to apply this framework to 4-bit S-boxes. While the 4-bit S-box quantum circuit construction tool LIGHTER-R only finds circuits that can be implemented with four qubits, the proposed tool achieves the circuits with five qubits. The proposed tool can find quantum circuits of 4-bit odd permutations based on the controlled NOT, NOT, and Toffoli gates, whereas LIGHTER-R is unable to perform this task in the same environment. We expect this technique to become a critical step toward optimizing S-box quantum circuits.</p>
</abstract>
<kwd-group kwd-group-type="author">
<kwd>System modeling</kwd>
<kwd>quantum circuit</kwd>
<kwd>S-box circuit</kwd>
<kwd>quantum computer</kwd>
</kwd-group>
<funding-group>
<award-group id="awg1">
<funding-source>Institute for Information &#x0026; Communications Technology Planning &#x0026; Evaluation</funding-source>
<award-id>IITP-2024-RS-2022-00164800</award-id>
</award-group>
</funding-group>
</article-meta>
</front>
<body>
<sec id="s1">
<label>1</label>
<title>Introduction</title>
<p>Quantum computers accelerate many algorithms based on the superposition principle of quantum mechanics. Shor&#x2019;s algorithm [<xref ref-type="bibr" rid="ref-1">1</xref>] exponentially reduces the complexity of attacking public-key schemes on quantum computers. Since 2016, the National Institute of Standards and Technology (NIST) has been conducting the post-quantum cryptography standardization process [<xref ref-type="bibr" rid="ref-2">2</xref>]. For symmetric-key schemes, Grover&#x2019;s and Simon&#x2019;s algorithms [<xref ref-type="bibr" rid="ref-3">3</xref>,<xref ref-type="bibr" rid="ref-4">4</xref>] offer attackers significant performance to attack the schemes, but these algorithms do not entirely compromise the security such systems&#x2019;. However, in a quantum computing environment, symmetric-key cryptography may have weak properties not yet studied for each algorithm. Most cryptanalysis, including attacks targeting these vulnerabilities and generic attacks, requires the implementation of cipher&#x2019;s quantum circuits, and its performance depends on the efficiency of the circuit. For future security, research on the implementation of the quantum circuits must be conducted, and it is necessary to know what performance bounds there are.</p>
<p>The substitution box (S-box) is a crucial component that provides confusion in symmetric-key schemes. When implementing a cipher as a quantum circuit, the linear layer can be implemented with only NOT and controlled-NOT (CNOT) gates. However, highly structured nonlinear layers, such as the S-box, must employ relatively expensive Toffoli gates and numerous qubits. In quantum circuits for symmetric-key schemes, the S-box incurs the highest cost.</p>
<p>The complexity of a quantum circuit is evaluated by the number of qubits and the Toffoli-depth defined by the number of non-parallelizable Toffoli gates. Optimizing these two parameters increases the implementation efficiency of quantum computers. This approach improves the attackers&#x2019; ability to perform exhaustive search and dedicated attacks using Grover&#x2019;s algorithm in quantum computer. Hence, optimizing the quantum circuits of S-boxes is critical to assess the security of symmetric-key schemes against quantum computer-based attacks.</p>
<p>Extensive recent research has been conducted on finding efficient quantum circuits for the Advanced Encryption Standard (AES). Grassl et al. [<xref ref-type="bibr" rid="ref-5">5</xref>] initially proposed a quantum circuit for the AES and introduced a zig-zag structure to reduce the number of qubits required for its implementation. Subsequently, several studies have been conducted to reduce the number of qubits to implement the AES [<xref ref-type="bibr" rid="ref-6">6</xref>&#x2013;<xref ref-type="bibr" rid="ref-9">9</xref>]. However, in NIST&#x2019;s post-quantum cryptography standardization process, the Toffoli-depth represents a critical parameter. In response, Jaques et al. [<xref ref-type="bibr" rid="ref-8">8</xref>] attempted to construct an AES quantum circuit with a shallow Toffoli-depth. Recently, Huang et al. [<xref ref-type="bibr" rid="ref-10">10</xref>] proposed an AES quantum circuit with the shallowest depth.</p>
<p>The terms and notations used in this paper are explained as follows:
<list list-type="bullet">
<list-item>
<p>CNOT, NOT, Toffoli gates: Gates used in quantum circuit</p></list-item>
<list-item>
<p>CNT-circuit: Quantum circuit using only CNOT, NOT, and Toffoli gates</p></list-item>
<list-item>
<p>CT-circuit: Quantum circuit using only CNOT and Toffoli gates</p></list-item>
<list-item>
<p><inline-formula id="ieqn-1"><mml:math id="mml-ieqn-1"><mml:mi>n</mml:mi></mml:math></inline-formula>: Size of S-box</p></list-item>
<list-item>
<p><inline-formula id="ieqn-2"><mml:math id="mml-ieqn-2"><mml:mi>q</mml:mi></mml:math></inline-formula>: Number of qubits used in quantum circuit</p></list-item>
<list-item>
<p><inline-formula id="ieqn-3"><mml:math id="mml-ieqn-3"><mml:mrow><mml:mi>&#x1D49E;</mml:mi></mml:mrow></mml:math></inline-formula>: quantum circuit <inline-formula id="ieqn-4"><mml:math id="mml-ieqn-4"><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>&#x03B1;</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mo stretchy="false">&#x2192;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>&#x03B1;</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula></p></list-item>
<list-item>
<p><inline-formula id="ieqn-5"><mml:math id="mml-ieqn-5"><mml:msub><mml:mi>L</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> and <inline-formula id="ieqn-6"><mml:math id="mml-ieqn-6"><mml:msub><mml:mi>T</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>: <inline-formula id="ieqn-7"><mml:math id="mml-ieqn-7"><mml:mi>i</mml:mi></mml:math></inline-formula>-th linear layer and Toffoli layer used in the circuit, respectively</p></list-item>
<list-item>
<p><inline-formula id="ieqn-8"><mml:math id="mml-ieqn-8"><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> and <inline-formula id="ieqn-9"><mml:math id="mml-ieqn-9"><mml:msub><mml:mi>y</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>: The <inline-formula id="ieqn-10"><mml:math id="mml-ieqn-10"><mml:mi>i</mml:mi></mml:math></inline-formula>-th qubits of the input and output of the quantum circuit</p></list-item>
<list-item>
<p><inline-formula id="ieqn-11"><mml:math id="mml-ieqn-11"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>: Vector space corresponding to the <inline-formula id="ieqn-12"><mml:math id="mml-ieqn-12"><mml:mi>i</mml:mi></mml:math></inline-formula>-th linear layer of the quantum circuit</p></list-item>
</list></p>
<p><bold>Contributions.</bold> This paper provides a new framework to construct quantum circuits <inline-formula id="ieqn-13"><mml:math id="mml-ieqn-13"><mml:mrow><mml:mi>&#x1D49E;</mml:mi></mml:mrow><mml:mo>:</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>&#x03B1;</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mo stretchy="false">&#x2192;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>&#x03B1;</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula> of S-boxes. We treat quantum circuits of S-boxes using only CNOT, NOT, and Toffoli gates, called CNT-circuits, using system modeling. Using the CNT-circuits, we provide a framework for finding quantum circuits of the S-boxes with low Toffoli-depths according to a limited number of qubits by matching elements of vector spaces generated from the inputs and outputs of the S-boxes. The framework employs a meet-in-the-middle strategy, in which the key is to analyze the vector spaces spanned by the values before and after the Toffoli layers. The framework provides a specialized search for the Toffoli-depth by ignoring the detailed implementations of the linear layers of S-boxes. To the best of our knowledge, no study has analyzed the Toffoli-depth and number of qubits using a vector space and basis analysis between Toffoli layers in the quantum circuits of S-boxes.</p>
<p>To verify the effectiveness of the framework, we propose a technique and tool for applying the framework to a 4-bit S-box. These components are currently used as essential elements in many Authenticated Encryption with Associated Data (AEAD) schemes and block ciphers [<xref ref-type="bibr" rid="ref-11">11</xref>&#x2013;<xref ref-type="bibr" rid="ref-15">15</xref>]. In addition, <monospace>LIGHTER-R</monospace> [<xref ref-type="bibr" rid="ref-16">16</xref>] provides Toffoli-depth optimized quantum circuits of 4-bit S-boxes with a 4-qubit restriction. However, this approach fails if the target 4-bit S-boxes are odd permutations. This result occurs due to the theorem that odd permutations cannot be implemented with 4 qubits in CNT-circuits and requiress at least 5 qubits [<xref ref-type="bibr" rid="ref-17">17</xref>]. The algorithms offer a wider range of quantum circuits compared to LIGHTER-R in terms of the Toffoli-depth and number of qubits (up to 5). This improvement allows the algorithms to produce the quantum circuits of the 4-bit S-boxes of odd permutations. Given that half of 4-bit S-boxes are odd permutations, this result enables researchers to implement quantum circuits for all 4-bit S-boxes.</p>
<p><bold>Paper Organization.</bold> <xref ref-type="sec" rid="s2">Section 2</xref> describes quantum computation and quantum circuits. <xref ref-type="sec" rid="s3">Section 3</xref> describes the properties of the CNT-circuit and the model in the quantum circuit. <xref ref-type="sec" rid="s4">Section 4</xref> describes the framework for finding quantum circuits of 4-bit S-boxes according to a limited number of qubits. <xref ref-type="sec" rid="s5">Section 5</xref> presents the results of the proposed algorithm in <xref ref-type="sec" rid="s4">Section 4</xref>. <xref ref-type="sec" rid="s6">Section 6</xref> presents the conclusions and provides a discussion.</p>
</sec>
<sec id="s2">
<label>2</label>
<title>Quantum Computation and Quantum Circuits</title>
<p>A fundamental concept in classical computing involves a bit, characterized as either 0 or 1. Conversely, the qubit plays a role as a bit in quantum computing, holding 0 and 1 at the same time according to the superposition principle of quantum mechanics. The values <inline-formula id="ieqn-14"><mml:math id="mml-ieqn-14"><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula> and <inline-formula id="ieqn-15"><mml:math id="mml-ieqn-15"><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula> are orthonormal bases of the two-dimensional Hilbert space, also called the computational basis. The superposition state of a qubit can be represented as <inline-formula id="ieqn-16"><mml:math id="mml-ieqn-16"><mml:mi>&#x03B1;</mml:mi><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mo>+</mml:mo><mml:mi>&#x03B2;</mml:mi><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula> (<inline-formula id="ieqn-17"><mml:math id="mml-ieqn-17"><mml:mi>&#x03B1;</mml:mi><mml:mo>,</mml:mo><mml:mi>&#x03B2;</mml:mi><mml:mo>&#x2208;</mml:mo><mml:mrow><mml:mi mathvariant="double-struck">C</mml:mi></mml:mrow></mml:math></inline-formula>), and <inline-formula id="ieqn-18"><mml:math id="mml-ieqn-18"><mml:mi>&#x03B1;</mml:mi></mml:math></inline-formula> and <inline-formula id="ieqn-19"><mml:math id="mml-ieqn-19"><mml:mi>&#x03B2;</mml:mi></mml:math></inline-formula> are called the complex probability amplitude. The state of the qubit is destroyed by measurement, after which one can observe <inline-formula id="ieqn-20"><mml:math id="mml-ieqn-20"><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula> or <inline-formula id="ieqn-21"><mml:math id="mml-ieqn-21"><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula>, with the respective probabilities of <inline-formula id="ieqn-22"><mml:math id="mml-ieqn-22"><mml:mo fence="false" stretchy="false">&#x007C;</mml:mo><mml:mi>&#x03B1;</mml:mi><mml:msup><mml:mo fence="false" stretchy="false">&#x007C;</mml:mo><mml:mn>2</mml:mn></mml:msup></mml:math></inline-formula> and <inline-formula id="ieqn-23"><mml:math id="mml-ieqn-23"><mml:mo fence="false" stretchy="false">&#x007C;</mml:mo><mml:mi>&#x03B2;</mml:mi><mml:msup><mml:mo fence="false" stretchy="false">&#x007C;</mml:mo><mml:mn>2</mml:mn></mml:msup></mml:math></inline-formula> (thus, <inline-formula id="ieqn-24"><mml:math id="mml-ieqn-24"><mml:mo fence="false" stretchy="false">&#x007C;</mml:mo><mml:mi>&#x03B1;</mml:mi><mml:msup><mml:mo fence="false" stretchy="false">&#x007C;</mml:mo><mml:mn>2</mml:mn></mml:msup><mml:mo>+</mml:mo><mml:mo fence="false" stretchy="false">&#x007C;</mml:mo><mml:mi>&#x03B2;</mml:mi><mml:msup><mml:mo fence="false" stretchy="false">&#x007C;</mml:mo><mml:mn>2</mml:mn></mml:msup><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math></inline-formula> holds). To describe <inline-formula id="ieqn-25"><mml:math id="mml-ieqn-25"><mml:mi>n</mml:mi></mml:math></inline-formula> qubits, we need a <inline-formula id="ieqn-26"><mml:math id="mml-ieqn-26"><mml:msup><mml:mn>2</mml:mn><mml:mi>n</mml:mi></mml:msup></mml:math></inline-formula> dimensional Hilbert space for which the orthonormal bases are <inline-formula id="ieqn-27"><mml:math id="mml-ieqn-27"><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>00</mml:mn><mml:mo>&#x22EF;</mml:mo><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula>, <inline-formula id="ieqn-28"><mml:math id="mml-ieqn-28"><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>00</mml:mn><mml:mo>&#x22EF;</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula>, <inline-formula id="ieqn-29"><mml:math id="mml-ieqn-29"><mml:mo>&#x2026;</mml:mo></mml:math></inline-formula>, <inline-formula id="ieqn-30"><mml:math id="mml-ieqn-30"><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>11</mml:mn><mml:mo>&#x22EF;</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula>, and total <inline-formula id="ieqn-31"><mml:math id="mml-ieqn-31"><mml:msup><mml:mn>2</mml:mn><mml:mi>n</mml:mi></mml:msup></mml:math></inline-formula>.</p>
<p>This work primarily concerns with quantum circuits consisting of CNOT, NOT, and Toffoli gates. A <italic>CNOT</italic> gate is the two-qubit gate defined by <inline-formula id="ieqn-32"><mml:math id="mml-ieqn-32"><mml:mi>C</mml:mi><mml:mi>N</mml:mi><mml:mi>O</mml:mi><mml:mi>T</mml:mi><mml:mo>:</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>a</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>b</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mo stretchy="false">&#x21A6;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>a</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>a</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula>, and a <italic>NOT</italic> gate is the single-qubit gate defined by <inline-formula id="ieqn-33"><mml:math id="mml-ieqn-33"><mml:mi>N</mml:mi><mml:mi>O</mml:mi><mml:mi>T</mml:mi><mml:mo>:</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>a</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mo stretchy="false">&#x21A6;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>a</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula>. A <inline-formula id="ieqn-34"><mml:math id="mml-ieqn-34"><mml:mi>T</mml:mi><mml:mi>o</mml:mi><mml:mi>f</mml:mi><mml:mi>f</mml:mi><mml:mi>o</mml:mi><mml:mi>l</mml:mi><mml:mi>i</mml:mi></mml:math></inline-formula> gate is the three-qubit gate defined by <inline-formula id="ieqn-35"><mml:math id="mml-ieqn-35"><mml:mi>T</mml:mi><mml:mi>o</mml:mi><mml:mi>f</mml:mi><mml:mi>f</mml:mi><mml:mi>o</mml:mi><mml:mi>l</mml:mi><mml:mi>i</mml:mi><mml:mo>:</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>a</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>b</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mo stretchy="false">&#x21A6;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>a</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>b</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>c</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>a</mml:mi><mml:mi>b</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula>. A <inline-formula id="ieqn-36"><mml:math id="mml-ieqn-36"><mml:mi>T</mml:mi><mml:mi>o</mml:mi><mml:mi>f</mml:mi><mml:mi>f</mml:mi><mml:mi>o</mml:mi><mml:mi>l</mml:mi><mml:mi>i</mml:mi></mml:math></inline-formula> gate can handle the XOR and AND of classical gates at once. <xref ref-type="fig" rid="fig-1">Fig. 1</xref> presents these quantum gates.</p>
<fig id="fig-1">
<label>Figure 1</label>
<caption>
<title>CNOT (left), NOT (middle), and Toffoli (right) gates</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-1.tif"/>
</fig>
<p>A quantum circuit using only CNOT, NOT, and Toffoli gates is defined as a CNT-circuit. In the CNT-circuit, the NOT gates can be moved to the circuit&#x2019;s last operation without changing the Toffoli-depth, using the properties in <xref ref-type="fig" rid="fig-2">Fig. 2</xref>. The NOT gates gathered in the last operation are equivalent to using an XORing on a constant value in the S-box. All S-boxes can be implemented with CNT-circuits; thus CT-circuits (without NOT gates) can implement all S-boxes satisfying <inline-formula id="ieqn-37"><mml:math id="mml-ieqn-37"><mml:mn>0</mml:mn><mml:mo stretchy="false">&#x21A6;</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula> [<xref ref-type="bibr" rid="ref-17">17</xref>]. Therefore, only CT-circuits are considered in this paper.</p>
<fig id="fig-2">
<label>Figure 2</label>
<caption>
<title>Properties of NOT gates</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-2.tif"/>
</fig>
</sec>
<sec id="s3">
<label>3</label>
<title>Modeling the Quantum Circuits of S-Boxes</title>
<p>We considered the <inline-formula id="ieqn-38"><mml:math id="mml-ieqn-38"><mml:mi>n</mml:mi></mml:math></inline-formula>-bit S-box defined by the vectorial Boolean function <inline-formula id="ieqn-39"><mml:math id="mml-ieqn-39"><mml:msup><mml:mrow><mml:mi mathvariant="double-struck">F</mml:mi></mml:mrow><mml:mi>n</mml:mi></mml:msup><mml:mo stretchy="false">&#x2192;</mml:mo><mml:msup><mml:mrow><mml:mi mathvariant="double-struck">F</mml:mi></mml:mrow><mml:mi>n</mml:mi></mml:msup></mml:math></inline-formula>. In the circuit of the S-box, <inline-formula id="ieqn-40"><mml:math id="mml-ieqn-40"><mml:mi>n</mml:mi></mml:math></inline-formula> Boolean coordinate functions are represented by wires. Each wire connects to <inline-formula id="ieqn-41"><mml:math id="mml-ieqn-41"><mml:mi>n</mml:mi></mml:math></inline-formula> input bits, and additional wires may be required depending on the circuit. All these wires become qubits in a quantum circuit.</p>
<p>We modeled CT-circuits for <inline-formula id="ieqn-42"><mml:math id="mml-ieqn-42"><mml:mrow><mml:mi>&#x1D49E;</mml:mi></mml:mrow><mml:mo>:</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>&#x03B1;</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mo stretchy="false">&#x2192;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>&#x03B1;</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula> of S-boxes satisfying <inline-formula id="ieqn-43"><mml:math id="mml-ieqn-43"><mml:mn>0</mml:mn><mml:mo stretchy="false">&#x21A6;</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula>. Let <inline-formula id="ieqn-44"><mml:math id="mml-ieqn-44"><mml:mrow><mml:mi>&#x1D49E;</mml:mi></mml:mrow></mml:math></inline-formula> use <inline-formula id="ieqn-45"><mml:math id="mml-ieqn-45"><mml:mi>q</mml:mi></mml:math></inline-formula> qubits with a Toffoli-depth of <inline-formula id="ieqn-46"><mml:math id="mml-ieqn-46"><mml:mi>t</mml:mi></mml:math></inline-formula>. We defined the layers with only Toffoli gates as Toffoli layers and treated the layers between them as linear layers (including empty layers). In addition, <inline-formula id="ieqn-47"><mml:math id="mml-ieqn-47"><mml:mrow><mml:mi>&#x1D49E;</mml:mi></mml:mrow></mml:math></inline-formula> has <inline-formula id="ieqn-48"><mml:math id="mml-ieqn-48"><mml:mi>t</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:math></inline-formula> linear layers, including the outermost two linear layers. We denote the <inline-formula id="ieqn-49"><mml:math id="mml-ieqn-49"><mml:mi>i</mml:mi></mml:math></inline-formula>-th Toffoli layer as <inline-formula id="ieqn-50"><mml:math id="mml-ieqn-50"><mml:msub><mml:mi>T</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> and the <inline-formula id="ieqn-51"><mml:math id="mml-ieqn-51"><mml:mi>i</mml:mi></mml:math></inline-formula>-th linear layer as <inline-formula id="ieqn-52"><mml:math id="mml-ieqn-52"><mml:msub><mml:mi>L</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>. We established the indices of the layers as represented in <xref ref-type="disp-formula" rid="eqn-1">Eq. (1)</xref>. The CNOT gates can be implemented without additional qubits [<xref ref-type="bibr" rid="ref-18">18</xref>], and their cost is exempted from the analysis model. Therefore, we omitted the detailed implementation of CNOT gates in the linear layer.
<disp-formula id="eqn-1"><label>(1)</label><mml:math id="mml-eqn-1" display="block"><mml:mrow><mml:mi>&#x1D49E;</mml:mi></mml:mrow><mml:mo>:</mml:mo><mml:msub><mml:mi>L</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:mo>&#x2218;</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mi>t</mml:mi></mml:msub><mml:mo>&#x2218;</mml:mo><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>&#x2218;</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>&#x2218;</mml:mo><mml:mo>&#x22EF;</mml:mo><mml:mo>&#x2218;</mml:mo><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>&#x2218;</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>&#x2218;</mml:mo><mml:msub><mml:mi>L</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>.</mml:mo></mml:math></disp-formula></p>
<p>To facilitate finding the circuit, we arranged the Toffoli gates in order within the Toffoli layers. We assumed that the control and target qubit positions of the Toffoli gates are fixed, and the exchange of wires that occurs while fixing them is absorbed by the linear layers. In detail, the control qubits of the <inline-formula id="ieqn-53"><mml:math id="mml-ieqn-53"><mml:mi>i</mml:mi></mml:math></inline-formula>-th Toffoli gate use the <inline-formula id="ieqn-54"><mml:math id="mml-ieqn-54"><mml:mo stretchy="false">(</mml:mo><mml:mn>3</mml:mn><mml:mi>i</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>2</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula>-th and <inline-formula id="ieqn-55"><mml:math id="mml-ieqn-55"><mml:mo stretchy="false">(</mml:mo><mml:mn>3</mml:mn><mml:mi>i</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula>-th qubits, and the <inline-formula id="ieqn-56"><mml:math id="mml-ieqn-56"><mml:mn>3</mml:mn><mml:mi>i</mml:mi></mml:math></inline-formula>-th qubit serves as the target qubit. Afterward, Toffoli gates are arranged consecutively in the Toffoli layers. <xref ref-type="fig" rid="fig-3">Fig. 3</xref> depicts a Toffoli layer using <inline-formula id="ieqn-57"><mml:math id="mml-ieqn-57"><mml:mi>k</mml:mi></mml:math></inline-formula> Toffoli gates.</p>
<fig id="fig-3">
<label>Figure 3</label>
<caption>
<title>Toffoli layer in the proposed model</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-3.tif"/>
</fig>
<p>Implementing linear layers is equivalent to knowing their input and output values. When Toffoli layers are implemented, the input value of the following linear layer can be determined through the output values of the previous linear layer. If the output values of <inline-formula id="ieqn-58"><mml:math id="mml-ieqn-58"><mml:mi>t</mml:mi></mml:math></inline-formula> linear layers are determined, the entire circuit can be implemented.</p>
<p>The qubit values at each point represent the input and output of the linear layer. We treated the qubit values as Boolean functions, and considered the vector space spanned by them. The vector spaces spanned at the input and output points of the linear layer are identical. We defined the vector space generated by <inline-formula id="ieqn-59"><mml:math id="mml-ieqn-59"><mml:msub><mml:mi>L</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> as <inline-formula id="ieqn-60"><mml:math id="mml-ieqn-60"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>, and each <inline-formula id="ieqn-61"><mml:math id="mml-ieqn-61"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> is transformed into <inline-formula id="ieqn-62"><mml:math id="mml-ieqn-62"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> by <inline-formula id="ieqn-63"><mml:math id="mml-ieqn-63"><mml:msub><mml:mi>T</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> corresponding to the <inline-formula id="ieqn-64"><mml:math id="mml-ieqn-64"><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula>-th Toffoli layer. In addition, we defined the input and output of the S-box as <inline-formula id="ieqn-65"><mml:math id="mml-ieqn-65"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mo>&#x22EF;</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> and <inline-formula id="ieqn-66"><mml:math id="mml-ieqn-66"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mo>&#x22EF;</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula>, respectively, as follows:
<disp-formula id="ueqn-2"><mml:math id="mml-ueqn-2" display="block"><mml:mi>s</mml:mi><mml:mi>p</mml:mi><mml:mi>a</mml:mi><mml:mi>n</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mo>&#x22EF;</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mn>0</mml:mn></mml:msub><mml:mover><mml:mo stretchy="false">&#x27F6;</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:mover><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mn>1</mml:mn></mml:msub><mml:mover><mml:mo stretchy="false">&#x27F6;</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:mover><mml:mo>&#x22EF;</mml:mo><mml:mover><mml:mo stretchy="false">&#x27F6;</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mi>t</mml:mi></mml:msub></mml:mover><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>t</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>s</mml:mi><mml:mi>p</mml:mi><mml:mi>a</mml:mi><mml:mi>n</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mo>&#x22EF;</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>n</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>.</mml:mo></mml:math></disp-formula></p>
</sec>
<sec id="s4">
<label>4</label>
<title>Exploring 4-Bit S-Box Quantum Circuits with the Meet-in-the-Middle Strategy: Up to 5 Qubits</title>
<sec id="s4_1">
<label>4.1</label>
<title>Properties between Neighboring Vector Spaces</title>
<p>Let <inline-formula id="ieqn-67"><mml:math id="mml-ieqn-67"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> be a vector space spanning <inline-formula id="ieqn-68"><mml:math id="mml-ieqn-68"><mml:msub><mml:mi>L</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>. Quantum circuits comprise reversible gates; thus, these circuits can be implemented in forward and backward directions.
<disp-formula id="ueqn-3"><mml:math id="mml-ueqn-3" display="block"><mml:mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true"><mml:mtr><mml:mtd><mml:mrow><mml:mtext mathvariant="bold">forward:</mml:mtext></mml:mrow><mml:mtext>&#xA0;</mml:mtext></mml:mtd><mml:mtd><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mn>0</mml:mn></mml:msub><mml:mo stretchy="false">&#x2192;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mn>1</mml:mn></mml:msub><mml:mo stretchy="false">&#x2192;</mml:mo><mml:mo>&#x22EF;</mml:mo><mml:mo stretchy="false">&#x2192;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>t</mml:mi></mml:msub><mml:mo>,</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mtext mathvariant="bold">backward:</mml:mtext></mml:mrow><mml:mtext>&#xA0;</mml:mtext></mml:mtd><mml:mtd><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>t</mml:mi></mml:msub><mml:mo stretchy="false">&#x2192;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo stretchy="false">&#x2192;</mml:mo><mml:mo>&#x22EF;</mml:mo><mml:mo stretchy="false">&#x2192;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mn>0</mml:mn></mml:msub><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula></p>
<p>Of the three qubits included in one Toffoli gate, only the target qubit changes in value. There are invariant qubit values; hence the intersection of two consecutive spaces, <inline-formula id="ieqn-69"><mml:math id="mml-ieqn-69"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> and <inline-formula id="ieqn-70"><mml:math id="mml-ieqn-70"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula>, is non-empty. This feature is also reflected in the intersection of <inline-formula id="ieqn-71"><mml:math id="mml-ieqn-71"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> and <inline-formula id="ieqn-72"><mml:math id="mml-ieqn-72"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mi>r</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> for a sufficiently small <inline-formula id="ieqn-73"><mml:math id="mml-ieqn-73"><mml:mi>r</mml:mi></mml:math></inline-formula>. This logic is generalized in Theorem 1 and depicted in <xref ref-type="fig" rid="fig-4">Fig. 4</xref>.</p>
<fig id="fig-4">
<label>Figure 4</label>
<caption>
<title>Depiction of Theorem 1</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-4.tif"/>
</fig>
<p><bold>Theorem 1.</bold> Define the CT-circuit of S-box <italic>S</italic> as <inline-formula id="ieqn-74"><mml:math id="mml-ieqn-74"><mml:mrow><mml:mi>&#x1D49E;</mml:mi></mml:mrow><mml:mo>:</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>&#x03B1;</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mo stretchy="false">&#x2192;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>&#x03B1;</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula>. If the circuit uses <inline-formula id="ieqn-75"><mml:math id="mml-ieqn-75"><mml:mi>q</mml:mi></mml:math></inline-formula> qubits and has Toffoli-depth <inline-formula id="ieqn-76"><mml:math id="mml-ieqn-76"><mml:mi>t</mml:mi></mml:math></inline-formula>, for any <inline-formula id="ieqn-77"><mml:math id="mml-ieqn-77"><mml:mi>i</mml:mi><mml:mo>&#x2264;</mml:mo><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>r</mml:mi></mml:math></inline-formula>,
<disp-formula id="ueqn-4"><mml:math id="mml-ueqn-4" display="block"><mml:mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true"><mml:mtr><mml:mtd><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>&#x2212;</mml:mo><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x2229;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mi>r</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>&#x2264;</mml:mo><mml:mi>r</mml:mi><mml:mo fence="false" stretchy="false">&#x230A;</mml:mo><mml:mi>q</mml:mi><mml:mrow><mml:mo>/</mml:mo></mml:mrow><mml:mn>3</mml:mn><mml:mo fence="false" stretchy="false">&#x230B;</mml:mo><mml:mo>,</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mi>r</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>&#x2212;</mml:mo><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x2229;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mi>r</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>&#x2264;</mml:mo><mml:mi>r</mml:mi><mml:mo fence="false" stretchy="false">&#x230A;</mml:mo><mml:mi>q</mml:mi><mml:mrow><mml:mo>/</mml:mo></mml:mrow><mml:mn>3</mml:mn><mml:mo fence="false" stretchy="false">&#x230B;</mml:mo><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula></p>
<p><bold>Proof.</bold> There are <inline-formula id="ieqn-78"><mml:math id="mml-ieqn-78"><mml:mi>r</mml:mi></mml:math></inline-formula> Toffoli layers between the points of <inline-formula id="ieqn-79"><mml:math id="mml-ieqn-79"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> and <inline-formula id="ieqn-80"><mml:math id="mml-ieqn-80"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mi>r</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>. A maximum of <inline-formula id="ieqn-81"><mml:math id="mml-ieqn-81"><mml:mo fence="false" stretchy="false">&#x230A;</mml:mo><mml:mi>q</mml:mi><mml:mrow><mml:mo>/</mml:mo></mml:mrow><mml:mn>3</mml:mn><mml:mo fence="false" stretchy="false">&#x230B;</mml:mo></mml:math></inline-formula> Toffoli gates can be used in one Toffoli layer; hence, at most, <inline-formula id="ieqn-82"><mml:math id="mml-ieqn-82"><mml:mi>r</mml:mi><mml:mo fence="false" stretchy="false">&#x230A;</mml:mo><mml:mi>q</mml:mi><mml:mrow><mml:mo>/</mml:mo></mml:mrow><mml:mn>3</mml:mn><mml:mo fence="false" stretchy="false">&#x230B;</mml:mo></mml:math></inline-formula> values are not in <inline-formula id="ieqn-83"><mml:math id="mml-ieqn-83"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>. Therefore, we obtain <inline-formula id="ieqn-84"><mml:math id="mml-ieqn-84"><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>&#x2212;</mml:mo><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x2229;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mi>r</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>&#x2264;</mml:mo><mml:mi>r</mml:mi><mml:mo fence="false" stretchy="false">&#x230A;</mml:mo><mml:mi>q</mml:mi><mml:mrow><mml:mo>/</mml:mo></mml:mrow><mml:mn>3</mml:mn><mml:mo fence="false" stretchy="false">&#x230B;</mml:mo></mml:math></inline-formula>. The lower equation is found using a similar process. &#x25A0;</p>
<p>According to the above theorem, the lower bound of the Toffoli-depth is found for the quantum circuit <inline-formula id="ieqn-85"><mml:math id="mml-ieqn-85"><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>&#x03B1;</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mo stretchy="false">&#x2192;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>&#x03B1;</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula>. The output of the S-box can be expressed by concatenating the outputs of <inline-formula id="ieqn-86"><mml:math id="mml-ieqn-86"><mml:mi>n</mml:mi></mml:math></inline-formula> Boolean functions. The linear combination of these Boolean functions is called a <italic>component function</italic>. The <italic>zero function</italic>, a constant function that outputs only 0, is excluded from the definition of the component function. A Boolean function <inline-formula id="ieqn-87"><mml:math id="mml-ieqn-87"><mml:mi>f</mml:mi></mml:math></inline-formula> that satisfies <inline-formula id="ieqn-88"><mml:math id="mml-ieqn-88"><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>x</mml:mi><mml:mo>+</mml:mo><mml:mi>y</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>x</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>+</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>y</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> for all values of <inline-formula id="ieqn-89"><mml:math id="mml-ieqn-89"><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>&#x2208;</mml:mo><mml:msubsup><mml:mrow><mml:mi>&#x2131;</mml:mi></mml:mrow><mml:mn>2</mml:mn><mml:mi>n</mml:mi></mml:msubsup></mml:math></inline-formula> is called a Boolean <italic>linear function</italic>.</p>
<p><bold>Theorem 2.</bold> For <inline-formula id="ieqn-90"><mml:math id="mml-ieqn-90"><mml:mi>n</mml:mi><mml:mo>&#x2265;</mml:mo><mml:mn>3</mml:mn></mml:math></inline-formula>, let <inline-formula id="ieqn-91"><mml:math id="mml-ieqn-91"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mn>0</mml:mn></mml:msub></mml:math></inline-formula> be the set of all <inline-formula id="ieqn-92"><mml:math id="mml-ieqn-92"><mml:mi>n</mml:mi></mml:math></inline-formula>-variable Boolean linear functions, and let <inline-formula id="ieqn-93"><mml:math id="mml-ieqn-93"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>t</mml:mi></mml:msub></mml:math></inline-formula> be the set of all component functions of the S-box <italic>S</italic> (including the zero function). Then, the Toffoli-depth of the quantum circuit <inline-formula id="ieqn-94"><mml:math id="mml-ieqn-94"><mml:mrow><mml:mi>&#x1D49E;</mml:mi></mml:mrow><mml:mo>:</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>&#x03B1;</mml:mi></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mo stretchy="false">&#x2192;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mi>S</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>&#x03B1;</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow><mml:mo fence="false" stretchy="false">&#x27E9;</mml:mo></mml:math></inline-formula> of <inline-formula id="ieqn-95"><mml:math id="mml-ieqn-95"><mml:mi>n</mml:mi></mml:math></inline-formula>-bit <italic>S</italic> using <inline-formula id="ieqn-96"><mml:math id="mml-ieqn-96"><mml:mi>q</mml:mi></mml:math></inline-formula>-qubit is <inline-formula id="ieqn-97"><mml:math id="mml-ieqn-97"><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mn>0</mml:mn></mml:msub><mml:mo>&#x2229;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>t</mml:mi></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">)</mml:mo><mml:mrow><mml:mo>/</mml:mo></mml:mrow><mml:mo fence="false" stretchy="false">&#x230A;</mml:mo><mml:mi>q</mml:mi><mml:mrow><mml:mo>/</mml:mo></mml:mrow><mml:mn>3</mml:mn><mml:mo fence="false" stretchy="false">&#x230B;</mml:mo></mml:math></inline-formula> or greater.</p>
<p><bold>Proof.</bold> This situation is a special case where <inline-formula id="ieqn-98"><mml:math id="mml-ieqn-98"><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula> and <inline-formula id="ieqn-99"><mml:math id="mml-ieqn-99"><mml:mi>r</mml:mi><mml:mo>=</mml:mo><mml:mi>t</mml:mi></mml:math></inline-formula> in Theorem 1. The proof is as follows:
<disp-formula id="ueqn-5"><mml:math id="mml-ueqn-5" display="block"><mml:mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true"><mml:mtr><mml:mtd><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mn>0</mml:mn></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>&#x2212;</mml:mo><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mn>0</mml:mn></mml:msub><mml:mo>&#x2229;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mtd><mml:mtd><mml:mi>&#x00A0;</mml:mi><mml:mo>&#x2264;</mml:mo><mml:mi>t</mml:mi><mml:mo fence="false" stretchy="false">&#x230A;</mml:mo><mml:mi>q</mml:mi><mml:mrow><mml:mo>/</mml:mo></mml:mrow><mml:mn>3</mml:mn><mml:mo fence="false" stretchy="false">&#x230B;</mml:mo><mml:mo>,</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi>n</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mn>0</mml:mn></mml:msub><mml:mo>&#x2229;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mtd><mml:mtd><mml:mi>&#x00A0;</mml:mi><mml:mo>&#x2264;</mml:mo><mml:mi>t</mml:mi><mml:mo fence="false" stretchy="false">&#x230A;</mml:mo><mml:mi>q</mml:mi><mml:mrow><mml:mo>/</mml:mo></mml:mrow><mml:mn>3</mml:mn><mml:mo fence="false" stretchy="false">&#x230B;</mml:mo><mml:mo>,</mml:mo></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo stretchy="false">(</mml:mo><mml:mi>n</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mn>0</mml:mn></mml:msub><mml:mo>&#x2229;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">)</mml:mo><mml:mrow><mml:mo>/</mml:mo></mml:mrow><mml:mo fence="false" stretchy="false">&#x230A;</mml:mo><mml:mi>q</mml:mi><mml:mrow><mml:mo>/</mml:mo></mml:mrow><mml:mn>3</mml:mn><mml:mo fence="false" stretchy="false">&#x230B;</mml:mo></mml:mtd><mml:mtd><mml:mi>&#x00A0;</mml:mi><mml:mo>&#x2264;</mml:mo><mml:mi>t</mml:mi><mml:mo>.</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula></p>
<p>&#x25A0;</p>
<p>We consider both forward and backward directions. The proposed algorithms confirm how many values of the newly constructed vector space belong to the opposite vector space. For example, we consider that <inline-formula id="ieqn-100"><mml:math id="mml-ieqn-100"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> and <inline-formula id="ieqn-101"><mml:math id="mml-ieqn-101"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> are obtained by implementing up to the <inline-formula id="ieqn-102"><mml:math id="mml-ieqn-102"><mml:mi>i</mml:mi></mml:math></inline-formula>-th Toffoli layer in the forward direction and the <inline-formula id="ieqn-103"><mml:math id="mml-ieqn-103"><mml:mi>j</mml:mi></mml:math></inline-formula>-th Toffoli layer in the backward direction. The algorithms select <inline-formula id="ieqn-104"><mml:math id="mml-ieqn-104"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> which yields the greatest intersection with <inline-formula id="ieqn-105"><mml:math id="mml-ieqn-105"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, to implement the <inline-formula id="ieqn-106"><mml:math id="mml-ieqn-106"><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula>-th Toffoli layer in the forward direction. In this case, <inline-formula id="ieqn-107"><mml:math id="mml-ieqn-107"><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo>&#x2229;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow><mml:mo>&#x003C;</mml:mo><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>&#x2229;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> holds, and if <inline-formula id="ieqn-108"><mml:math id="mml-ieqn-108"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><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:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, the circuit is completely implemented.</p>
</sec>
<sec id="s4_2">
<label>4.2</label>
<title>Exploring 4-Bit S-Box Quantum Circuits in the Forward Direction</title>
<p>We describe the process of implementing the 4-bit S-box <inline-formula id="ieqn-109"><mml:math id="mml-ieqn-109"><mml:mi>S</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>3</mml:mn></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn>3</mml:mn></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> using 4 and 5 qubits. Due to the limited number of qubits, only one Toffoli gate is in each Toffoli layer. Let <inline-formula id="ieqn-110"><mml:math id="mml-ieqn-110"><mml:msub><mml:mrow><mml:mi mathvariant="fraktur">P</mml:mi></mml:mrow><mml:mn>0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mi>s</mml:mi><mml:mi>p</mml:mi><mml:mi>a</mml:mi><mml:mi>n</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>3</mml:mn></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> and <inline-formula id="ieqn-111"><mml:math id="mml-ieqn-111"><mml:msub><mml:mrow><mml:mi mathvariant="fraktur">P</mml:mi></mml:mrow><mml:mi>t</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi>s</mml:mi><mml:mi>p</mml:mi><mml:mi>a</mml:mi><mml:mi>n</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mn>3</mml:mn></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula>. If <inline-formula id="ieqn-112"><mml:math id="mml-ieqn-112"><mml:msub><mml:mrow><mml:mi mathvariant="fraktur">P</mml:mi></mml:mrow><mml:mn>0</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi mathvariant="fraktur">P</mml:mi></mml:mrow><mml:mi>t</mml:mi></mml:msub></mml:math></inline-formula> holds, <italic>S</italic> is a linear function; thus, the Toffoli-depth is zero. The linear function can be implemented without ancilla qubits (i.e., with 4 qubits). The proposed algorithm takes vector space pairs using the definition below.</p>
<p><bold>Definition 1.</bold> The pair of vector spaces in the forward and backward directions are denoted as <inline-formula id="ieqn-113"><mml:math id="mml-ieqn-113"><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mo>,</mml:mo><mml:msup><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:msup><mml:mi>&#x00A0;</mml:mi><mml:mo>&#x2032;</mml:mo></mml:msup></mml:mrow></mml:msup><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula>. <inline-formula id="ieqn-114"><mml:math id="mml-ieqn-114"><mml:mrow><mml:mi>&#x1D4B4;</mml:mi></mml:mrow></mml:math></inline-formula> represents the vector space that lies ahead of or is equal to <inline-formula id="ieqn-115"><mml:math id="mml-ieqn-115"><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow></mml:math></inline-formula> in the forward direction, whereas <inline-formula id="ieqn-116"><mml:math id="mml-ieqn-116"><mml:msup><mml:mrow><mml:mi>&#x1D4B4;</mml:mi></mml:mrow><mml:mrow><mml:msup><mml:mi>&#x00A0;</mml:mi><mml:mo>&#x2032;</mml:mo></mml:msup></mml:mrow></mml:msup></mml:math></inline-formula> represents the vector space that lies ahead or is equal to <inline-formula id="ieqn-117"><mml:math id="mml-ieqn-117"><mml:msup><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:msup><mml:mi>&#x00A0;</mml:mi><mml:mo>&#x2032;</mml:mo></mml:msup></mml:mrow></mml:msup></mml:math></inline-formula> in the backward direction. <inline-formula id="ieqn-118"><mml:math id="mml-ieqn-118"><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>&#x1D4B4;</mml:mi></mml:mrow><mml:mo>,</mml:mo><mml:msup><mml:mrow><mml:mi>&#x1D4B4;</mml:mi></mml:mrow><mml:mrow><mml:msup><mml:mi>&#x00A0;</mml:mi><mml:mo>&#x2032;</mml:mo></mml:msup></mml:mrow></mml:msup><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> is <italic>closer</italic> than <inline-formula id="ieqn-119"><mml:math id="mml-ieqn-119"><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mo>,</mml:mo><mml:msup><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:msup><mml:mi>&#x00A0;</mml:mi><mml:mo>&#x2032;</mml:mo></mml:msup></mml:mrow></mml:msup><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> if one of the following conditions is satisfied:
<list list-type="bullet">
<list-item>
<p><inline-formula id="ieqn-120"><mml:math id="mml-ieqn-120"><mml:mrow><mml:mi>&#x1D4B4;</mml:mi></mml:mrow><mml:mo>=</mml:mo><mml:msup><mml:mrow><mml:mi>&#x1D4B4;</mml:mi></mml:mrow><mml:mrow><mml:msup><mml:mi>&#x00A0;</mml:mi><mml:mo>&#x2032;</mml:mo></mml:msup></mml:mrow></mml:msup></mml:math></inline-formula> holds, or</p></list-item>
<list-item>
<p><inline-formula id="ieqn-121"><mml:math id="mml-ieqn-121"><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>&#x1D4B4;</mml:mi></mml:mrow><mml:mo>&#x2229;</mml:mo><mml:msup><mml:mrow><mml:mi>&#x1D4B4;</mml:mi></mml:mrow><mml:mrow><mml:msup><mml:mi>&#x00A0;</mml:mi><mml:mo>&#x2032;</mml:mo></mml:msup></mml:mrow></mml:msup><mml:mo>)</mml:mo></mml:mrow><mml:mo>&gt;</mml:mo><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mo>&#x2229;</mml:mo><mml:msup><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:msup><mml:mi>&#x00A0;</mml:mi><mml:mo>&#x2032;</mml:mo></mml:msup></mml:mrow></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.</p></list-item>
</list></p>
<p>We defined the vector space corresponding to the <inline-formula id="ieqn-122"><mml:math id="mml-ieqn-122"><mml:mi>i</mml:mi></mml:math></inline-formula>-th linear layer in the forward direction as <inline-formula id="ieqn-123"><mml:math id="mml-ieqn-123"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> and the vector space corresponding to the <inline-formula id="ieqn-124"><mml:math id="mml-ieqn-124"><mml:mi>j</mml:mi></mml:math></inline-formula>-th linear layer in the backward direction as <inline-formula id="ieqn-125"><mml:math id="mml-ieqn-125"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>. The algorithms take <inline-formula id="ieqn-126"><mml:math id="mml-ieqn-126"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> as input, and <inline-formula id="ieqn-127"><mml:math id="mml-ieqn-127"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><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:mrow><mml:mi>&#x1D4B4;</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> as output, which is a closer pair than <inline-formula id="ieqn-128"><mml:math id="mml-ieqn-128"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula>. In addition, <inline-formula id="ieqn-129"><mml:math id="mml-ieqn-129"><mml:mrow><mml:mi>&#x1D4B4;</mml:mi></mml:mrow></mml:math></inline-formula> can be either <inline-formula id="ieqn-130"><mml:math id="mml-ieqn-130"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> or <inline-formula id="ieqn-131"><mml:math id="mml-ieqn-131"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula>.</p>
<fig id="fig-7">
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-7.tif"/>
</fig>
<p>Algorithm 1 finds the vector space pairs only in the forward direction. If we generate a set <inline-formula id="ieqn-151"><mml:math id="mml-ieqn-151"><mml:msubsup><mml:mi>F</mml:mi><mml:mrow><mml:mo stretchy="false">&#x2192;</mml:mo></mml:mrow><mml:mi>i</mml:mi></mml:msubsup></mml:math></inline-formula> that collects all possible target qubit values after the <inline-formula id="ieqn-152"><mml:math id="mml-ieqn-152"><mml:mo stretchy="false">(</mml:mo><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula>-th Toffoli layer <inline-formula id="ieqn-153"><mml:math id="mml-ieqn-153"><mml:msub><mml:mi>T</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula>, then
<disp-formula id="ueqn-6"><mml:math id="mml-ueqn-6" display="block"><mml:msubsup><mml:mi>F</mml:mi><mml:mrow><mml:mo stretchy="false">&#x2192;</mml:mo></mml:mrow><mml:mi>i</mml:mi></mml:msubsup><mml:mo>=</mml:mo><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mi>a</mml:mi><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>c</mml:mi><mml:mo fence="false" stretchy="false">|</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mo>&#x2260;</mml:mo><mml:mi>a</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo>&#x2208;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mrow><mml:mtext>if&#xA0;</mml:mtext></mml:mrow><mml:mi>q</mml:mi><mml:mo>=</mml:mo><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mtext>, then&#xA0;</mml:mtext></mml:mrow><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mrow><mml:mtext>and&#xA0;</mml:mtext></mml:mrow><mml:mi>c</mml:mi><mml:mrow><mml:mtext>&#xA0;are linearly independent</mml:mtext></mml:mrow><mml:mo fence="false" stretchy="false">}</mml:mo><mml:mo>.</mml:mo></mml:math></disp-formula></p>
<p>We consider quantum circuits with <inline-formula id="ieqn-154"><mml:math id="mml-ieqn-154"><mml:mi>q</mml:mi></mml:math></inline-formula>-qubit. When <inline-formula id="ieqn-155"><mml:math id="mml-ieqn-155"><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mi>q</mml:mi></mml:math></inline-formula>, the values of all qubits at the input point of <inline-formula id="ieqn-156"><mml:math id="mml-ieqn-156"><mml:msub><mml:mi>T</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> form a basis for <inline-formula id="ieqn-157"><mml:math id="mml-ieqn-157"><mml:msub><mml:mi>T</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula>, such that the elements of this set are independent of each other.</p>
<p>There can be several combinations of <inline-formula id="ieqn-158"><mml:math id="mml-ieqn-158"><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo>&#x2208;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> that satisfy <inline-formula id="ieqn-159"><mml:math id="mml-ieqn-159"><mml:mi>a</mml:mi><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>c</mml:mi><mml:mo>&#x2208;</mml:mo><mml:msubsup><mml:mi>F</mml:mi><mml:mrow><mml:mo stretchy="false">&#x2192;</mml:mo></mml:mrow><mml:mi>i</mml:mi></mml:msubsup></mml:math></inline-formula>. For each <inline-formula id="ieqn-160"><mml:math id="mml-ieqn-160"><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi></mml:math></inline-formula>, and <inline-formula id="ieqn-161"><mml:math id="mml-ieqn-161"><mml:mi>c</mml:mi></mml:math></inline-formula>, we can construct a basis <inline-formula id="ieqn-162"><mml:math id="mml-ieqn-162"><mml:msub><mml:mi>B</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> of <inline-formula id="ieqn-163"><mml:math id="mml-ieqn-163"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>, where <inline-formula id="ieqn-164"><mml:math id="mml-ieqn-164"><mml:msub><mml:mi>B</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> must be constructed so that <inline-formula id="ieqn-165"><mml:math id="mml-ieqn-165"><mml:mi>a</mml:mi></mml:math></inline-formula> and <inline-formula id="ieqn-166"><mml:math id="mml-ieqn-166"><mml:mi>b</mml:mi></mml:math></inline-formula> belong to it. If <inline-formula id="ieqn-167"><mml:math id="mml-ieqn-167"><mml:mi>c</mml:mi></mml:math></inline-formula> is linearly independent of <inline-formula id="ieqn-168"><mml:math id="mml-ieqn-168"><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo fence="false" stretchy="false">}</mml:mo></mml:math></inline-formula>, <inline-formula id="ieqn-169"><mml:math id="mml-ieqn-169"><mml:mi>c</mml:mi></mml:math></inline-formula> is also adjusted to belong to <inline-formula id="ieqn-170"><mml:math id="mml-ieqn-170"><mml:msub><mml:mi>B</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>. Let <inline-formula id="ieqn-171"><mml:math id="mml-ieqn-171"><mml:mi>d</mml:mi></mml:math></inline-formula> and <inline-formula id="ieqn-172"><mml:math id="mml-ieqn-172"><mml:mi>e</mml:mi></mml:math></inline-formula> be linearly independent of <inline-formula id="ieqn-173"><mml:math id="mml-ieqn-173"><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo fence="false" stretchy="false">}</mml:mo></mml:math></inline-formula> and <inline-formula id="ieqn-174"><mml:math id="mml-ieqn-174"><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi><mml:mo fence="false" stretchy="false">}</mml:mo></mml:math></inline-formula>, respectively. The cases in which <inline-formula id="ieqn-175"><mml:math id="mml-ieqn-175"><mml:msub><mml:mi>B</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> is possible are as follows:
<list list-type="order">
<list-item><p>When <inline-formula id="ieqn-176"><mml:math id="mml-ieqn-176"><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mn>5</mml:mn></mml:math></inline-formula>, <inline-formula id="ieqn-177"><mml:math id="mml-ieqn-177"><mml:msub><mml:mi>B</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo fence="false" stretchy="false">}</mml:mo></mml:math></inline-formula>;</p></list-item>
<list-item><p>When <inline-formula id="ieqn-178"><mml:math id="mml-ieqn-178"><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mn>4</mml:mn></mml:math></inline-formula> holds and <inline-formula id="ieqn-179"><mml:math id="mml-ieqn-179"><mml:mi>c</mml:mi></mml:math></inline-formula> is linearly dependent of <inline-formula id="ieqn-180"><mml:math id="mml-ieqn-180"><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo fence="false" stretchy="false">}</mml:mo></mml:math></inline-formula>, <inline-formula id="ieqn-181"><mml:math id="mml-ieqn-181"><mml:msub><mml:mi>B</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo fence="false" stretchy="false">}</mml:mo></mml:math></inline-formula>;</p></list-item>
<list-item><p>When <inline-formula id="ieqn-182"><mml:math id="mml-ieqn-182"><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mn>4</mml:mn></mml:math></inline-formula> holds and <inline-formula id="ieqn-183"><mml:math id="mml-ieqn-183"><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi></mml:math></inline-formula> are linearly independent, <inline-formula id="ieqn-184"><mml:math id="mml-ieqn-184"><mml:msub><mml:mi>B</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi><mml:mo fence="false" stretchy="false">}</mml:mo></mml:math></inline-formula>.</p></list-item>
</list></p>
<p>Let <inline-formula id="ieqn-185"><mml:math id="mml-ieqn-185"><mml:msub><mml:mi>B</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> be the basis of <inline-formula id="ieqn-186"><mml:math id="mml-ieqn-186"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> to be generated. In Case 1, <inline-formula id="ieqn-187"><mml:math id="mml-ieqn-187"><mml:mi>c</mml:mi></mml:math></inline-formula> changes to <inline-formula id="ieqn-188"><mml:math id="mml-ieqn-188"><mml:mi>a</mml:mi><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>c</mml:mi></mml:math></inline-formula>, resulting in <inline-formula id="ieqn-189"><mml:math id="mml-ieqn-189"><mml:msub><mml:mi>B</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:mo fence="false" stretchy="false">{</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>c</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo fence="false" stretchy="false">}</mml:mo></mml:math></inline-formula>. In Case 2, we add a new basis <inline-formula id="ieqn-190"><mml:math id="mml-ieqn-190"><mml:mi>a</mml:mi><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>c</mml:mi></mml:math></inline-formula>, <inline-formula id="ieqn-191"><mml:math id="mml-ieqn-191"><mml:msub><mml:mi>B</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:mo fence="false" stretchy="false">{</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>c</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi><mml:mo>,</mml:mo><mml:mi>e</mml:mi><mml:mo fence="false" stretchy="false">}</mml:mo></mml:math></inline-formula> holds. In Case 3, <inline-formula id="ieqn-192"><mml:math id="mml-ieqn-192"><mml:mi>c</mml:mi></mml:math></inline-formula> can change to <inline-formula id="ieqn-193"><mml:math id="mml-ieqn-193"><mml:mi>a</mml:mi><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>c</mml:mi></mml:math></inline-formula> or <inline-formula id="ieqn-194"><mml:math id="mml-ieqn-194"><mml:mi>a</mml:mi><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>c</mml:mi></mml:math></inline-formula> can be newly added, and <inline-formula id="ieqn-195"><mml:math id="mml-ieqn-195"><mml:msub><mml:mi>B</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> becomes <inline-formula id="ieqn-196"><mml:math id="mml-ieqn-196"><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>c</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi><mml:mo fence="false" stretchy="false">}</mml:mo></mml:math></inline-formula> or <inline-formula id="ieqn-197"><mml:math id="mml-ieqn-197"><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>a</mml:mi><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>c</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo>,</mml:mo><mml:mi>d</mml:mi><mml:mo fence="false" stretchy="false">}</mml:mo></mml:math></inline-formula>. If <inline-formula id="ieqn-198"><mml:math id="mml-ieqn-198"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><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:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> is closer than <inline-formula id="ieqn-199"><mml:math id="mml-ieqn-199"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> for all cases, we adopt these spaces and store <inline-formula id="ieqn-200"><mml:math id="mml-ieqn-200"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>B</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:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><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:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula>. After this process is performed for all <inline-formula id="ieqn-201"><mml:math id="mml-ieqn-201"><mml:mi>a</mml:mi><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>c</mml:mi></mml:math></inline-formula>, the stored set of <inline-formula id="ieqn-202"><mml:math id="mml-ieqn-202"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>B</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:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><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:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> becomes the output.</p>
</sec>
<sec id="s4_3">
<label>4.3</label>
<title>Exploring 4-Bit S-Box Quantum Circuits Using Meet-in-the-Middle Strategy</title>
<p>We describe Algorithm 2 based on the meet-in-the-middle strategy in the same environment as the previous section. When constructing a circuit, if Algorithm 1 outputs an empty set, we proceed with Algorithm 2, which generates <inline-formula id="ieqn-203"><mml:math id="mml-ieqn-203"><mml:msubsup><mml:mi>F</mml:mi><mml:mrow><mml:mo stretchy="false">&#x2192;</mml:mo></mml:mrow><mml:mi>i</mml:mi></mml:msubsup></mml:math></inline-formula> in the same way as Algorithm 1. Subsequently, we create a set <inline-formula id="ieqn-204"><mml:math id="mml-ieqn-204"><mml:msubsup><mml:mi>F</mml:mi><mml:mrow><mml:mo stretchy="false">&#x2190;</mml:mo></mml:mrow><mml:mi>j</mml:mi></mml:msubsup></mml:math></inline-formula> that collects all the target qubit values that the Toffoli gates in <inline-formula id="ieqn-205"><mml:math id="mml-ieqn-205"><mml:msub><mml:mi>T</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> can have.
<disp-formula id="ueqn-7"><mml:math id="mml-ueqn-7" display="block"><mml:msubsup><mml:mi>F</mml:mi><mml:mrow><mml:mo stretchy="false">&#x2190;</mml:mo></mml:mrow><mml:mi>j</mml:mi></mml:msubsup><mml:mo>=</mml:mo><mml:mo fence="false" stretchy="false">{</mml:mo><mml:mi>&#x03B1;</mml:mi><mml:mi>&#x03B2;</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>&#x03B3;</mml:mi><mml:mo fence="false" stretchy="false">|</mml:mo><mml:mi>&#x03B1;</mml:mi><mml:mo>,</mml:mo><mml:mi>&#x03B2;</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mo>&#x2260;</mml:mo><mml:mi>&#x03B1;</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>,</mml:mo><mml:mi>&#x03B3;</mml:mi><mml:mo>&#x2208;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mrow><mml:mtext>if&#xA0;</mml:mtext></mml:mrow><mml:mi>dim</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mi>q</mml:mi><mml:mrow><mml:mtext>, then&#xA0;</mml:mtext></mml:mrow><mml:mi>&#x03B1;</mml:mi><mml:mo>,</mml:mo><mml:mi>&#x03B2;</mml:mi><mml:mo>,</mml:mo><mml:mrow><mml:mtext>and&#xA0;</mml:mtext></mml:mrow><mml:mi>&#x03B3;</mml:mi><mml:mrow><mml:mtext>&#xA0;are linearly independent</mml:mtext></mml:mrow><mml:mo fence="false" stretchy="false">}</mml:mo><mml:mo>.</mml:mo></mml:math></disp-formula></p>
<p>For each <inline-formula id="ieqn-206"><mml:math id="mml-ieqn-206"><mml:mi>a</mml:mi><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>c</mml:mi><mml:mo>&#x2208;</mml:mo><mml:msubsup><mml:mi>F</mml:mi><mml:mrow><mml:mo stretchy="false">&#x2192;</mml:mo></mml:mrow><mml:mi>i</mml:mi></mml:msubsup></mml:math></inline-formula> and <inline-formula id="ieqn-207"><mml:math id="mml-ieqn-207"><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo>&#x2208;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>, we considered <inline-formula id="ieqn-208"><mml:math id="mml-ieqn-208"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> and <inline-formula id="ieqn-209"><mml:math id="mml-ieqn-209"><mml:msub><mml:mi>B</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> for all cases constructed in the mentioned manner. For each <inline-formula id="ieqn-210"><mml:math id="mml-ieqn-210"><mml:mi>&#x03B1;</mml:mi><mml:mi>&#x03B2;</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>&#x03B3;</mml:mi><mml:mo>&#x2208;</mml:mo><mml:msubsup><mml:mi>F</mml:mi><mml:mrow><mml:mo stretchy="false">&#x2190;</mml:mo></mml:mrow><mml:mi>j</mml:mi></mml:msubsup></mml:math></inline-formula> and <inline-formula id="ieqn-211"><mml:math id="mml-ieqn-211"><mml:mi>&#x03B1;</mml:mi><mml:mo>,</mml:mo><mml:mi>&#x03B2;</mml:mi><mml:mo>,</mml:mo><mml:mi>&#x03B3;</mml:mi><mml:mo>&#x2208;</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, the same process can be repeated to obtain <inline-formula id="ieqn-212"><mml:math id="mml-ieqn-212"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula> and <inline-formula id="ieqn-213"><mml:math id="mml-ieqn-213"><mml:msub><mml:mi>B</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula>. If <inline-formula id="ieqn-214"><mml:math id="mml-ieqn-214"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><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:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> is closer than <inline-formula id="ieqn-215"><mml:math id="mml-ieqn-215"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> for all cases, we adopt these spaces and store <inline-formula id="ieqn-216"><mml:math id="mml-ieqn-216"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>B</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:msub><mml:mi>B</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><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:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula>. After this process is conducted for all <inline-formula id="ieqn-217"><mml:math id="mml-ieqn-217"><mml:mi>a</mml:mi><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>c</mml:mi></mml:math></inline-formula> and <inline-formula id="ieqn-218"><mml:math id="mml-ieqn-218"><mml:mi>&#x03B1;</mml:mi><mml:mi>&#x03B2;</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>&#x03B3;</mml:mi></mml:math></inline-formula>, the stored set of <inline-formula id="ieqn-219"><mml:math id="mml-ieqn-219"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>B</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:msub><mml:mi>B</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><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:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> represents the output. <xref ref-type="fig" rid="fig-5">Fig. 5</xref> depicts the change in the intersection due to the meet-in-the-middle strategy.</p>
<fig id="fig-8">
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-8.tif"/>
</fig>
<fig id="fig-5">
<label>Figure 5</label>
<caption>
<title>Description of the meet-in-the-middle strategy</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-5.tif"/>
</fig>
<p>The process of constructing <inline-formula id="ieqn-252"><mml:math id="mml-ieqn-252"><mml:msubsup><mml:mi>F</mml:mi><mml:mrow><mml:mo stretchy="false">&#x2192;</mml:mo></mml:mrow><mml:mi>i</mml:mi></mml:msubsup></mml:math></inline-formula> and <inline-formula id="ieqn-253"><mml:math id="mml-ieqn-253"><mml:msubsup><mml:mi>F</mml:mi><mml:mrow><mml:mo stretchy="false">&#x2190;</mml:mo></mml:mrow><mml:mi>j</mml:mi></mml:msubsup></mml:math></inline-formula> is determined by the dimensions of <inline-formula id="ieqn-254"><mml:math id="mml-ieqn-254"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> and <inline-formula id="ieqn-255"><mml:math id="mml-ieqn-255"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, respectively. Thus, if the spatial dimension is <inline-formula id="ieqn-256"><mml:math id="mml-ieqn-256"><mml:msub><mml:mi>d</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>m</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, the computational cost of <inline-formula id="ieqn-257"><mml:math id="mml-ieqn-257"><mml:msubsup><mml:mi>F</mml:mi><mml:mrow><mml:mo stretchy="false">&#x2192;</mml:mo></mml:mrow><mml:mi>i</mml:mi></mml:msubsup></mml:math></inline-formula> or <inline-formula id="ieqn-258"><mml:math id="mml-ieqn-258"><mml:msubsup><mml:mi>F</mml:mi><mml:mrow><mml:mo stretchy="false">&#x2190;</mml:mo></mml:mrow><mml:mi>j</mml:mi></mml:msubsup></mml:math></inline-formula> is <inline-formula id="ieqn-259"><mml:math id="mml-ieqn-259"><mml:msup><mml:mn>2</mml:mn><mml:mrow><mml:mn>3</mml:mn><mml:msub><mml:mi>d</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>m</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:math></inline-formula> because <inline-formula id="ieqn-260"><mml:math id="mml-ieqn-260"><mml:mi>a</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi><mml:mo>,</mml:mo><mml:mi>c</mml:mi><mml:mo>,</mml:mo><mml:mi>&#x03B1;</mml:mi><mml:mo>,</mml:mo><mml:mi>&#x03B2;</mml:mi></mml:math></inline-formula>, and <inline-formula id="ieqn-261"><mml:math id="mml-ieqn-261"><mml:mi>&#x03B3;</mml:mi></mml:math></inline-formula> have <inline-formula id="ieqn-262"><mml:math id="mml-ieqn-262"><mml:msup><mml:mn>2</mml:mn><mml:mrow><mml:msub><mml:mi>d</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>m</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:math></inline-formula> cases. When applying Algorithm 2, the complexity of finding both <inline-formula id="ieqn-263"><mml:math id="mml-ieqn-263"><mml:mi>a</mml:mi><mml:mi>b</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>c</mml:mi><mml:mo>&#x2208;</mml:mo><mml:msubsup><mml:mi>F</mml:mi><mml:mrow><mml:mo stretchy="false">&#x2192;</mml:mo></mml:mrow><mml:mi>i</mml:mi></mml:msubsup></mml:math></inline-formula> and <inline-formula id="ieqn-264"><mml:math id="mml-ieqn-264"><mml:mi>&#x03B1;</mml:mi><mml:mi>&#x03B2;</mml:mi><mml:mo>&#x2295;</mml:mo><mml:mi>&#x03B3;</mml:mi><mml:mo>&#x2208;</mml:mo><mml:msubsup><mml:mi>F</mml:mi><mml:mrow><mml:mo stretchy="false">&#x2190;</mml:mo></mml:mrow><mml:mi>j</mml:mi></mml:msubsup></mml:math></inline-formula> is less than <inline-formula id="ieqn-265"><mml:math id="mml-ieqn-265"><mml:msup><mml:mn>2</mml:mn><mml:mrow><mml:mn>6</mml:mn><mml:msub><mml:mi>d</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>m</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:math></inline-formula> (e.g., if <inline-formula id="ieqn-266"><mml:math id="mml-ieqn-266"><mml:msub><mml:mi>d</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>m</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>5</mml:mn></mml:math></inline-formula>, the complexity bound is <inline-formula id="ieqn-267"><mml:math id="mml-ieqn-267"><mml:msup><mml:mn>2</mml:mn><mml:mrow><mml:mn>30</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula>). The memory complexity depends on how many close spaces are stored; thus, it depends on the S-box.</p>
<p>Searching two linear layers is possible only using the forward search, not the meet-in-the-middle strategy. However, the forward search requires a complexity of <inline-formula id="ieqn-268"><mml:math id="mml-ieqn-268"><mml:msup><mml:mn>2</mml:mn><mml:mrow><mml:mn>6</mml:mn><mml:msub><mml:mi>d</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>m</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:math></inline-formula>, so it takes longer than the meet-in-the-middle strategy. This speed difference can be seen experimentally, which is why we use a meet-in-the-middle strategy.</p>
</sec>
</sec>
<sec id="s5">
<label>5</label>
<title>Results for Some 4-bit S-Boxes</title>
<p>We applied the proposed algorithms to various 4-bit S-boxes. First, we considered all 4-bit optimal S-boxes classified by Leander and Poschmann [<xref ref-type="bibr" rid="ref-19">19</xref>,<xref ref-type="bibr" rid="ref-20">20</xref>] to demonstrate the validity of the proposed algorithms (see <xref ref-type="table" rid="table-1">Table 1</xref>). Moreover, LIGHTER-R could not find the circuits of odd permutations (i.e., <inline-formula id="ieqn-269"><mml:math id="mml-ieqn-269"><mml:msub><mml:mi>G</mml:mi><mml:mn>3</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>G</mml:mi><mml:mn>6</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>G</mml:mi><mml:mn>9</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>10</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>11</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula>, <inline-formula id="ieqn-270"><mml:math id="mml-ieqn-270"><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>12</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>14</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula>, and <inline-formula id="ieqn-271"><mml:math id="mml-ieqn-271"><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>15</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula>), whereas the proposed algorithm could.</p>
<table-wrap id="table-1">
<label>Table 1</label>
<caption>
<title>Toffoli depths of optimal S-boxes using 5 qubits</title>
</caption>
<table frame="hsides">
<colgroup>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
</colgroup>
<tbody>
<tr>
<th>Class</th>
<th><inline-formula id="ieqn-272"><mml:math id="mml-ieqn-272"><mml:msub><mml:mi>G</mml:mi><mml:mn>0</mml:mn></mml:msub></mml:math></inline-formula></th>
<th><inline-formula id="ieqn-273"><mml:math id="mml-ieqn-273"><mml:msub><mml:mi>G</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:math></inline-formula></th>
<th><inline-formula id="ieqn-274"><mml:math id="mml-ieqn-274"><mml:msub><mml:mi>G</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:math></inline-formula></th>
<th><inline-formula id="ieqn-275"><mml:math id="mml-ieqn-275"><mml:msub><mml:mi>G</mml:mi><mml:mn>3</mml:mn></mml:msub></mml:math></inline-formula></th>
<th><inline-formula id="ieqn-276"><mml:math id="mml-ieqn-276"><mml:msub><mml:mi>G</mml:mi><mml:mn>4</mml:mn></mml:msub></mml:math></inline-formula></th>
<th><inline-formula id="ieqn-277"><mml:math id="mml-ieqn-277"><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>5</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula></th>
<th><inline-formula id="ieqn-278"><mml:math id="mml-ieqn-278"><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>6</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula></th>
<th><inline-formula id="ieqn-279"><mml:math id="mml-ieqn-279"><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>7</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula></th>
</tr>
<tr>
<td>Toffoli-depth</td>
<td>4</td>
<td>4</td>
<td>4</td>
<td>7</td>
<td>5</td>
<td>5</td>
<td>6</td>
<td>5</td>
</tr>
<tr>
<td>Class</td>
<td><inline-formula id="ieqn-280"><mml:math id="mml-ieqn-280"><mml:msub><mml:mi>G</mml:mi><mml:mn>8</mml:mn></mml:msub></mml:math></inline-formula></td>
<td><inline-formula id="ieqn-281"><mml:math id="mml-ieqn-281"><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>9</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula></td>
<td><inline-formula id="ieqn-282"><mml:math id="mml-ieqn-282"><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>10</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula></td>
<td><inline-formula id="ieqn-283"><mml:math id="mml-ieqn-283"><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>11</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula></td>
<td><inline-formula id="ieqn-284"><mml:math id="mml-ieqn-284"><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>12</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula></td>
<td><inline-formula id="ieqn-285"><mml:math id="mml-ieqn-285"><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>13</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula></td>
<td><inline-formula id="ieqn-286"><mml:math id="mml-ieqn-286"><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>14</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula></td>
<td><inline-formula id="ieqn-287"><mml:math id="mml-ieqn-287"><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>15</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula></td>
</tr>
<tr>
<td>Toffoli-depth</td>
<td>4</td>
<td>6</td>
<td>6</td>
<td>6</td>
<td>6</td>
<td>5</td>
<td>6</td>
<td>6</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>Second, we consider the 4-bit S-boxes of GIFT [<xref ref-type="bibr" rid="ref-15">15</xref>], SKINNY [<xref ref-type="bibr" rid="ref-14">14</xref>] and Saturnin [<xref ref-type="bibr" rid="ref-21">21</xref>] (see <xref ref-type="table" rid="table-2">Table 2</xref>). The proposed algorithms and LIGHTER-R output identical Toffoli-depths in the circuit implementation when using 4 qubits. We executed the proposed algorithm using 5 qubits but outputted the same Toffoli-depths. To compare the results of this study with those of existing circuits, we checked the AND-depth, which relates closely to the Toffoli-depth. Quantum circuits with the Toffoli-depth at the same value as the AND-depth always exist, so comparison is possible [<xref ref-type="bibr" rid="ref-10">10</xref>]. These values represented the same AND-depths of the classical implementation, as claimed by the designers of GIFT and SKINNY. The GIFT quantum circuit with 4 qubits was written in Algorithm 3. In the algorithm, <inline-formula id="ieqn-288"><mml:math id="mml-ieqn-288"><mml:msub><mml:mi>x</mml:mi><mml:mn>0</mml:mn></mml:msub></mml:math></inline-formula> and <inline-formula id="ieqn-289"><mml:math id="mml-ieqn-289"><mml:msub><mml:mi>y</mml:mi><mml:mn>0</mml:mn></mml:msub></mml:math></inline-formula> are least significant bits, and <inline-formula id="ieqn-290"><mml:math id="mml-ieqn-290"><mml:msub><mml:mi>x</mml:mi><mml:mn>3</mml:mn></mml:msub></mml:math></inline-formula> and <inline-formula id="ieqn-291"><mml:math id="mml-ieqn-291"><mml:msub><mml:mi>y</mml:mi><mml:mn>3</mml:mn></mml:msub></mml:math></inline-formula> are most significant bits.</p>
<fig id="fig-9">
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-9.tif"/>
</fig>
<table-wrap id="table-2">
<label>Table 2</label>
<caption>
<title>Toffoli depths of special S-boxes using 4 qubits</title>
</caption>
<table frame="hsides">
<colgroup>
<col align="left"/>
<col align="left"/>
<col align="left"/>
<col align="left"/>
</colgroup>
<thead>
<tr>
<th>Cipher</th>
<th>Saturnin</th>
<th>SKINNY</th>
<th>GIFT</th>
</tr>
</thead>
<tbody>
<tr>
<td>Toffoli-depth</td>
<td>5</td>
<td>4</td>
<td>4</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>In the case of Saturnin, we found a more efficient circuit with an AND-depth of 5, rather than a circuit with an AND-depth of 6 that the designers found. <xref ref-type="fig" rid="fig-6">Fig. 6</xref> is the circuit of Saturnin&#x2019;s S-box <inline-formula id="ieqn-305"><mml:math id="mml-ieqn-305"><mml:msub><mml:mi>&#x03C3;</mml:mi><mml:mn>0</mml:mn></mml:msub></mml:math></inline-formula> that we found. We omitted the expression of CNOT gates in <inline-formula id="ieqn-306"><mml:math id="mml-ieqn-306"><mml:msub><mml:mi>L</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula>. The values of the wires leading to the same output on <inline-formula id="ieqn-307"><mml:math id="mml-ieqn-307"><mml:msub><mml:mi>L</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:math></inline-formula> are XORed.</p>
<fig id="fig-6">
<label>Figure 6</label>
<caption>
<title>Circuit of Saturnin S-box <inline-formula id="ieqn-308"><mml:math id="mml-ieqn-308"><mml:msub><mml:mi>&#x03C3;</mml:mi><mml:mn>0</mml:mn></mml:msub></mml:math></inline-formula></title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-6.tif"/>
</fig>
<p><bold>Discussion of the Results Based on the Algorithms.</bold> For each <inline-formula id="ieqn-309"><mml:math id="mml-ieqn-309"><mml:mi>i</mml:mi></mml:math></inline-formula>, the proposed algorithms take a pair <inline-formula id="ieqn-310"><mml:math id="mml-ieqn-310"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mi>i</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> as input and select the closer pair <inline-formula id="ieqn-311"><mml:math id="mml-ieqn-311"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><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:mrow><mml:mi>&#x1D4B4;</mml:mi></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula>, where <inline-formula id="ieqn-312"><mml:math id="mml-ieqn-312"><mml:mrow><mml:mi>&#x1D4B4;</mml:mi></mml:mrow></mml:math></inline-formula> can be either <inline-formula id="ieqn-313"><mml:math id="mml-ieqn-313"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> or <inline-formula id="ieqn-314"><mml:math id="mml-ieqn-314"><mml:msub><mml:mrow><mml:mi>&#x1D4B3;</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mi>j</mml:mi><mml:mo>&#x2212;</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula>. The value of <inline-formula id="ieqn-315"><mml:math id="mml-ieqn-315"><mml:mi>j</mml:mi></mml:math></inline-formula> is determined by the number of times Algorithm 2 is repeated. In the process, a pair that is not closer to any <inline-formula id="ieqn-316"><mml:math id="mml-ieqn-316"><mml:mi>i</mml:mi></mml:math></inline-formula> and <inline-formula id="ieqn-317"><mml:math id="mml-ieqn-317"><mml:mi>j</mml:mi></mml:math></inline-formula> is never selected. This fact incurs a weakness in that the algorithms sometimes fail to find circuits with the minimum Toffoli-depth. However, we can determine the whole circuit&#x2019;s lower bound of Toffoli-depth using Theorem 2. If the algorithms find a circuit with this lower bound, that implies the minimum Toffoli-depth. Furthermore, the algorithms offer the advantage of being able to find all circuits with such a lower bound. This result occurs because, a forward finding can discover a circuit if one with that lower bound exists (see Algorithm 1). If the output circuit does not have the lower bound, then the Toffoli-depth of the S-box is greater than the lower bound. We can confirm that the results of <inline-formula id="ieqn-318"><mml:math id="mml-ieqn-318"><mml:msub><mml:mi>G</mml:mi><mml:mn>3</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>G</mml:mi><mml:mn>6</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>G</mml:mi><mml:mn>9</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>10</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>11</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>12</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>14</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>15</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula>, Saturnin, SKINNY, and GIFT are the minimum Toffoli-depth.</p>
<p><bold>Discussion on 6 Qubits.</bold> In this case, the method of this paper can be applied as is, and only the number of available Toffoli gates in a Toffoli layer increases. The proposed algorithm uses only one Toffoli gate in a Toffoli layer, so the algorithm selects three qubits. When using 6 qubits, two Toffoli gates must be found; therefore all 6 qubits are selected. Accordingly, the computational cost for the forward direction becomes <inline-formula id="ieqn-319"><mml:math id="mml-ieqn-319"><mml:msup><mml:mn>2</mml:mn><mml:mrow><mml:mn>6</mml:mn><mml:msub><mml:mi>d</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>m</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:math></inline-formula>, and the computational cost for the meet-in-the-middle strategy becomes under <inline-formula id="ieqn-320"><mml:math id="mml-ieqn-320"><mml:msup><mml:mn>2</mml:mn><mml:mrow><mml:mn>12</mml:mn><mml:msub><mml:mi>d</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>m</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup><mml:mo>.</mml:mo></mml:math></inline-formula></p>
<p><bold>Discussion on Other Methods.</bold> There are tools for creating quantum circuits, including LIGHTER-R and DORCIS [<xref ref-type="bibr" rid="ref-22">22</xref>]. The LIGHTER-R tool is based on the breadth-frist search algorithm and evaluates paths based on the cost entered by the user. In addition, DORCIS is based on LIGHTER-R, but the difference is that it evaluates the path based on the depth of the circuit. In the proposed framework, the vector space pairs corresponding to the forward and backward linear layers become the nodes, and the patterns for selecting the vector space pairs become the paths. In addition, the proposed method evaluates the path based on the intersection of a vector space pair. In the breadth-frist search based algorithm, all CNOT gates become nodes, but this proposed method ignores the CNOT gates, so the search is reduced.</p>
<p>The authors of DORCIS used GIFT&#x2019;s S-box to compare its performance with LIGHTER-R. Both algorithms achieved Toffoli-depth 4 using 4 qubits, and we obtained the same result using the same number of qubits. This implies that our tool can handle all the tasks that existing tools are capable of.</p>
</sec>
<sec id="s6">
<label>6</label>
<title>Conclusion</title>
<p>This paper presents a new framework to construct quantum circuits of S-boxes according to a limited number of qubits. To construct such circuits, we analyzed the dimension and basis before and after the Toffoli layer to find qubits for which the equations match based on the forward search or the meet-in-the-middle strategy. We employed the proposed tool to find the circuits of 4-bit S-boxes and verified its effectiveness in practice. Through the proposed framework, we discovered all quantum circuits of odd permutations among all 4-bit optimal S-boxes classified by Leander and Poschmann. We also implemented quantum circuits of S-boxes for several well-known block ciphers, in which a more efficient quantum circuit of Saturnin&#x2019;s S-box was found. The proposed technique can be applied to find circuits for S-boxes larger than 4 bits, which is left for future work. This technique contributes to the research field regarding finding optimized quantum circuits of S-boxes.</p>
</sec>
</body>
<back>
<ack><p>None.</p>
</ack>
<sec><title>Funding Statement</title>
<p>This research was supported by the MSIT (Ministry of Science and ICT), Republic of Korea, under the ITRC (Information Technology Research Center) support program (IITP-2024-RS-2022-00164800) supervised by the IITP (Institute for Information &#x0026; Communications Technology Planning &#x0026; Evaluation).</p>
</sec>
<sec><title>Author Contributions</title>
<p>All authors contributed to the entire process from theoretical design to paper writing. All authors reviewed the results and approved the final version of the manuscript.</p>
</sec>
<sec sec-type="data-availability"><title>Availability of Data and Materials</title>
<p>The results of the proposed framework for optimal 4-bit S-boxes have been added to the appendix.</p>
</sec>
<sec sec-type="COI-statement"><title>Conflicts of Interest</title>
<p>The authors declare that they have no conflicts of interest to report regarding the present study.</p>
</sec>
<ref-list content-type="authoryear">
<title>References</title>
<ref id="ref-1"><label>1.</label><mixed-citation publication-type="conf-proc"><person-group person-group-type="author"><string-name><surname>Shor</surname>, <given-names>P. W.</given-names></string-name></person-group> <article-title>Algorithms for quantum computation: discrete logarithms and factoring</article-title>. In: <conf-name>Proceedings of 35th Annual Symposium on Foundations of Computer Science</conf-name>; <fpage>20</fpage>&#x2013;<lpage>22</lpage> <month>Nov</month> <year>1994</year>; <publisher-name>IEEE Computer Society</publisher-name>.</mixed-citation></ref>
<ref id="ref-2"><label>2.</label><mixed-citation publication-type="other"><person-group person-group-type="author"><collab>NIST</collab></person-group>. <article-title>Post-quantum cryptography standardization</article-title>; <year>2016</year>. Available from: <ext-link ext-link-type="uri" xlink:href="https://csrc.nist.gov/projects/post-quantum-cryptography">https://csrc.nist.gov/projects/post-quantum-cryptography</ext-link>. <comment>[Accessed 2024]</comment>.</mixed-citation></ref>
<ref id="ref-3"><label>3.</label><mixed-citation publication-type="conf-proc"><person-group person-group-type="author"><string-name><surname>Grover</surname> <given-names>LK</given-names></string-name></person-group>. <article-title>A fast quantum mechanical algorithm for database search</article-title>. In: <conf-name>Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing</conf-name>; <year>1996</year>; <publisher-loc>New York, NY, USA</publisher-loc>: <publisher-name>Association for Computing Machinery</publisher-name>. p. <fpage>212</fpage>&#x2013;<lpage>9</lpage>.</mixed-citation></ref>
<ref id="ref-4"><label>4.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Simon</surname> <given-names>DR</given-names></string-name></person-group>. <article-title>On the power of quantum computation</article-title>. <source>SIAM J Comput</source>. <year>1997</year>;<volume>26</volume>(<issue>5</issue>):<fpage>1474</fpage>&#x2013;<lpage>83</lpage>. doi:<pub-id pub-id-type="doi">10.1137/S0097539796298637</pub-id>.</mixed-citation></ref>
<ref id="ref-5"><label>5.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Grassl</surname> <given-names>M</given-names></string-name>, <string-name><surname>Langenberg</surname> <given-names>B</given-names></string-name>, <string-name><surname>Roetteler</surname> <given-names>M</given-names></string-name>, <string-name><surname>Steinwandt</surname> <given-names>R</given-names></string-name></person-group>. <chapter-title>Applying grover&#x2019;s algorithm to AES: quantum resource estimates</chapter-title>. In: <person-group person-group-type="editor"><string-name><surname>Takagi</surname> <given-names>T</given-names></string-name></person-group>, editor. <source>Post-Quantum Cryptography&#x2014;7th International Workshop</source>. <publisher-loc>Cham</publisher-loc>: <publisher-name>Springer</publisher-name>; <year>2016</year>.</mixed-citation></ref>
<ref id="ref-6"><label>6.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Langenberg</surname> <given-names>B</given-names></string-name>, <string-name><surname>Pham</surname> <given-names>H</given-names></string-name>, <string-name><surname>Steinwandt</surname> <given-names>R</given-names></string-name></person-group>. <article-title>Reducing the cost of implementing the advanced encryption standard as a quantum circuit</article-title>. <source>IEEE Trans Quantum Eng</source>. <year>2020</year>;<volume>1</volume>:<fpage>1</fpage>&#x2013;<lpage>12</lpage>. doi:<pub-id pub-id-type="doi">10.1109/TQE.2020.2965697</pub-id>.</mixed-citation></ref>
<ref id="ref-7"><label>7.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Zou</surname> <given-names>J</given-names></string-name>, <string-name><surname>Wei</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Sun</surname> <given-names>S</given-names></string-name>, <string-name><surname>Liu</surname> <given-names>X</given-names></string-name>, <string-name><surname>Wu</surname> <given-names>W</given-names></string-name></person-group>. <chapter-title>Quantum circuit implementations of AES with fewer qubits</chapter-title>. In: <person-group person-group-type="editor"><string-name><surname>Moriai</surname> <given-names>S</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>H</given-names></string-name></person-group>, editors. <source>Advances in Cryptology&#x2014;ASIACRYPT 2020&#x2014;26th International Conference on the Theory and Application of Cryptology and Information Security</source>; <year>2020</year>; <publisher-loc>Daejeon, Republic of Korea</publisher-loc>: <publisher-name>Springer</publisher-name>.</mixed-citation></ref>
<ref id="ref-8"><label>8.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Jaques</surname> <given-names>S</given-names></string-name>, <string-name><surname>Naehrig</surname> <given-names>M</given-names></string-name>, <string-name><surname>Roetteler</surname> <given-names>M</given-names></string-name>, <string-name><surname>Virdia</surname> <given-names>F</given-names></string-name></person-group>. <chapter-title>Implementing grover oracles for quantum key search on AES and lowmc</chapter-title>. In: <person-group person-group-type="editor"><string-name><surname>Canteaut</surname> <given-names>A</given-names></string-name>, <string-name><surname>Ishai</surname> <given-names>Y</given-names></string-name></person-group>, editors. <source>Advances in Cryptology-EUROCRYPT 2020&#x2014;39th Annual International Conference on the Theory and Applications of Cryptographic Techniques</source>; <year>2020</year>; <publisher-loc>Zagreb, Croatia</publisher-loc>: <publisher-name>Springer</publisher-name>.</mixed-citation></ref>
<ref id="ref-9"><label>9.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Lin</surname> <given-names>D</given-names></string-name>, <string-name><surname>Xiang</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Xu</surname> <given-names>R</given-names></string-name>, <string-name><surname>Zhang</surname> <given-names>S</given-names></string-name>, <string-name><surname>Zeng</surname> <given-names>X</given-names></string-name></person-group>. <article-title>Optimized quantum implementation of AES</article-title>. <source>Quant Inf Process</source>. <year>2023</year>;<volume>22</volume>(<issue>9</issue>):<fpage>352</fpage>. doi:<pub-id pub-id-type="doi">10.1007/s11128-023-04043-9</pub-id>.</mixed-citation></ref>
<ref id="ref-10"><label>10.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Huang</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Sun</surname> <given-names>S</given-names></string-name></person-group>. <chapter-title> Synthesizing quantum circuits of AES with lower t-depth and less qubits</chapter-title>. In: <person-group person-group-type="editor"><string-name><surname>Agrawal</surname> <given-names>S</given-names></string-name>, <string-name><surname>Lin</surname> <given-names>D</given-names></string-name></person-group>, editors. <source>Advances in Cryptology&#x2014;ASIACRYPT 2022&#x2014;28th International Conference on the Theory and Application of Cryptology and Information Security</source>; <year>2022</year>; <publisher-loc>Taipei, Taiwan</publisher-loc>: <publisher-name>Springer</publisher-name>. doi: <pub-id pub-id-type="doi">10.1007/978-3-031-22969-5</pub-id>.</mixed-citation></ref>
<ref id="ref-11"><label>11.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Bogdanov</surname> <given-names>A</given-names></string-name>, <string-name><surname>Knudsen</surname> <given-names>LR</given-names></string-name>, <string-name><surname>Leander</surname> <given-names>G</given-names></string-name>, <string-name><surname>Paar</surname> <given-names>C</given-names></string-name>, <string-name><surname>Poschmann</surname> <given-names>A</given-names></string-name>, <string-name><surname>Robshaw</surname> <given-names>MJB</given-names></string-name>, <etal>et al.</etal></person-group> <chapter-title>PRESENT: an ultra-lightweight block cipher</chapter-title>. In: <person-group person-group-type="editor"><string-name><surname>Paillier</surname> <given-names>P</given-names></string-name>, <string-name><surname>Verbauwhede</surname> <given-names>I</given-names></string-name></person-group>, editors. <source>Cryptographic Hardware and Embedded Systems&#x2014;CHES 2007, 9th International Workshop</source>; <year>2007</year>; <publisher-loc>Vienna, Austria</publisher-loc>: <publisher-name>Springer</publisher-name>.</mixed-citation></ref>
<ref id="ref-12"><label>12.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Albrecht</surname> <given-names>MR</given-names></string-name>, <string-name><surname>Driessen</surname> <given-names>B</given-names></string-name>, <string-name><surname>Kavun</surname> <given-names>EB</given-names></string-name>, <string-name><surname>Leander</surname> <given-names>G</given-names></string-name>, <string-name><surname>Paar</surname> <given-names>C</given-names></string-name>, <string-name><surname>Yal&#x00E7;in</surname> <given-names>T</given-names></string-name></person-group>. <chapter-title>Block ciphers&#x2014;focus on the linear layer (feat. PRIDE)</chapter-title>. In: <person-group person-group-type="editor"><string-name><surname>Garay</surname> <given-names>JA</given-names></string-name>, <string-name><surname>Gennaro</surname> <given-names>R</given-names></string-name></person-group>, editors. <source>Advances in Cryptology&#x2014;CRYPTO 2014&#x2014;34th Annual Cryptology Conference</source>; <year>2014</year>; <publisher-loc>Santa Barbara, CA, USA</publisher-loc>: <publisher-name>Springer</publisher-name>.</mixed-citation></ref>
<ref id="ref-13"><label>13.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Zhang</surname> <given-names>WT</given-names></string-name>, <string-name><surname>Bao</surname> <given-names>ZZ</given-names></string-name>, <string-name><surname>Lin</surname> <given-names>DD</given-names></string-name>, <string-name><surname>Rijmen</surname> <given-names>V</given-names></string-name>, <string-name><surname>Yang</surname> <given-names>BH</given-names></string-name>, <string-name><surname>Verbauwhede</surname> <given-names>I</given-names></string-name></person-group>. <article-title>RECTANGLE: a bit-slice lightweight block cipher suitable for multiple platforms</article-title>. <source>Sci China Inf Sci</source>. <year>2015</year>;<volume>58</volume>(<issue>12</issue>):<fpage>1</fpage>&#x2013;<lpage>15</lpage>. doi:<pub-id pub-id-type="doi">10.1007/s11432-015-5459-7</pub-id>.</mixed-citation></ref>
<ref id="ref-14"><label>14.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Beierle</surname> <given-names>C</given-names></string-name>, <string-name><surname>Jean</surname> <given-names>J</given-names></string-name>, <string-name><surname>K&#x00F6;lbl</surname> <given-names>S</given-names></string-name>, <string-name><surname>Leander</surname> <given-names>G</given-names></string-name>, <string-name><surname>Moradi</surname> <given-names>A</given-names></string-name>, <string-name><surname>Peyrin</surname> <given-names>T</given-names></string-name>, <etal>et al.</etal></person-group> <chapter-title>The SKINNY family of block ciphers and its low-latency variant MANTIS</chapter-title>. In: <person-group person-group-type="editor"><string-name><surname>Robshaw</surname> <given-names>M</given-names></string-name>, <string-name><surname>Katz</surname> <given-names>J</given-names></string-name></person-group>, editors. <source>Advances in Cryptology&#x2014;CRYPTO 2016&#x2014;36th Annual International Cryptology Conference</source>; <year>2016</year>; <publisher-loc>Santa Barbara, CA, USA</publisher-loc>: <publisher-name>Springer</publisher-name>.</mixed-citation></ref>
<ref id="ref-15"><label>15.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Banik</surname> <given-names>S</given-names></string-name>, <string-name><surname>Pandey</surname> <given-names>SK</given-names></string-name>, <string-name><surname>Peyrin</surname> <given-names>T</given-names></string-name>, <string-name><surname>Sasaki</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Sim</surname> <given-names>SM</given-names></string-name>, <string-name><surname>Todo</surname> <given-names>Y</given-names></string-name></person-group>. <chapter-title>GIFT: a small present - towards reaching the limit of lightweight encryption</chapter-title>. In: <person-group person-group-type="editor"><string-name><surname>Fischer</surname> <given-names>W</given-names></string-name>, <string-name><surname>Homma</surname> <given-names>N</given-names></string-name></person-group>, editors. <source>Cryptographic Hardware and Embedded Systems&#x2014;CHES 2017&#x2014;19th International Conference</source>; <year>2017</year>; <publisher-loc>Taipei, Taiwan</publisher-loc>: <publisher-name>Springer</publisher-name>.</mixed-citation></ref>
<ref id="ref-16"><label>16.</label><mixed-citation publication-type="conf-proc"><person-group person-group-type="author"><string-name><surname>Dasu</surname> <given-names>VA</given-names></string-name>, <string-name><surname>Baksi</surname> <given-names>A</given-names></string-name>, <string-name><surname>Sarkar</surname> <given-names>S</given-names></string-name>, <string-name><surname>Chattopadhyay</surname> <given-names>A</given-names></string-name></person-group>. <article-title>LIGHTER-R: optimized reversible circuit implementation for sboxes</article-title>. In: <conf-name>32nd IEEE International System-on-Chip Conference</conf-name>; <year>2019</year>; <publisher-loc>Singapore</publisher-loc>: <publisher-name>IEEE</publisher-name>.</mixed-citation></ref>
<ref id="ref-17"><label>17.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Shende</surname> <given-names>VV</given-names></string-name>, <string-name><surname>Prasad</surname> <given-names>AK</given-names></string-name>, <string-name><surname>Markov</surname> <given-names>IL</given-names></string-name>, <string-name><surname>Hayes</surname> <given-names>JP</given-names></string-name></person-group>. <article-title>Synthesis of reversible logic circuits</article-title>. <source>IEEE Trans Comput Aided Des Integr Circuits Syst</source>. <year>2003</year>;<volume>22</volume>(<issue>6</issue>):<fpage>710</fpage>&#x2013;<lpage>22</lpage>.</mixed-citation></ref>
<ref id="ref-18"><label>18.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Jiang</surname> <given-names>J</given-names></string-name>, <string-name><surname>Sun</surname> <given-names>X</given-names></string-name>, <string-name><surname>Teng</surname> <given-names>S</given-names></string-name>, <string-name><surname>Wu</surname> <given-names>B</given-names></string-name>, <string-name><surname>Wu</surname> <given-names>K</given-names></string-name>, <string-name><surname>Zhang</surname> <given-names>J</given-names></string-name></person-group>. <chapter-title>Optimal space-depth trade-off of CNOT circuits in quantum logic synthesis</chapter-title>. In: <person-group person-group-type="editor"><string-name><surname>Chawla</surname> <given-names>S</given-names></string-name></person-group>, editor. <source>Proceedings of the 2020 ACM-SIAM Symposium on Discrete Algorithms, SODA 2020</source>; <year>2020</year>; <publisher-loc>Salt Lake City, UT, USA</publisher-loc>: <publisher-name>SIAM</publisher-name>.</mixed-citation></ref>
<ref id="ref-19"><label>19.</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Leander</surname> <given-names>G</given-names></string-name>, <string-name><surname>Poschmann</surname> <given-names>A</given-names></string-name></person-group>. <chapter-title>On the classification of 4 bit s-boxes</chapter-title>. In: <person-group person-group-type="editor"><string-name><surname>Carlet</surname> <given-names>C</given-names></string-name>, <string-name><surname>Sunar</surname> <given-names>B</given-names></string-name></person-group>, editors. <source>Arithmetic of Finite Fields, First International Workshop, WAIFI 2007</source>; <year>2007</year>; <publisher-loc>Madrid, Spain</publisher-loc>: <publisher-name>Springer</publisher-name>.</mixed-citation></ref>
<ref id="ref-20"><label>20.</label><mixed-citation publication-type="conf-proc"><person-group person-group-type="author"><string-name><surname>Zhang</surname> <given-names>W</given-names></string-name>, <string-name><surname>Bao</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Rijmen</surname> <given-names>V</given-names></string-name>, <string-name><surname>Liu</surname> <given-names>M</given-names></string-name></person-group>. <article-title>A new classification of 4-bit optimal s-boxes and its application to present, rectangle and spongent</article-title>. In: <conf-name>Fast Software Encryption: 22nd International Workshop, FSE 2015</conf-name>; <year>2015</year>; <publisher-loc>Istanbul, Turkey</publisher-loc>: <publisher-name>Springer</publisher-name>.</mixed-citation></ref>
<ref id="ref-21"><label>21.</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Canteaut</surname> <given-names>A</given-names></string-name>, <string-name><surname>Duval</surname> <given-names>S</given-names></string-name>, <string-name><surname>Leurent</surname> <given-names>G</given-names></string-name>, <string-name><surname>Naya-Plasencia</surname> <given-names>M</given-names></string-name>, <string-name><surname>Perrin</surname> <given-names>L</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>Saturnin: a suite of lightweight symmetric algorithms for post-quantum security</article-title>. <source>IACR Trans Symmetric Cryptol</source>. <year>2020</year>;<volume>2020</volume>(<issue>S1</issue>):<fpage>160</fpage>&#x2013;<lpage>207</lpage>.</mixed-citation></ref>
<ref id="ref-22"><label>22.</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Chun</surname> <given-names>M</given-names></string-name>, <string-name><surname>Baksi</surname> <given-names>A</given-names></string-name>, <string-name><surname>Chattopadhyay</surname> <given-names>A</given-names></string-name></person-group>. <article-title>DORCIS: depth optimized quantum implementation of substitution boxes</article-title>. Available from: <ext-link ext-link-type="uri" xlink:href="https://eprint.iacr.org/2023/286">https://eprint.iacr.org/2023/286</ext-link>. <comment>[Accessed 2023]</comment>.</mixed-citation></ref>
</ref-list>
<app-group>
<app id="app-1"><label>Appendix A:</label><title>Results for the 4-Bit Optimal S-Boxes</title>
<p>Algorithms 4&#x2013;11 are the results of the proposed framework for the optimal S-boxes <inline-formula id="ieqn-321"><mml:math id="mml-ieqn-321"><mml:msub><mml:mi>G</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>G</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:mo>&#x22EF;</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>G</mml:mi><mml:mrow><mml:mn>15</mml:mn></mml:mrow></mml:msub></mml:math></inline-formula>. In inputs/outputs, <inline-formula id="ieqn-322"><mml:math id="mml-ieqn-322"><mml:msub><mml:mi>x</mml:mi><mml:mn>0</mml:mn></mml:msub></mml:math></inline-formula> and <inline-formula id="ieqn-323"><mml:math id="mml-ieqn-323"><mml:msub><mml:mi>y</mml:mi><mml:mn>0</mml:mn></mml:msub></mml:math></inline-formula> are least significant bits, and the rightmost 0 represents ancilla qubits. The line below refers to the Toffoli layer.
<disp-formula id="ueqn-8"><mml:math id="mml-ueqn-8" display="block"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>3</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>4</mml:mn></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">&#x2190;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>2</mml:mn></mml:msub><mml:mo>&#x2295;</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>0</mml:mn></mml:msub><mml:msub><mml:mi>x</mml:mi><mml:mn>1</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>3</mml:mn></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mn>4</mml:mn></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>.</mml:mo></mml:math></disp-formula></p>
<p>All lines except the Toffoli layers refer to linear layers.</p>
<fig id="fig-10">
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-10.tif"/>
</fig>
<fig id="fig-11">
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-11.tif"/>
</fig>
<fig id="fig-12">
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-12.tif"/>
</fig>
<fig id="fig-13">
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-13.tif"/>
</fig>
<fig id="fig-14">
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-14.tif"/>
</fig>
<fig id="fig-15">
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-15.tif"/>
</fig>
<fig id="fig-16">
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-16.tif"/>
</fig>
<fig id="fig-17">
<graphic mimetype="image" mime-subtype="tif" xlink:href="CMES_52374-fig-17.tif"/>
</fig>
</app>
</app-group>
</back></article>