<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article article-type="research-article" dtd-version="2.3" xml:lang="EN" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Mech. Eng</journal-id>
<journal-title>Frontiers in Mechanical Engineering</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Mech. Eng</abbrev-journal-title>
<issn pub-type="epub">2297-3079</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="publisher-id">925637</article-id>
<article-id pub-id-type="doi">10.3389/fmech.2022.925637</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Mechanical Engineering</subject>
<subj-group>
<subject>Original Research</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>Investigating hardware acceleration for simulation of CFD quantum circuits</article-title>
<alt-title alt-title-type="left-running-head">Moawad et al.</alt-title>
<alt-title alt-title-type="right-running-head">
<ext-link ext-link-type="uri" xlink:href="https://doi.org/10.3389/fmech.2022.925637">10.3389/fmech.2022.925637</ext-link>
</alt-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" corresp="yes">
<name>
<surname>Moawad</surname>
<given-names>Youssef</given-names>
</name>
<xref ref-type="corresp" rid="c001">&#x2a;</xref>
<uri xlink:href="https://loop.frontiersin.org/people/1655759/overview"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Vanderbauwhede</surname>
<given-names>Wim</given-names>
</name>
<uri xlink:href="https://loop.frontiersin.org/people/1654587/overview"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Steijl</surname>
<given-names>Ren&#xe9;</given-names>
</name>
<uri xlink:href="https://loop.frontiersin.org/people/1554009/overview"/>
</contrib>
</contrib-group>
<aff>
<institution>University of Glasgow</institution>, <addr-line>Glasgow</addr-line>, <country>United Kingdom</country>
</aff>
<author-notes>
<fn fn-type="edited-by">
<p>
<bold>Edited by:</bold> <ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/687841/overview">Markus Holzner</ext-link>, Swiss Federal Institute for Forest, Snow and Landscape Research (WSL), Switzerland</p>
</fn>
<fn fn-type="edited-by">
<p>
<bold>Reviewed by:</bold> <ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/1857803/overview">Bogdan Pasca</ext-link>, Intel, United States</p>
<p>
<ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/1873610/overview">Yuichiro Shibata</ext-link>, Nagasaki University, Japan</p>
</fn>
<corresp id="c001">&#x2a;Correspondence: Youssef Moawad, <email>y.moawad.1@research.gla.ac.uk</email>
</corresp>
<fn fn-type="other">
<p>This article was submitted to Fluid Mechanics, a section of the journal Frontiers in Mechanical Engineering</p>
</fn>
</author-notes>
<pub-date pub-type="epub">
<day>04</day>
<month>10</month>
<year>2022</year>
</pub-date>
<pub-date pub-type="collection">
<year>2022</year>
</pub-date>
<volume>8</volume>
<elocation-id>925637</elocation-id>
<history>
<date date-type="received">
<day>21</day>
<month>04</month>
<year>2022</year>
</date>
<date date-type="accepted">
<day>08</day>
<month>08</month>
<year>2022</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#xa9; 2022 Moawad, Vanderbauwhede and Steijl.</copyright-statement>
<copyright-year>2022</copyright-year>
<copyright-holder>Moawad, Vanderbauwhede and Steijl</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/">
<p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p>
</license>
</permissions>
<abstract>
<p>Among the many computational models for quantum computing, the Quantum Circuit Model is the most well-known and used model for interacting with current quantum hardware. The practical implementation of quantum computers is a very active research field. Despite this progress, access to physical quantum computers remains relatively limited. Furthermore, the existing machines are susceptible to random errors due to quantum decoherence, as well as being limited in number of qubits, connectivity and built-in error correction. Simulation on classical hardware is therefore essential to allow quantum algorithm researchers to test and validate new algorithms in a simulated-error environment. Computing systems are becoming increasingly heterogeneous, using a variety of hardware accelerators to speed up computational tasks. One such type of accelerators, Field Programmable Gate Arrays (FPGAs), are reconfigurable circuits that can be programmed using standardized high-level programming models such as OpenCL and SYCL. FPGAs allow to create specialized highly-parallel circuits capable of mimicking the quantum parallelism properties of quantum gates, in particular for the class of quantum algorithms where many different computations can be performed concurrently or as part of a deep pipeline. They also benefit from very high internal memory bandwidth. This paper focuses on the analysis of quantum algorithms for applications in computational fluid dynamics. In this work we introduce novel quantum-circuit implementations of model lattice-based formulations for fluid dynamics, specifically the D1Q3 model using quantum computational basis encoding, as well as, efficient simulation of the circuits using FPGAs. This work forms a step toward quantum circuit formulation of the Lattice Boltzmann Method (LBM). For the quantum circuits implementing the nonlinear equilibrium distribution function in the D1Q3 lattice model, it is shown how circuit transformations can be introduced that facilitate the efficient simulation of the circuits on FPGAs, exploiting their fine-grained parallelism. We show that these transformations allow us to exploit more parallelism on the FPGA and improve memory locality. Preliminary results show that for this class of circuits the introduced transformations improve circuit execution time. We show that FPGA simulation of the reduced circuits results in more than 3&#xd7; improvement in performance per Watt compared to the CPU simulation. We also present results from evaluating the same kernels on a GPU.</p>
</abstract>
<kwd-group>
<kwd>quantum circuit simulation</kwd>
<kwd>Lattice Boltzmann Method (LBM)</kwd>
<kwd>FPGA</kwd>
<kwd>field programmable gate array</kwd>
<kwd>quantum circuit transformation</kwd>
<kwd>hardware acceleration</kwd>
</kwd-group>
<contract-sponsor id="cn001">University of Glasgow<named-content content-type="fundref-id">10.13039/501100000853</named-content>
</contract-sponsor>
</article-meta>
</front>
<body>
<sec id="s1">
<title>1 Introduction</title>
<p>Quantum computing (QC) is a rapidly developing area of research investigating devices and algorithms that take advantage of quantum mechanical phenomena to perform computations which may typically be intractable on classical computers. In recent years, significant progress has been made with building quantum computers. For a small number of applications, quantum algorithms have been developed that display a significant speed-up relative to classical methods. Computational quantum chemistry and quantum machine learning are among the areas of application receiving much recent research activity. Important developments for a wider range of applications include quantum algorithms for linear systems (<xref ref-type="bibr" rid="B26">Harrow et al., 2009</xref>) and the Poisson equation (<xref ref-type="bibr" rid="B10">Cao et al., 2013</xref>). Applications to computational science and engineering problems beyond quantum chemistry have only recently begun to appear (<xref ref-type="bibr" rid="B42">Montanaro and Pallister, 2016</xref>; <xref ref-type="bibr" rid="B46">Scherer et al., 2017</xref>; <xref ref-type="bibr" rid="B52">Xu et al., 2018</xref>; <xref ref-type="bibr" rid="B48">Steijl and Barakos, 2018</xref>; <xref ref-type="bibr" rid="B50">Todorova and Steijl, 2020</xref>; <xref ref-type="bibr" rid="B14">Steijl, 2020</xref>). Despite this research effort, quantum computing applications in computational engineering have so far been limited.</p>
<p>In the present work, the development and evaluation of quantum algorithms for Computational Fluid Dynamics (CFD) applications forms the main motivation. The emphasis is on quantum algorithms for lattice-based models in fluid mechanics and their analysis and verification using quantum computing simulation techniques.</p>
<p>Currently, the development of quantum-computer implementation of the Lattice Boltzmann method (LBM) forms an active area of research (<xref ref-type="bibr" rid="B9">Budinski, 2021</xref>; <xref ref-type="bibr" rid="B27">Itani and Succi, 2022</xref>), where the non-linearity of the governing equations in fluid mechanics forms the main challenge. In LBM models, this inherent non-linearity appears in the collision term of the equations, in particular in the definition of the local equilibrium distribution function in this collision term. In such models, the convective terms of the Navier-Stokes equations appear as linear streaming operations of the velocity distribution functions governed by the LBM.</p>
<p>For linear ordinary differential equations (ODEs) as well as linear partial differential equations (PDEs), significant progress has been made in recent years in the development of quantum algorithms with meaningful complexity improvements over classical algorithms (<xref ref-type="bibr" rid="B7">Berry, 2014</xref>; <xref ref-type="bibr" rid="B6">Berry et al., 2017</xref>; <xref ref-type="bibr" rid="B13">Costa et al., 2019</xref>; <xref ref-type="bibr" rid="B18">Fillion-Gourdeau and Lorin, 2019</xref>; <xref ref-type="bibr" rid="B11">Childs and Liu, 2020</xref>). Examples of recent published works include <xref ref-type="bibr" rid="B22">Garc&#xed;a-Ripoll (2021)</xref>, <xref ref-type="bibr" rid="B21">Garc&#xed;a-Molina et al. (2021)</xref>, and <xref ref-type="bibr" rid="B32">Knudsen and Mendl (2020)</xref>. However, in contrast to this progress for linear equations, there has not been similar progress in the development of quantum algorithms for CFD applications. This can be attributed to a number of factors. The non-linear nature of the governing equations of fluid dynamics is a key part of the challenge. As an example of a further key challenge, the initialization and measurement of the quantum state representing a complex flow field can be considered. If not performed efficiently, these steps have the potential to undo potential quantum speed-up obtained in the computational steps in the quantum algorithm.</p>
<p>An example of early work in the area of nonlinear ODEs and nonlinear PDEs is the innovative and highly ambitious algorithm introduced by <xref ref-type="bibr" rid="B35">Leyton and Osborne (2008)</xref>. However, the computational complexity of this work involves exponential dependency on the time interval used in the time integration. A small number of more recent works have addressed nonlinear differential equations, e.g., <xref ref-type="bibr" rid="B37">Lloyd et al. (2020)</xref>, <xref ref-type="bibr" rid="B36">Liu et al. (2021)</xref>, and <xref ref-type="bibr" rid="B53">Xue et al. (2021)</xref>. An example of an application to a nonlinear fluid dynamics problem is the work of <xref ref-type="bibr" rid="B19">Gaitan (2020)</xref>, where for a very specific one-dimensional problem the complexity analysis showed potential for quantum speed-up.</p>
<p>Early work in quantum computing relevant to the field of Computational Fluid Dynamics (CFD) mainly involved the work on quantum lattice-gas models by Yepez and co-workers (<xref ref-type="bibr" rid="B54">Yepez, 2001</xref>; <xref ref-type="bibr" rid="B5">Berman et al., 2002</xref>). This work typically used type-II quantum computers, consisting of a large lattice of small quantum computers interconnected in nearest neighbour fashion by classical communication channels. In contrast to these quantum lattice-gas based approaches, the present study focuses on quantum algorithms designed for near-future &#x2018;universal&#x2019; quantum computers. Previous work by Steijl and co-workers introduced hybrid classical-quantum algorithms for fluid simulations based on quantum-Poisson solvers (<xref ref-type="bibr" rid="B48">Steijl and Barakos, 2018</xref>) as well as a quantum algorithms for kinetic modelling of gases based on quantum walks (<xref ref-type="bibr" rid="B50">Todorova and Steijl, 2020</xref>; <xref ref-type="bibr" rid="B14">Steijl, 2020</xref>). Recently, the quantum-circuit implementation of non-linear terms was considered by <xref ref-type="bibr" rid="B15">Steijl (2022)</xref>. The present work for lattice-based fluid models represents a major further step in this direction.</p>
<sec id="s1-1">
<title>1.1 The important role of quantum computing simulators</title>
<p>Along with developing quantum algorithms for Computational Fluid Dynamics applications, an important part of the current work involves novel approaches for simulating quantum algorithms on classical hardware. Specifically, a detailed investigation into the potential of using FPGA-based hardware acceleration.</p>
<p>Simulation on classical hardware is essential to allow quantum algorithm researchers to test and validate new algorithms on a simulated &#x201c;ideal&#x201d; quantum computer (i.e., neglecting noise and decoherence errors for example) as well as in a simulated-error environment, allowing them to gain further insight into what is possible using this model. However, quantum computing simulation on classical hardware is extremely challenging in terms of computational time and memory requirement, particularly when the most general approach, i.e., storing the full quantum state vector amplitudes as used in the Schr&#xf6;dinger model, is employed. In general, computational time and memory requirements scale exponentially with the number of qubits, quickly reaching the limits of classical hardware.</p>
<p>Computing systems are becoming increasingly heterogeneous, using a variety of hardware accelerators to speed up computational tasks. One such type of accelerators, FPGAs (Field Programmable Gate Arrays), are reconfigurable devices that can be programmed after manufacturing to implement a user-specified digital circuit. They offer in particular very fine grained task parallelism and very high internal memory bandwidth, as well as excellent performance-per-Watt.</p>
<p>For the quantum algorithms for Computational Fluid Dynamics applications considered here, an important research question is if and how FGPAs can be effectively used in the evaluation of the quantum circuit implementations of the algorithms. To facilitate the simulation on FPGAs, this work details how quantum circuit transformations can be introduced to create multiple, smaller computational kernels by &#x201c;specializing&#x201d; the quantum state of one or more the most significant qubits in the quantum state vector. The underlying idea is to create a representation that will exploit the potential for fine-grained parallelism.</p>
</sec>
<sec id="s1-2">
<title>1.2 Main contributions of this work</title>
<p>The main focus of the current work is the efficient simulation of large and complex quantum circuits representing lattice-based models of fluid mechanics. This way, the work also contributes to the ongoing quest to develop efficient quantum algorithms for LBM. The focus here is on a reduced lattice-based model for fluid mechanics, specifically the D1Q3 model in a modified form to facilitate quantum-computer implementation. A key feature in the present research work is the evaluation of the non-linear equilibrium distribution function using quantum computational basis encoding. For the quantum-circuit implementation of the D1Q3 model, a series of quantum-circuit transformation techniques are proposed to facilitate the efficient evaluation of the quantum algorithm while benefiting from the fine-grained parallelism offered by FPGAs. The main contributions can be summarized as follows:<list list-type="simple">
<list-item>
<p>&#x2022; Demonstration of how quantum algorithms including non-linear terms can be derived by employing quantum computational basis encoding. Although the use of this type of encoding in general precludes exponential speed-ups relative to classical algorithms, it is expected that this approach has significant potential as part of larger quantum algorithms and when achieving polynomial speed-up is sufficient;</p>
</list-item>
<list-item>
<p>&#x2022; Introduction of a quantum algorithm defining the non-linear equilibrium distribution function for the D1Q3 lattice model in the quantum computational basis;</p>
</list-item>
<list-item>
<p>&#x2022; Introduction of a quantum-floating point format with reduced precision with key features of IEEE-754 standard, i.e., use of hidden-qubit approach for mantissa, the use of sub-normal numbers and consistent rounding (here, rounding-down to nearest);</p>
</list-item>
<list-item>
<p>&#x2022; Detailed demonstration of how the derived circuits for the D1Q3 equilibrium distribution function in quantum computational basis can be transformed to facilitate efficient simulation on FPGAs. The reduced memory requirements resulting from these transformations will also benefit CPU/GPU based simulation;</p>
</list-item>
<list-item>
<p>&#x2022; Introduction of a Haskell-based toolchain and eDSL for specifying and compiling quantum circuits for an FPGA-based architecture;</p>
</list-item>
<list-item>
<p>&#x2022; Comparison of a baseline FPGA-based approach with equivalent CPU/GPU-based approaches for quantum circuit simulation;</p>
</list-item>
<list-item>
<p>&#x2022; Demonstration of the performance per Watt improvement of the baseline FPGA architecture over the CPU-based approach;</p>
</list-item>
</list>
</p>
<p>The structure and content of this work can be summarized as follows. <xref ref-type="sec" rid="s2">Section 2</xref> briefly reviews essentials aspects of quantum computing of particular relevance to the present work. <xref ref-type="sec" rid="s3">Section 3</xref> presents a detailed literature review focusing on quantum computer simulation techniques as well as previous work in developing quantum algorithms employing computational-basis encoding. <xref ref-type="sec" rid="s4">Section 4</xref> details the work flow used in the present work to go from quantum circuits to FPGA implementation. <xref ref-type="sec" rid="s5">Section 5</xref> briefly reviews the Lattice Boltzmann Method, introducing the concepts of &#x201c;streaming&#x201d; and &#x201c;collision&#x201d; operations. Since the most widely used LBM models, D2Q9 and D3Q27, were deemed too complex for the current proof-of-concept work, the reduced D1Q3 model is described in <xref ref-type="sec" rid="s6">Section 6</xref>, followed by its modified formulation in <xref ref-type="sec" rid="s7">Section 7</xref>. <xref ref-type="sec" rid="s7">Section 7</xref> also introduces the quantum floating-point approach used in the present work, introduced and detailed in previous work (<xref ref-type="bibr" rid="B15">Steijl, 2022</xref>). For the non-linear collision term of the D1Q3 model, <xref ref-type="sec" rid="s8">Section 8</xref> then details the design of the quantum-circuit implementation. The quantum-circuit transformation steps used to facilitate efficient simulation on FPGAs is detailed in <xref ref-type="sec" rid="s9">Section 9</xref>. The computational complexity in terms of required number of qubits for &#x2018;full&#x2019; and &#x2018;reduced&#x2019; circuits is detailed in <xref ref-type="sec" rid="s10">Section 10</xref>. <xref ref-type="sec" rid="s11">Section 11</xref> details two examples of reduced quantum circuits where the introduced transformation steps reduced the quantum circuit from 37 to 25 qubits. In <xref ref-type="sec" rid="s12">Section 12</xref>, results from simulating the discussed example quantum circuits are presented and analyzed, and suggestions for improvements to the FPGA architecture are given. Finally, <xref ref-type="sec" rid="s13">Section 13</xref> presents concluding remarks and outlines steps for future research.</p>
</sec>
</sec>
<sec id="s2">
<title>2 Quantum computing principles</title>
<p>Before detailing the quantum algorithms introduced in this work along with the quantum circuit transformation, a few essentials aspects of quantum computing of particular relevance to the present work are briefly reviewed. For a more thorough background we refer to well-established textbooks, e.g., <xref ref-type="bibr" rid="B43">Nielsen and Chuang (2010)</xref>.</p>
<sec id="s2-1">
<title>2.1 Amplitude-based and computational-basis encoding</title>
<p>Typically, there are two methods of encoding the result of a quantum algorithm: encoding within the amplitudes of the quantum state and encoding within the computational basis of the quantum state. Most existing quantum algorithms employ the first method and encode the input information (as well as the output information) in the amplitudes of the quantum states. A key feature of this encoding method is that it enables the simultaneous manipulation of 2<sup>
<italic>n</italic>
</sup> amplitudes by performing a single unitary operator on a <italic>n</italic>
<sub>
<italic>q</italic>
</sub>-qubit coherent quantum register. It is the most commonly used encoding method to take advantage of quantum parallelism in quantum computing. As an example, the widely-used Quantum Fourier Transform (QFT) uses amplitude-based encoding, where the <italic>N</italic> &#x3d; 2<sup>
<italic>nq</italic>
</sup> input defines as complex amplitude <italic>x</italic>
<sub>
<italic>j</italic>
</sub> with <italic>j</italic> &#x2208; [0, <italic>N</italic> &#x2212; 1] gets transformed to an output state defined by <italic>N</italic> complex amplitudes <italic>y</italic>
<sub>
<italic>j</italic>
</sub> (<italic>j</italic> &#x2208; [0, <italic>N</italic> &#x2212; 1]):<disp-formula id="e1">
<mml:math id="m1">
<mml:munderover accentunder="false" accent="false">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2192;</mml:mo>
<mml:munderover accentunder="false" accent="false">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(1)</label>
</disp-formula>
</p>
<p>Encoding within the computational basis of the quantum state is not as widely used. For some tasks performed by quantum algorithms, this computational basis encoding is more efficient than the amplitude encoding. Also, for some computational tasks, such as the addition of two vectors, amplitude encoding creates problems in case the two vectors cancel each other and create a 0 vector that cannot be defined in terms of quantum amplitude encoding. As, a result, quantum computing in the computational basis (QCCB) is widely-used in quantum algorithms performing arithmetic operations. Also, in some quantum algorithms involving the Fourier transformation, the Fourier coefficients may be needed in the computational basis (<xref ref-type="bibr" rid="B55">Zhou et al., 2017</xref>). The quantum algorithm for computing the Fourier transform in the computational basis (termed QFTC) by <xref ref-type="bibr" rid="B55">Zhou et al. (2017)</xref> enables the Fourier-transformed coefficient to be encoded in the computational basis as follows,<disp-formula id="e2">
<mml:math id="m2">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2192;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(2)</label>
</disp-formula>where <inline-formula id="inf1">
<mml:math id="m3">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> corresponds to the fixed-point binary representation of <italic>y</italic>
<sub>
<italic>k</italic>
</sub> &#x2208; (&#x2212;1, 1) using two&#x2019;s complement format. In the algorithm proposed by <xref ref-type="bibr" rid="B55">Zhou et al. (2017)</xref>, the input vector <inline-formula id="inf2">
<mml:math id="m4">
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
</mml:math>
</inline-formula> is provided by an oracle <italic>O</italic>
<sub>
<italic>x</italic>
</sub> such that,<disp-formula id="e3">
<mml:math id="m5">
<mml:msub>
<mml:mrow>
<mml:mi>O</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:munderover accentunder="false" accent="false">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(3)</label>
</disp-formula>which can be efficiently implemented if <inline-formula id="inf3">
<mml:math id="m6">
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
</mml:math>
</inline-formula> is efficiently computable or by using updatable quantum memory (qRAM) that takes complexity log(<italic>N</italic>) under certain conditions (<xref ref-type="bibr" rid="B55">Zhou et al., 2017</xref>). Comparing <xref ref-type="disp-formula" rid="e1">Eqs 1</xref>, <xref ref-type="disp-formula" rid="e2">2</xref>, it is clear that encoding in the computational basis requires a number of additional qubits depending on the required fixed-point representation.</p>
<p>In terms of matrix computations, <xref ref-type="bibr" rid="B39">Ma et al. (2020)</xref> introduced a quantum algorithm for the computation of the QR matrix decomposition using computational basis encoding. The simulation time of the algorithm shows a polynomial speed-up relative to classical algorithms. In the QCCB-based QR algorithm, real numbers are encoded using a fixed-point representation. This means that any real number with its amplitude bounded by positive integer <italic>M</italic> can be approximate to precision <italic>O</italic>(<italic>M</italic>/2<sup>
<italic>m</italic>
</sup>) using <italic>m</italic> bits. A key factor in achieving the polynomial time complexity gain relative to classical algorithms, is that this representation accuracy is independent of the matrix size considered. In addition to the quantum QR decomposition algorithm, <xref ref-type="bibr" rid="B39">Ma et al. (2020)</xref> also proposed a general approach to simulate any quantum algorithm based on amplitude encoding by using the QCCB. The authors show that for this QCCB simulation, the simulation time does not exceed <italic>O</italic>(<italic>N</italic>
<sup>2</sup>
<italic>polylog</italic>(<italic>N</italic>)) times the cost of the original quantum algorithm based on amplitude encoding. It should be noted that to achieve this performance, the QCCB-based algorithms introduced by Ma et al. require an updatable quantum memory (qRAM) where the cost of updating <italic>n</italic>
<sub>
<italic>up</italic>
</sub> entries is <italic>O</italic>(<italic>n</italic>
<sub>
<italic>up</italic>
</sub> log(<italic>n</italic>
<sub>
<italic>up</italic>
</sub>)). Such an updatable quantum memory model was previously used and investigated by <xref ref-type="bibr" rid="B29">Kerenidis and Prakash (2020)</xref>.</p>
<p>Based on the published works using the quantum computational basis encoding, it is clear that this approach has not been as widely explored as amplitude encoding. The main reason is that the quantum parallelism and exponential saving in storage offered by quantum amplitude-encoding is lost. However, it is clear that important and meaningful quantum algorithms using computational-basis encoded can still be obtained when used as part of a larger quantum algorithm or in cases where a suitable-designed updatable quantum memory is available.</p>
</sec>
<sec id="s2-2">
<title>2.2 Quantum computing simulation approaches</title>
<p>The most general approach to simulating the quantum state vector in a quantum computer employs the Schr&#xf6;dinger wave function approach where the coherent quantum state of an <italic>n</italic>
<sub>
<italic>q</italic>
</sub>-qubit register is defined by <italic>N</italic> &#x3d; 2<sup>
<italic>nq</italic>
</sup> complex amplitudes. In the following, this approach is termed &#x201c;full state-vector approach.&#x201d; Alternatively, the exponential scaling can be addressed by avoiding the Schr&#xf6;dinger wavefunction representation as used in the full-state vector approach. <xref ref-type="bibr" rid="B1">Aaronson and Gottesman (2004)</xref>, <xref ref-type="bibr" rid="B20">Garcia and Markov (2015)</xref> and more recently, <xref ref-type="bibr" rid="B34">Lee et al. (2018)</xref>, used the Heisenberg representation of the quantum circuit <italic>via</italic> Stabilized Frames. This approach is limited to specific quantum circuits, i.e., termed stabilizer circuits, and for these cases has a polynomial scaling of memory and computational cost with increasing qubits. However, this approach cannot be used for general quantum circuits. Therefore, in the present work, the focus is on simulation techniques based on Schr&#xf6;dinger wavefunction representation. This approach can be used for quantum algorithms using the quantum-amplitude encoding as well as for algorithms using computational-basis encoding.</p>
</sec>
</sec>
<sec id="s3">
<title>3 Literature review</title>
<sec id="s3-1">
<title>3.1 Software-based simulation approaches</title>
<p>Early works related to the development of massively parallel quantum computer simulators include <xref ref-type="bibr" rid="B17">De Raedt et al. (2007)</xref> and <xref ref-type="bibr" rid="B49">Tabakin and Julia-Diaz (2009)</xref>. Both works involve highly optimized simulators based on the full state vector approach, implemented in Fortran using the MPI library to exploit parallelism on distributed-memory architectures. For a range of textbook examples, very good parallel scaling was observed for tests with upto 4,096 processors documented in <xref ref-type="bibr" rid="B17">De Raedt et al. (2007)</xref>. The work on QCMPI reported by <xref ref-type="bibr" rid="B49">Tabakin and Julia-Diaz (2009)</xref>, was mainly motivated to facilitate numerical examination of not only how QC algorithms work, but also to include noise, decoherence, and attenuation effects and to evaluate the efficacy of error correction schemes. Both works focus on evaluating quantum circuits, while earlier work by <xref ref-type="bibr" rid="B16">De Raedt et al. (2000)</xref> involved a Quantum Computer Emulator designed to simulate the physical realization of the quantum computer and a graphical user interface to program and control the simulator. The potential to speed-up large-scale parallel simulations such as those described by <xref ref-type="bibr" rid="B17">De Raedt et al. (2007)</xref>and <xref ref-type="bibr" rid="B49">Tabakin and Julia-Diaz (2009)</xref> using Graphics Processing Units (GPUs) has been thoroughly investigated in the past decade. Early work includes <xref ref-type="bibr" rid="B24">Guti&#xe9;rrez et al. (2010)</xref> and <xref ref-type="bibr" rid="B38">Lu et al. (2013)</xref>. In the work of Gutierrez and co-workers, the simulation of an ideal quantum computer using NVIDIA&#x2019;s CUDA GPU programming model is discussed in the context of how such a problem can benefit from the high computational capacities of GPUs. The simulator discussed in their work takes into account memory reference locality issues. The work showed that the challenge of achieving a high performance depends strongly on the explicit exploitation of memory hierarchy.</p>
<p>Highly-optimized approaches of the full state vector approach aimed at avoiding the exponential scaling of memory and computational cost with increasing number of qubits have been investigated for more than 2&#xa0;decades. One possibility (e.g., <xref ref-type="bibr" rid="B51">Viamontes et al., 2003</xref>; <xref ref-type="bibr" rid="B45">Rosenbaum, 2010</xref>) involves employing the Schr&#xf6;dinger wavefunction representation (as used in the full-state vector approach) along with compact representation of amplitudes using tree-based or decision-diagram based data structures. For a range of practically relevant quantum algorithms, significant memory and time savings were documented relative to the full-state vector approach. However, worst-case situations often occur where memory and time complexity are still exponential with number of qubits.</p>
</sec>
<sec id="s3-2">
<title>3.2 Quantum computer simulations and emulations using FPGAs</title>
<p>The earliest work in simulating quantum circuits on FPGAs dates back to <xref ref-type="bibr" rid="B30">Khalid et al. (2004)</xref>. A compiler which produces VHDL, a hardware description language, code that emulates the quantum circuit on the FPGA was developed. It emulates quantum parallelism by constructing parallel data paths for the state vector amplitudes representing the qubits, i.e. implementing the whole quantum circuit in the FPGA fabric. State vector amplitudes are implemented by fixed point numbers to keep the size of the circuits manageable. Fixed point was also chosen since the probability amplitudes can only have a decimal part of 0 or 1. This approach emulates a full quantum circuit on the FPGA, requiring a full synthesis when changing the circuit.</p>
<p>The approach used in <xref ref-type="bibr" rid="B3">Aminian et al. (2008)</xref> divides quantum circuit simulation into two circuit types based on gates used in the circuit. For circuits involving only X, Y, Z, and CNOT, they reduce the Logic Cell (LC) usage required for each type of gate to a handful (X: 2, Y: 6, Z: 2, CNOT: 4). They do this by adding extra information bits (basis, complexity, sign) and simply operating on them when applying any of these gates (however there is more basis bits in the case of CNOT). The second group is H, PS (phase shift), and CR (controlled rotation), which are implemented directly as adders and multipliers, requiring resources which increase with the number of mantissa bits. For circuits involving both groups of gates, they apply a different simulation policy than when just XYZC gates are used.</p>
<p>
<xref ref-type="bibr" rid="B12">Conceicao and Reis (2015)</xref> address the issue of re-synthesis present in prior works. They present a reusable architecture for which synthesis is only rerun when the number of qubits or mantissa bits of the fixed point representation is required to be changed. In their design, a control unit holds an address of a an instruction in some instruction memory (list of gates) and a quantum Arithmetic Logic Unit (ALU) is fed a gate operational code (opcode), target qubit, and two control qubits at each gate and then communicates with a quantum register to perform the gate. They report their LC usage for a number of algorithms and benchmarks. In terms of LC usage, they are outperformed by <xref ref-type="bibr" rid="B3">Aminian et al. (2008)</xref>, which they point out, but also observe that the ratio between their average usage of logic cells decreases in comparison when increasing the number of qubits from 3 to 8, leading them to believe their system would be better when scaled up.</p>
<p>
<xref ref-type="bibr" rid="B33">Lee et al. (2016)</xref> developed a serial-parallel architecture-based FPGA emulation framework for quantum computing and, for small numbers of qubits, demonstrated significant speed-ups relative to CPU-based emulations.</p>
<p>
<xref ref-type="bibr" rid="B44">Pilch and Dlugopolski (2019)</xref> proposed, designed and implemented an easily scalable universal quantum computer emulator, focused on reflecting natural quantum processes in hardware, while maintaining the time complexity of quantum algorithms. The underlying idea is to move the weight of complexity from time to hardware resources by using the inherent parallelism of FPGAs. As proof-of-concept, the authors created a hardware-software system capable of running and correctly interpreting results of the Deutsch quantum algorithm. So far, only small circuits where considered, e.g., the Deutsch algorithm was emulated for a 2-qubit quantum computer.</p>
<p>The works discussed so far (<xref ref-type="bibr" rid="B30">Khalid et al., 2004</xref>; <xref ref-type="bibr" rid="B3">Aminian et al., 2008</xref>; <xref ref-type="bibr" rid="B33">Lee et al., 2016</xref>; <xref ref-type="bibr" rid="B44">Pilch and Dlugopolski, 2019</xref>) demonstrate the promise for emulating quantum circuits on FPGAs, albeit for low number of emulated qubits. <xref ref-type="bibr" rid="B40">Mahmud and El-Araby (2019)</xref> focus on scalability, presenting two architectures for emulation. The first is a CMAC (complex multiply-and-accumulate) unit-based system, which for a given quantum circuit, relies on having the full algorithm matrix precomputed. An optimization to this is to have a kernel which dynamically generates the values of the algorithm matrix, massively reducing the memory requirement. Using this architecture, <xref ref-type="bibr" rid="B40">Mahmud and El-Araby (2019)</xref> emulated a 20-qubit QFT, an increase in qubits compared to previous works in FPGA emulation of quantum circuits. This required the creation of a custom hardware architecture for generating the values of the QFT matrix. The second recognizes that there may be algorithms which have sparse algorithm matrices which may not be suited for the CMAC-based architecture. Instead, this architecture requires a custom acceleration kernel to be developed from the quantum algorithm, which is then applied to the input state vector. Using this architecture, they emulated a 30-qubit Quantum Haar Transform. This required the extraction of a simplified kernel from the mathematical description of the QHT rather than from its quantum circuit description. This is a considerably higher number of qubits than those achieved in previous works. However, no method of automating the generation of the kernels from a quantum circuit model description is discussed. The authors extend this method to Grover&#x2019;s database search algorithm in <xref ref-type="bibr" rid="B41">Mahmud et al. (2020)</xref>.</p>
<p>
<xref ref-type="bibr" rid="B31">Khalid et al. (2021)</xref> describe a proposal for a resource-efficient FPGA-based abstraction of quantum circuits. A non-programmable embedded system capable of storing, measuring, and introducing a phase shift in qubits is implemented. The proposed single-input single-output architecture implements single-input gates with corresponding memory and measurement blocks. A fixed-point quantum gate representation is used, using 8 bits (2-bit integer, and 6-bit fraction). By increasing the number of bits used for qubit representation, the quantized superposition states of the of qubit increase, leading to enhanced accuracy of the emulation results. The main objective of the proposed abstraction was to provide an FPGA-based platform as the fundamental sub-block for the design of quantum circuits. The quantum key distribution algorithm BB84 was implemented using the proposed platform as a proof-of-concept. The proposed design exhibits two principal properties of quantum computing, i.e., parallelism and probabilistic measurement.</p>
<p>The concept of using exponentially-increasing resources (with problem size) on an FPGA to maintain the exponential time-complexity gain of quantum algorithms relative to their classical counterparts was also investigated by <xref ref-type="bibr" rid="B8">Bonny and Haq (2020)</xref> who implemented the quantum <italic>k</italic>-means clustering algorithm on an FPGA emulator. Clustering is a technique involving the classification of unlabeled data into a number of categories, and is widely used in machine learning and data mining. The main computational work in the <italic>k</italic>-means clustering algorithm is the computation of the distance between points. Bonny and Haq model the points as <italic>n</italic>-dimensional vectors on the Bloch sphere and then use the inner product as an estimation of the distance between two vectors. In the example implementation 2D data was used. The work presented forms an example of a quantum-inspired algorithm allowing (exponential) speed-up relative to classical algorithms even when running on classical hardware, by trading time-complexity and resource use on the FPGA. Clearly, the rapid (exponential) increase of logic-gate resources with problems size limits this approach to relatively small problems. For quantum circuit emulation, this means that only a few qubits can be used when trying to main exponential time-complexity gain. This work follows on from previous works into such quantum-inspired algorithms including work on modified Grover&#x2019;s search algorithm (<xref ref-type="bibr" rid="B2">A&#xef;meur et al., 2007</xref>) as well as quantum-inspired evolutionary algorithms for optimization problems (<xref ref-type="bibr" rid="B25">Han and Kim, 2002</xref>). More recently, Fujitsu&#x2019;s quantum-annealing inspired optimizer as described by <xref ref-type="bibr" rid="B4">Aramon et al. (2019)</xref> uses extensive hardware acceleration techniques to achieve time-complexity improvements.</p>
<p>This summary of works involving hardware acceleration of quantum computing simulation shows that there is a growing interest in simulating quantum circuits on FPGAs and their results show that there can be a considerable computational advantage to using an FPGA to simulate a quantum computer. However, most of the research so far only considered circuits with few <inline-formula id="inf4">
<mml:math id="m7">
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mo>&#x3c;</mml:mo>
<mml:mn>10</mml:mn>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> qubits and also did not consider circuit transformation techniques for reducing the number of qubits. The work which demonstrated the most promise for scaling to a high number of qubits recently is <xref ref-type="bibr" rid="B40">Mahmud and El-Araby (2019)</xref> and <xref ref-type="bibr" rid="B41">Mahmud et al. (2020)</xref> specialized kernel-based approach, using which they ran a 30-qubit QHT, and a 32-qubit Grover&#x2019;s search circuits on an FPGA. While this approach reaches the highest number of qubits simulated on an FPGA in the literature, of which we are aware, it is not very easily reusable. Using their more circuit-independent CMAC-based approach, they were able to simulate a 20-qubit QFT circuit. Our work is in line with their more generic approach because, as we discuss in the next section, reusability is one of our primary goals.</p>
</sec>
</sec>
<sec id="s4">
<title>4 FPGA simulation flow</title>
<p>Given a quantum circuit description, we have developed a workflow to convert it to a configuration for the FPGA which simulates the quantum circuit. Our goals for developing an FPGA simulator for quantum circuits are: universality (ability to simulate any theoretical gate), reuseability (a recompilation process should not be necessary between different circuit runs), and scalability (we should be able to simulate any feasible number of qubits without recompiling). We achieve universality by making sure the system has built-in at least a universal set of quantum gates. Our current architecture stores the state vector in FPGA board memory and compute kernels corresponding to each quantum gate access the memory to perform the necessary computations. Since in general each gate application needs to access the entire memory space, we perform gate applications sequentially and attempt to optimize the performance of the application of a general gate.</p>
<p>The compute kernels on the FPGA expect the following data about each gate: an opcode representing the gate being applied, a target qubit index, and some number of control qubit indices. For a given architecture, we specify a maximum number of allowed controls at compile time, knowing that with circuit transformations, a gate with a large number of controls can be reduced to a set of gates with lower maximum number of controls per gate. (Alternatively, a new circuit representation could be compiled accounting for a larger maximum number of controls.) Thus, for an architecture with up to 2 controls per gate, the kernels expect four unsigned integers representing each gate. Some variations on this design which were implemented directly pass a 2 &#xd7; 2 matrix to the kernels instead of a gate opcode. This has the benefit of reducing out an extra control step on the board (switching on the opcode) freeing up some compute resources. While this increases communication time between the board and the host, this overhead would be polynomial in the number of gates, which, when compared to the exponentially growing computations needed to execute one gate, becomes negligible.</p>
<p>The FPGA operates on the state vector amplitudes in memory and for optimal use of the FPGA board resources, qubits are referred to only by their index in a qubit register. Based on this index, a gate application is broken down into 2<sup>
<italic>n</italic>&#x2212;1</sup> 2 &#xd7; 2 matrix multiplications. The main task is to maximize the number of multiplications that can be executed in parallel. Using the qubit index and the multiplication iteration index, we can find the indices of the required pair of amplitudes for each iteration step. In general, these iteration steps will be distributed across some number of kernels on the board.</p>
<sec id="s4-1">
<title>4.1 Compiling a quantum circuit</title>
<p>We developed a toolchain in the functional programming language Haskell to allow for efficient specification and testing of quantum circuits. The toolchain includes an embedded Domain-Specific Language (eDSL) that allows for specification and static analysis of quantum circuits. This embedded language allows users to label qubits and use high-level circuit constructs, like looping, tiling, etc. The functionality offered by this toolchain is similar to other functional language-based quantum computing tools like Quipper (<xref ref-type="bibr" rid="B23">Green et al., 2013</xref>). It was implemented from scratch, however, to have maximum control over the circuit reductions and any optimizations necessary for an FPGA-based architecture.</p>
<p>Since anything the Haskell tool would do on any form of quantum circuit input would be static compile-time checks/processing (nothing close to exponential or related to the number of qubits involved), then the host code controlling the FPGA environment should be capable of doing the same in negligible time compared to the execution time of the quantum circuit on the simulator, which will necessarily be exponential to maintain generality. However, writing the compiler step in a separate toolchain allows for more modularity of our designs and separation of concerns. While currently the toolchain has no functionality for adding architecture-specific optimizations (such as gate fusion or other system-level changes requiring a higher level instruction set), it acts as a starting point for future research. In addition, usually (and in this case) the host code is written in C&#x2b;&#x2b;; writing and maintaining an eDSL in Haskell will be considerably easier and less time consuming.</p>
<p>The toolchain offers several constructs for looping gates over sets of qubits, managing complex controls, and defining intermediate circuit components. Some of these constructs are demonstrated in <xref ref-type="statement" rid="Listing_1">Listing 1</xref>.<list list-type="simple">
<list-item>
<p>
<monospace>fullAdd :: QReg -&#x3e; QReg -&#x3e; Qu -&#x3e; Qu -&#x3e; Circ</monospace>
</p>
</list-item>
<list-item>
<p>
<bold>&#x2003;</bold>
<monospace>fullAdd in1 in2 c z &#x3d; if length in1 /&#x3d; length in2 then error "fullAdd: Input qubit register lengths must be identical." else let</monospace>
</p>
</list-item>
<list-item>
<p>
<bold>&#x2003;</bold>
<monospace>combinedRegister &#x3d; c : interleave in2 in1</monospace>
</p>
</list-item>
<list-item>
<p>
<bold>&#x2003;</bold>
<monospace>in</monospace>
</p>
</list-item>
<list-item>
<p>
<bold>&#x2003;&#x2003;</bold>
<monospace>ladderQC 2 3 maj combinedRegister &#x2b;&#x2b;</monospace>
</p>
</list-item>
<list-item>
<p>
<bold>&#x2003;&#x2003;</bold>
<monospace>cnot (last in1) z &#x2b;&#x2b;</monospace>
</p>
</list-item>
<list-item>
<p>
<bold>&#x2003;&#x2003;</bold>
<monospace>reverseLadderQC 2 3 unmaj combinedRegister</monospace>
</p>
</list-item>
<list-item>
<p>
<monospace>square :: QReg -&#x3e; QReg -&#x3e; Qu -&#x3e; Qu -&#x3e; Circ</monospace>
</p>
</list-item>
<list-item>
<p>
<bold>&#x2003;</bold>
<monospace>square u r c anc &#x3d; if 2&#x2a;length u /&#x3d; length r then error "square: The size of register r must be double that of u." else let</monospace>
</p>
</list-item>
<list-item>
<p>
<bold>&#x2003;</bold>
<monospace>inputSize &#x3d; length u</monospace>
</p>
</list-item>
<list-item>
<p>
<bold>&#x2003;</bold>
<monospace>adderCirc &#x3d; control anc $ fullAdd u (quRange r (head r) (r!!(inputSize-1))) c (r!!inputSize)</monospace>
</p>
</list-item>
<list-item>
<p>
<bold>&#x2003;</bold>
<monospace>controlledAdderBlock ctrl &#x3d; cnot ctrl anc &#x2b;&#x2b; adderCirc &#x2b;&#x2b; cnot ctrl anc</monospace>
</p>
</list-item>
<list-item>
<p>
<bold>&#x2003;</bold>
<monospace>shiftCirc &#x3d; leftShift r in</monospace>
</p>
</list-item>
<list-item>
<p>
<bold>&#x2003;</bold>
<monospace>loopSingleQubitGateOverReg (\ctrl -&#x3e; controlledAdderBlock ctrl &#x2b;&#x2b; shiftCirc) (take (inputSize-1) u) &#x2b;&#x2b;</monospace>
</p>
</list-item>
<list-item>
<p>
<bold>&#x2003;</bold>
<monospace>controlledAdderBlock (last u)</monospace>
</p>
</list-item>
</list>
</p>
<p>
<statement content-type="listing" id="Listing_1">
<label>Listing 1</label>
<p>Generic input size full Cuccaro adder and square circuit example implementation in the presented Haskell eDSL.</p>
</statement>
</p>
<p>After an FPGA board configuration is compiled, the quantum circuit simulation flow starts with a user-specified circuit description. We can describe the circuit using an eDSL in Haskell, allowing for complex higher-level circuit operators to be used; alternatively, the toolchain can read a QASM-like file specifying the circuit. This process is demonstrated in <xref ref-type="fig" rid="F1">Figure 1</xref>. The toolchain first verifies the specified circuit, ensuring all qubits used are valid (have an index in the register) and no gates are specified with invalid target/controls. Then the named qubit identifiers are parsed away and the qubits are mapped to an index in the quantum register. At this point in the compilation process, some constructs are still available to the toolchain which would not necessarily be available to the FPGA (like direct calls to a SWAP gate, or a high number of controls), which need to be reduced away. SWAP gates are replaced with their equivalent CNOT specifications, negative controls are reduced by negating the control qubits before and after the gate, and gates with a higher number of controls than is supported are expanded to several gates with fewer controls. This results in a circuit which is ready to be converted to a &#x201c;QP&#x201d; file which is simply a list of integers specifying the circuit. The first element in this list is always the number of qubits required for the circuit. Taking into account the maximum number of controls allowed by an architecture (<italic>C</italic>), each emitted gate consists of its opcode, target qubit, followed by a constant number of controls. The resulting list is then written to disk, ready to be read by the simulator host.</p>
<fig id="F1" position="float">
<label>FIGURE 1</label>
<caption>
<p>Haskell Quantum Circuit Compilation toolchain.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g001.tif"/>
</fig>
</sec>
<sec id="s4-2">
<title>4.2 Simulator implementation details</title>
<p>HLS design tools for FPGAs (like Intel&#x2019;s Quartus/Intel&#x2019;s FPGA OpenCL Compiler and Xilinx&#x2019;s SDAccel toolchain) have been growing in popularity and effectiveness over the past decade; making it possible to develop customized FPGA architectures for domain-specific problems in a relatively high-level language like OpenCL, without requiring knowledge of an HDL like Verilog.</p>
<p>The presented simulator is written in OpenCL and built using Intel/Altera SDK for OpenCL. We used Altera Offline Compiler (aoc) version 17.1. The architecture we have implemented is a baseline implementation of a full state vector-based quantum circuit simulator. The simulator is universal, with direct on board support for the <italic>H</italic>, <italic>X</italic>, <italic>Y</italic>, <italic>Z</italic>, and <italic>R</italic>
<sub>
<italic>m</italic>
</sub> (integer-parametrised phase gate) gates and any controlled variations of them, up to a static maximum number of controls per gate. We currently make use of the dynamic scheduling of the NDRange OpenCL construct to submit gate applications to the kernel architecture on the board. <xref ref-type="fig" rid="F2">Figure 2</xref> show the steps involved in a circuit simulation. The QP instructions generated from the compilation toolchain are read from disk on the host CPU. These instructions contain the qubit count of the circuit, and based on this sufficient memory is then allocated on the host and device. The current representation used for the state vector storage in memory is using 32-bit floating-point complex numbers, meaning we need to allocate 2<sup>
<italic>n</italic>
</sup> &#xd7; (2 &#xd7; 4) bytes to simulate the given circuit. Based on user input at runtime, the initial quantum state of the system is set and then copied to the device DRAMs.</p>
<fig id="F2" position="float">
<label>FIGURE 2</label>
<caption>
<p>QProblem to FPGA flow for an Over-PCIe architecture. At each gate, the QP instruction is sent to the compute units over the host-FPGA PCIe connection.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g002.tif"/>
</fig>
<p>Currently all FPGA architectures we have explored are parametrised by some values at compile time; primarily these are the number of compute units (NCU), which are the duplicated kernels that perform the CMACs required for the gate iteration computations, and the maximum number of controls per gate (NCONTROLS). Other more customized architectures may have more than these parameters at compile time, particularly for caching and manual memory buffering. Note that the NCONTROLS parameter determines the format of the input QP instructions; which the Haskell tool facilitates by generating QP instructions with a fixed total number of controls per gate. For non-pipelined architectures, these duplicated kernels may each include their own memory interfaces. However, for pipelined architectures (generally seen as more efficient), the compute units will generally receive their inputs over channels or pipes.</p>
<p>As discussed above, our focus is optimising the QWM simulation method with the full state vector being stored in memory. The main difficulty in performing a gate application in parallel arises from having an exponential memory space which has to be fully iterated through for a single gate computation (each control reduces the required accesses by half, but in general we still at least access an exponential subset of the memory space).</p>
<sec id="s4-2-1">
<title>4.2.1 Classifying architectures</title>
<p>A QWM simulation architecture can be designed such that either all information required to run the circuit is accessible to the FPGA at the start of the circuit runtime process (i.e., caching the QP instructions in BRAMs/DRAM), or for the host process to interpret the QP file and enqueue each gate separately to the board. We distinguish between these different approaches and identify some intitial advantages and disadvantages to each:</p>
<p>An On-board QWM architecture is one where the QP instructions are stored in BRAMs/DRAM at the start of the circuit runtime process. The main advantages of this approach is that it eliminates all of the FPGA-host communication overhead, which is over a relatively slow PCIe connection, and it allows for cross-gate optimizations on board (e.g., using the same memory buffer for multiple gates). The main disadvantage is that the architecture requires extra resource overhead on the FPGA fabric to store and process the QP, and schedule gate simulations.</p>
<p>On the other hand, an Over-PCIe QWM architecture is one where the host process reads the QP instructions from a file and enqueues each gate to the board one-by-one. While communicating over PCIe is much slower than on-board communication via BRAMs, if loading a gate from the host can occur concurrently with computations in the kernels, then that communication time eventually becomes negligible for larger qubit counts; as the gate execution time grows exponentially with the number of qubits. This is the primary motivator for exploring the design space of simulators with this approach: at scale, the host-FPGA communication time is negligible. This architecture can be implemented with OpenCL&#x2019;s NDRange construct, making use of the compiler&#x2019;s automatic dynamic scheduling.</p>
<p>A further category along which we can divide architectures is pipelining. While most HLS compilation tools have functionality to automatically pipeline loops, the main motivator for designing an explicitly-pipelined architecture is control over the data paths of the amplitudes from memory to the compute units; allowing for experimenting with customizable caches, and memory access patterns.</p>
<p>We refer back to the work by <xref ref-type="bibr" rid="B33">Lee et al. (2016)</xref> where the authors distinguish and describe three types of architectures: concurrent, pipelined, and a novel serial-parallel architecture. The described serial-parallel architecture resembles what we describe as pipelined here (with dynamically scheduled gates and the gate executions being pipelined); with one key difference: the proposed architecture is for a quantum circuit simulation whose state vector fits entirely on the board, significantly reducing the number of qubits which can be simulated. Our architecture expands the same pipelining methods to architectures with access to DRAM banks, allowing us to simulate up to 29 qubits in 4.3&#xa0;GB of memory. Another difference is their compute units (referred to as the ALU in the architecture diagrams) are customized for optimising a particular quantum circuit, the QFT; while our architectures are designed for maximum reuseability and universality.</p>
<p>Currently the best-performing type of architecture we have implemented is the Over-PCIe non-explicitly pipelined type. We implement this using our described NDRange approach and our results are presented based on this architecture. As we have yet to implement any caching or memory access pattern optimizations, we believe this outperforms the other designs due to the OpenCL NDRange dynamic scheduler being far more efficient for a memory access pattern as random as we currently allow than our single-task kernel approaches for on-board simulation. Since we use an NDRange kernel and no channels for explicit pipelining, our CPU and GPU comparison targets are evaluated based on the same kernel design as the FPGA. The implementation of this kernel compute unit is described in the next section.</p>
</sec>
<sec id="s4-2-2">
<title>4.2.2 Compute unit kernel details</title>
<p>The host initializes a queue for submitting kernel jobs to the board and is now ready to start submitting QP instructions representing quantum gates to the FPGA. The architecture&#x2019;s NCU parameter defines number of identical compute units using the OpenCL num_compute_units attribute, over which the 2<sup>
<italic>n</italic>&#x2212;1</sup> NDRange work items are distributed, such that each kernel runs 2<sup>
<italic>n</italic>&#x2212;<italic>k</italic>&#x2212;1</sup> times per gate. The host waits for the queue to finish before submitting the next gate. In its loop, the kernel knows its current gate iteration index based on its own compute unit index and the work item index passed to it by the NDRange scheduler. Based on this, it can compute the required amplitude indices for the target qubit and the current iteration, read the amplitudes directly from the DRAM, perform the gate computation, and write them back.</p>
<p>The compute unit kernel&#x2019;s inputs at each gate are the following:<list list-type="simple">
<list-item>
<p>&#x2022; <italic>t</italic>: gate target qubit index,</p>
</list-item>
<list-item>
<p>&#x2022; <italic>c</italic>
<sub>0</sub>&#x2026;<italic>c</italic>
<sub>
<italic>NCONTROLS</italic>&#x2212;1</sub>: control qubit indices, equal to t to specify no control</p>
</list-item>
<list-item>
<p>&#x2022; <italic>mat</italic>
<sub>0</sub>&#x2026;<italic>mat</italic>
<sub>3</sub>: gate matrix values; generated by the host after parsing the gate code from the QP file.</p>
</list-item>
</list>
</p>
<p>As an NDRange kernel, the compute unit also implicitly receives a global ID representing the current gate iteration (<italic>i</italic>): this represents this kernel&#x2019;s current step in the execution of one gate. The compute unit starts by using the target qubit index and the gate iteration index to generate the indices of the pair of amplitudes required for this iteration. It generates these by finding the <italic>i</italic>th integer whose <italic>t</italic>th qubit is cleared; this is the first of the pair of indices. The second index is then found by adding the target stride (2<sup>
<italic>t</italic>
</sup>) to the first index. Finding this amplitude is straightforward, has <italic>O</italic>(1) complexity, and is implementable with bit-wise logic. In particular, our implementation uses the same bit-wise logic as <xref ref-type="bibr" rid="B28">Kelly (2018)</xref> for their OpenCL simulator targeted at GPUs. Next, the kernel processes the controls for this iteration based on this rule: if the control value is not the target qubit, check if the amplitude indices have the bit at the control qubit&#x2019;s position set to one; if so, this control&#x2019;s test passes and move on to the next. Note that the number of controls which need to be processed at each gate iteration is static and defined by the NCONTROLS parameter; thus the controls processing stage is parallelisable for any gate. If all the control tests pass, then the iteration step continues with the computation: it reads the amplitudes from the DRAM, performs the gate computation (complex matrix-vector multiplication implemented with CMACs), and writes the results back to the DRAM.</p>
<p>After all gates are submitted to the board and finish executing, the final state is read out from the FPGA&#x2019;s DRAM and written to an output file by the host. These results can then be verified.</p>
</sec>
</sec>
</sec>
<sec id="s5">
<title>5 The Lattice Boltzmann method</title>
<p>The present research effort aims to develop quantum-algorithm implementations of the Lattice Boltzmann method (LBM) for large-scale fluid dynamics simulations. As a first important step toward this, quantum algorithm for less complex Lattice Boltzmann methods, i.e. not modelling the full Navier-Stokes equations, are considered here. For context, first the Lattice Boltzmann equation forming the basis for the LBM is presented, followed by a detailed description of the reduced LB methods investigated here.</p>
<p>The Lattice Boltzmann equation used here is derived from a discrete-velocity discretization of the Bhatnagar-Gross-Krook (BGK) equation, such that the discretized particle distribution function is governed by the following equation:<disp-formula id="e4">
<mml:math id="m8">
<mml:mfrac>
<mml:mrow>
<mml:mi>&#x2202;</mml:mi>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x2202;</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">e</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x22c5;</mml:mo>
<mml:mo>&#x2207;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(4)</label>
</disp-formula>with <italic>f</italic>
<sub>
<italic>a</italic>
</sub>(<bold>x</bold>, <italic>t</italic>) &#x3d; <italic>f</italic>(<bold>x</bold>, <bold>e</bold>
<sub>
<italic>a</italic>
</sub>, <italic>t</italic>) is the non-equilibrium distribution for discrete velocity <bold>e</bold>
<sub>
<italic>a</italic>
</sub> for <italic>a</italic> &#x2208; [0, <italic>n</italic>
<sub>
<italic>DV</italic>
</sub> &#x2212; 1], <inline-formula id="inf5">
<mml:math id="m9">
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> is the corresponding equilibrium distribution function and <italic>&#x3c4;</italic> represents the relaxation time. For iso-thermal LBM models, based on the two-dimensional D2Q9 model, or the three-dimensional D3Q15, D3Q19 and D3Q27 models, the equilibrium distribution function can be written as,<disp-formula id="e5">
<mml:math id="m10">
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>&#x3c1;</mml:mi>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2b;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfrac>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">e</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x22c5;</mml:mo>
<mml:mi mathvariant="bold">V</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>9</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:msup>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>4</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfrac>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">e</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x22c5;</mml:mo>
<mml:mi mathvariant="bold">V</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:msup>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfrac>
<mml:mi mathvariant="bold">V</mml:mi>
<mml:mo>&#x22c5;</mml:mo>
<mml:mi mathvariant="bold">V</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mtext>&#x2009;;&#x2009;</mml:mtext>
<mml:mi>a</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
<mml:mi>V</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(5)</label>
</disp-formula>where <bold>V</bold> &#x3d; (<italic>u</italic>,<italic>v</italic>,<italic>w</italic>)<sup>
<italic>T</italic>
</sup> is the fluid velocity vector, <italic>w</italic>
<sub>
<italic>a</italic>
</sub> is a weighting factor and <bold>e</bold>
<sub>
<italic>a</italic>
</sub> is a discrete velocity, while <italic>n</italic>
<sub>
<italic>DV</italic>
</sub> denotes the number of discrete velocities in the model. The lattice speed <italic>c</italic> is defined as <italic>c</italic> &#x3d; <italic>&#x3b4;x</italic>/<italic>&#x3b4;t</italic>. The definition of the lattice speed <italic>c</italic> provides an explicit link between lattice spacing <italic>&#x3b4;x</italic> and time step <italic>&#x3b4;t</italic>. In the Lattice Boltzmann method (LBM), physical space is discretized using a regular lattice in a manner coherent with velocity-space discretization to preserve the conservation laws and to ensure the correct behavior of the macroscopic variables. Specifically, during a single time step, discrete values of distribution function <italic>f</italic>
<sub>
<italic>a</italic>
</sub> propagate in the direction of their corresponding discrete-velocity <bold>e</bold>
<sub>
<italic>a</italic>
</sub> to the nearest neighboring lattice point in that direction. Based on this &#x201c;streaming&#x201d; from on lattice point to a nearest neighbor lattice point the evolution of <italic>f</italic>
<sub>
<italic>a</italic>
</sub> can be written as,<disp-formula id="e6">
<mml:math id="m11">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">e</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mi>&#x3b4;</mml:mi>
<mml:mi>t</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>&#x3b4;</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(6)</label>
</disp-formula>
</p>
<p>The discretized distribution functions <italic>f</italic>
<sub>
<italic>a</italic>
</sub> and <inline-formula id="inf6">
<mml:math id="m12">
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> are related to the fluid density and momenta as follows,<disp-formula id="e7">
<mml:math id="m13">
<mml:mi>&#x3c1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:munderover accentunder="false" accent="false">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
<mml:mi>V</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:munderover accentunder="false" accent="false">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
<mml:mi>V</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mtext>&#x2009;;&#x2009;</mml:mtext>
<mml:mi>&#x3c1;</mml:mi>
<mml:mi mathvariant="bold">V</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:munderover accentunder="false" accent="false">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
<mml:mi>V</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">e</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:munderover accentunder="false" accent="false">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
<mml:mi>V</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">e</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
<label>(7)</label>
</disp-formula>
</p>
<p>In Lattice Boltmann Methods, the implementation of <xref ref-type="disp-formula" rid="e6">Eq. 6</xref> employs the stream-collide approach, i.e., the update of <italic>f</italic>
<sub>
<italic>a</italic>
</sub> from time <italic>t</italic> to <italic>t</italic> &#x2b; <italic>&#x3b4;t</italic> is performed in two steps:<list list-type="simple">
<list-item>
<p>&#x2022; Collision step. Creates an intermediate update of <italic>f</italic>
<sub>
<italic>a</italic>
</sub> to <inline-formula id="inf7">
<mml:math id="m14">
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi mathvariant="italic">int</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> based on collision term:</p>
</list-item>
</list>
<disp-formula id="e8">
<mml:math id="m15">
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi mathvariant="italic">int</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(8)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>&#x2022; Streaming step represents the convection on the left-hand side of <xref ref-type="disp-formula" rid="e6">Eq. 6</xref>, i.e., based on intermediate update <inline-formula id="inf8">
<mml:math id="m16">
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi mathvariant="italic">int</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> the final update is computes as,</p>
</list-item>
</list>
<disp-formula id="e9">
<mml:math id="m17">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">e</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mi>&#x3b4;</mml:mi>
<mml:mi>t</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>&#x3b4;</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi mathvariant="italic">int</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="bold">x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(9)</label>
</disp-formula>
</p>
<p>Clearly in the LBM, the non-linearity of the Navier-Stokes equations is represented in numerical moments defining fluid velocity from the non-equilibrium distribution function <italic>f</italic>
<sub>
<italic>a</italic>
</sub> and the product terms involving fluid velocity and discrete velocities in the local equilibrium distribution function <inline-formula id="inf9">
<mml:math id="m18">
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> defined in <xref ref-type="disp-formula" rid="e5">Eq. 5</xref>.</p>
</sec>
<sec id="s6">
<title>6 D1Q3 Lattice Boltzmann model</title>
<p>To facilitate quantum algorithm development, further reduced lattice Boltzmann models are considered. Here, the D1Q3 model is considered, as a model non-linear equation governing (some of) the nonlinear dynamics of a one-dimensional fluid flow. For the D1Q3 model, the direction vectors <italic>e</italic>
<sub>
<italic>i</italic>
</sub>, <italic>i</italic> &#x2208; [0, 2], density and velocity are defined as,<disp-formula id="e10">
<mml:math id="m19">
<mml:msub>
<mml:mrow>
<mml:mi>e</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mtable class="array">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mtd>
<mml:mtd columnalign="center">
<mml:mtext>for</mml:mtext>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd columnalign="center">
<mml:mtext>for</mml:mtext>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mtd>
<mml:mtd columnalign="center">
<mml:mtext>for</mml:mtext>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>2</mml:mn>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
<mml:mtext>&#x2009;;&#x2009;</mml:mtext>
<mml:mi>&#x3c1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:munderover accentunder="false" accent="false">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mtext>&#x2009;;&#x2009;</mml:mtext>
<mml:mi>u</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:math>
<label>(10)</label>
</disp-formula>and for the collision term,<disp-formula id="e11">
<mml:math id="m20">
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>Q</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>t</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mtable class="matrix">
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(11)</label>
</disp-formula>and therefore,<disp-formula id="e12">
<mml:math id="m21">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mtable class="matrix">
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2212;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2212;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2b;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mtable class="matrix">
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>u</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2212;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>u</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(12)</label>
</disp-formula>for <italic>u</italic> &#x2265; 0, therefore <italic>f</italic>
<sub>2</sub> &#x2265; <italic>f</italic>
<sub>0</sub>. For meaningful choices of positive <italic>u</italic>, all three components <inline-formula id="inf10">
<mml:math id="m22">
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula>, <inline-formula id="inf11">
<mml:math id="m23">
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> and <inline-formula id="inf12">
<mml:math id="m24">
<mml:msubsup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> will be positive numbers. Since the Lattice Boltzmann Method was derived under the assumption that <inline-formula id="inf13">
<mml:math id="m25">
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
</mml:math>
</inline-formula> will be a relatively small deviation from <inline-formula id="inf14">
<mml:math id="m26">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula>, we can therefore also assume that <italic>f</italic>
<sub>0</sub>, <italic>f</italic>
<sub>1</sub> and <italic>f</italic>
<sub>2</sub> will be positive numbers for meaningful choices of positive <italic>u</italic>.</p>
</sec>
<sec id="s7">
<title>7 Modified D1Q3 Lattice Boltzmann Method</title>
<p>To facilitate the implementation using the quantum circuit model, a number of modifications and re-normalizations are introduced in this section. Firstly, the original 3 direction vectors are replaced by 4, where the original single &#x201c;rest&#x201d; velocity is replaced by two identical &#x2018;rest&#x2019; velocities. This results in the following directions vectors, with corresponding definitions of density and velocity,<disp-formula id="e13">
<mml:math id="m27">
<mml:msub>
<mml:mrow>
<mml:mi>e</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mtable class="array">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mtd>
<mml:mtd columnalign="center">
<mml:mtext>for</mml:mtext>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd columnalign="center">
<mml:mtext>for</mml:mtext>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd columnalign="center">
<mml:mtext>for</mml:mtext>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>2</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mtd>
<mml:mtd columnalign="center">
<mml:mtext>for</mml:mtext>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>3</mml:mn>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
<mml:mtext>&#x2009;;&#x2009;</mml:mtext>
<mml:mi>&#x3c1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:munderover accentunder="false" accent="false">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mtext>&#x2009;;&#x2009;</mml:mtext>
<mml:mi>u</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:math>
<label>(13)</label>
</disp-formula>
</p>
<p>The original <italic>f</italic>
<sub>1</sub> distribution function will be replaced by two identical distributions functions <italic>f</italic>
<sub>1</sub> and <italic>f</italic>
<sub>2</sub> in the modified model. Then, the corresponding equilibrium distribution functions become,<disp-formula id="e14">
<mml:math id="m28">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mtable class="matrix">
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2212;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2212;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2212;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2b;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mtable class="matrix">
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>u</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2212;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2212;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>u</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(14)</label>
</disp-formula>
</p>
<p>For the flow field at rest (<italic>u</italic> &#x3d; 0), the distributions functions are therefore,<disp-formula id="e15">
<mml:math id="m29">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>6</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>6</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mi>T</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
<label>(15)</label>
</disp-formula>
</p>
<p>To next modification step aims to remove the &#x201c;constant&#x201d; factors 1/3 and 1/6, by introduction a re-scaled distribution function <inline-formula id="inf15">
<mml:math id="m30">
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
</mml:math>
</inline-formula> defined as the deviation away from the &#x201c;rest&#x201d; state defined in <xref ref-type="disp-formula" rid="e15">Eq. 15</xref> as,<disp-formula id="e16">
<mml:math id="m31">
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mtable class="matrix">
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>6</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>6</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
<mml:mtext>&#x2009;;&#x2009;</mml:mtext>
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2212;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mtable class="matrix">
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>6</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>6</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mtable class="matrix">
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2b;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2b;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(16)</label>
</disp-formula>
</p>
<p>Alternatively, <inline-formula id="inf16">
<mml:math id="m32">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula> can be written as,<disp-formula id="e17">
<mml:math id="m33">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mtable class="matrix">
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="center">
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mo>&#x2b;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(17)</label>
</disp-formula>
</p>
<p>For this re-scaled D1Q3 model, the density and velocity are now defined as,<disp-formula id="e18">
<mml:math id="m34">
<mml:mi>&#x3c1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>&#x2b;</mml:mo>
<mml:munderover accentunder="false" accent="false">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:munderover>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mtext>&#x2009;&#x2009;;&#x2009;&#x2009;&#x2009;</mml:mtext>
<mml:mi>u</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:math>
<label>(18)</label>
</disp-formula>
</p>
<sec id="s7-1">
<title>7.1 Biased quantum floating point representation</title>
<p>In the current implementation of the D1Q3 model, the idea is to represent the (scaled) distribution function values <italic>g</italic>
<sub>
<italic>i</italic>
</sub>, <italic>i</italic> &#x2208; [0, 3] and <italic>u</italic>/<italic>c</italic>) with a specialized (biased) quantum floating-point format. The motivation for choosing this format is the wider range of numbers that can be represented than in a fixed-point representation for the same number of qubits used. To minimize quantum-circuit width, a reduced number of mantissa and exponent bits is used as compared to IEEE-754 single-precision format. However, for the considered problems a scaling was used so that the ranges of numbers to be represented is both limited and predictable. For the D1Q3 model, where the numbers will be &#x226a; 1, this choice of parameters is further detailed later this section.</p>
<p>The quantum floating-point representation used here builds on earlier work by <xref ref-type="bibr" rid="B15">Steijl (2022)</xref> and involves reduced-bit representations of exponent and mantissa relative to single-precision in the IEEE-754 standard to facilitate quantum circuit implementations on current and near-future quantum hardware with relatively small number of qubits <inline-formula id="inf17">
<mml:math id="m35">
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mo>&#x3c;</mml:mo>
<mml:mn>100</mml:mn>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula>. A key feature of the used quantum floating-point representation is that following the IEEE-754 standard, it employs sub-normal numbers and consistent rounding (here, rounding-down to nearest). The number of mantissa qubits is defined by <italic>N</italic>
<sub>
<italic>M</italic>
</sub>, where only <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x2212; 1 mantissa qubits are stored following the &#x201c;hidden-qubit&#x201d; approach from IEEE-754. Then, the number of qubits storing the exponent is defined by <italic>N</italic>
<sub>
<italic>E</italic>
</sub>. In the present work, <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3, and exponent 0 (exponent qubits in state <inline-formula id="inf18">
<mml:math id="m36">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>) represent sub-normal numbers and zero as in the IEEE-754 standard. The maximum value for exponent is 7 (exponent qubits in state <inline-formula id="inf19">
<mml:math id="m37">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>) refers to &#x201c;overflow&#x201d; conditions, as used in the IEEE-754 standard. For <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3, an &#x201c;unbiased&#x201d; exponent formulation would be equivalent to an exponent bias of 3. To optimize for the small numbers occurring in considered problems, a bias toward smaller numbers is used here. Clearly, the choice of <italic>N</italic>
<sub>
<italic>M</italic>
</sub> is crucial in achieving the required accuracy. For equilibrium distribution functions, terms linear and quadratic in <italic>u</italic>/<italic>c</italic> are combined, and <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 3 was found to lead to excessive rounding or truncation for most values of <italic>u</italic>/<italic>c</italic>. Clearly, <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x2265; 4 should be used. However, since the lattice-based models considered here represent conservation of mass, momentum and energy in the fluid, rounding of numbers will have a significant effect on accuracy, particularly in multiple time-step simulations. Therefore, realistically it can be expected that <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x2208; (<xref ref-type="bibr" rid="B18">Fillion-Gourdeau and Lorin, 2019</xref>; <xref ref-type="bibr" rid="B8">Bonny and Haq, 2020</xref>) is needed for realistic engineering applications. In this work, circuits for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 are shown as illustration, and the complexity analysis shown in <xref ref-type="sec" rid="s10">Section 10</xref> addresses in detail how the circuit width increases with <italic>N</italic>
<sub>
<italic>M</italic>
</sub>.</p>
<p>Following IEEE-754, signed floating-point numbers are stored as &#x201c;<inline-formula id="inf20">
<mml:math id="m38">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>sign</mml:mi>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mtext>exponent</mml:mtext>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mtext>mantissa</mml:mtext>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>,&#x201d; while the sign qubit is omitted where unsigned numbers are used in the quantum-circuit implementation. For &#x201c;signed&#x201d; additions or subtractions of two numbers, two (<italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x2b; 1)-qubit registers as input to a modulo adder are created as follows. First, the hidden qubits are added to the mantissa, followed by re-normalization (to account for possible difference in exponent) to create two (<italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x2b; 1)-qubit inputs with <inline-formula id="inf21">
<mml:math id="m39">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> as most-significant qubit. Where required a conversion to 2&#x2019;s complement is performed, so that negative numbers have the most-significant qubit in state <inline-formula id="inf22">
<mml:math id="m40">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. After addition/subtraction, the outcome is converted back to the quantum floating-point format, where a sign-qubit defines the sign and with mantissa no longer in 2&#x2019;s complement, i.e., back into (<italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x2212; 1)-qubit &#x201c;hidden-qubit&#x201d; representation.</p>
<p>For <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3, the sub-normal numbers with the corresponding &#x201c;negative&#x201d; (<italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x2b; 1)-qubit mantissa representation using 2&#x2019;s complement method are shown in <xref ref-type="table" rid="T1">Table 1</xref> for &#x201c;bias &#x3d; 3&#x201d; and &#x201c;bias &#x3d; 8.&#x201d; Here, &#x201c;bias &#x3d; 3&#x201d; corresponds to the &#x201c;standard&#x201d; floating-point format with a symmetric bias. As can be seen from <xref ref-type="table" rid="T1">Table 1</xref>, with symmetric bias (&#x201c;bias &#x3d; 3&#x201d;), terms involving <italic>u</italic>
<sup>2</sup> (<italic>O</italic>(10<sup>&#x2013;2</sup>) will always be sub-normal and often truncated to 0. For &#x201c;bias &#x3d; 8,&#x201d; it can expected that <italic>u</italic>
<sup>2</sup> can be represented either as non-zero sub-normal or normalized numbers.</p>
<table-wrap id="T1" position="float">
<label>TABLE 1</label>
<caption>
<p>Sub-normal numbers for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3. Leading qubit acts as &#x201c;sign&#x201d; qubit. In 2&#x2019;s complement &#x201c;hidden qubit&#x201d; is represented.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th colspan="5" align="left">Bias &#x3d; 3</th>
</tr>
<tr>
<th colspan="2" align="left">Positive</th>
<th colspan="2" align="left">Negative</th>
<th align="left">Mantissa 2&#x2019;s complement</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">
<inline-formula id="inf23">
<mml:math id="m41">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">0</td>
<td align="left">
<inline-formula id="inf24">
<mml:math id="m42">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">0</td>
<td align="left">
<inline-formula id="inf25">
<mml:math id="m43">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf26">
<mml:math id="m44">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">1/32</td>
<td align="left">
<inline-formula id="inf27">
<mml:math id="m45">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;1/32</td>
<td align="left">
<inline-formula id="inf28">
<mml:math id="m46">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf29">
<mml:math id="m47">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>010</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">2/32</td>
<td align="left">
<inline-formula id="inf30">
<mml:math id="m48">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>010</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;2/32</td>
<td align="left">
<inline-formula id="inf31">
<mml:math id="m49">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf32">
<mml:math id="m50">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">3/32</td>
<td align="left">
<inline-formula id="inf33">
<mml:math id="m51">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;3/32</td>
<td align="left">
<inline-formula id="inf34">
<mml:math id="m52">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf35">
<mml:math id="m53">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">4/32</td>
<td align="left">
<inline-formula id="inf36">
<mml:math id="m54">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;4/32</td>
<td align="left">
<inline-formula id="inf37">
<mml:math id="m55">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf38">
<mml:math id="m56">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">5/32</td>
<td align="left">
<inline-formula id="inf39">
<mml:math id="m57">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;5/32</td>
<td align="left">
<inline-formula id="inf40">
<mml:math id="m58">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf41">
<mml:math id="m59">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">6/32</td>
<td align="left">
<inline-formula id="inf42">
<mml:math id="m60">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;6/32</td>
<td align="left">
<inline-formula id="inf43">
<mml:math id="m61">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11010</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf44">
<mml:math id="m62">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">7/32</td>
<td align="left">
<inline-formula id="inf45">
<mml:math id="m63">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;7/32</td>
<td align="left">
<inline-formula id="inf46">
<mml:math id="m64">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td colspan="5" align="left">Bias &#x3d; 8</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf47">
<mml:math id="m65">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">0</td>
<td align="left">
<inline-formula id="inf48">
<mml:math id="m66">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">0</td>
<td align="left">
<inline-formula id="inf49">
<mml:math id="m67">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf50">
<mml:math id="m68">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">1/1,024</td>
<td align="left">
<inline-formula id="inf51">
<mml:math id="m69">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;1/1,024</td>
<td align="left">
<inline-formula id="inf52">
<mml:math id="m70">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf53">
<mml:math id="m71">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>010</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">2/1,024</td>
<td align="left">
<inline-formula id="inf54">
<mml:math id="m72">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>010</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;2/1,024</td>
<td align="left">
<inline-formula id="inf55">
<mml:math id="m73">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf56">
<mml:math id="m74">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">3/1,024</td>
<td align="left">
<inline-formula id="inf57">
<mml:math id="m75">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;3/1,024</td>
<td align="left">
<inline-formula id="inf58">
<mml:math id="m76">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf59">
<mml:math id="m77">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">4/1,024</td>
<td align="left">
<inline-formula id="inf60">
<mml:math id="m78">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;4/1,024</td>
<td align="left">
<inline-formula id="inf61">
<mml:math id="m79">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf62">
<mml:math id="m80">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">5/1,024</td>
<td align="left">
<inline-formula id="inf63">
<mml:math id="m81">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;5/1,024</td>
<td align="left">
<inline-formula id="inf64">
<mml:math id="m82">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf65">
<mml:math id="m83">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">6/1,024</td>
<td align="left">
<inline-formula id="inf66">
<mml:math id="m84">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;6/1,024</td>
<td align="left">
<inline-formula id="inf67">
<mml:math id="m85">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11010</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf68">
<mml:math id="m86">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">7/1,024</td>
<td align="left">
<inline-formula id="inf69">
<mml:math id="m87">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;7/1,024</td>
<td align="left">
<inline-formula id="inf70">
<mml:math id="m88">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>For <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3, the normalized numbers for <inline-formula id="inf71">
<mml:math id="m89">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> with the corresponding &#x201c;negative&#x201d; using 2&#x2019;s complement method are shown in <xref ref-type="table" rid="T2">Table 2</xref> for &#x201c;bias &#x3d; 3&#x201d; and &#x201c;bias &#x3d; 8.&#x201d;</p>
<table-wrap id="T2" position="float">
<label>TABLE 2</label>
<caption>
<p>Example normalized numbers for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3. Leading qubit acts as &#x201c;sign&#x201d; qubit. In 2&#x2019;s complement &#x201c;hidden qubit&#x201d; is represented.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th colspan="5" align="left">Bias &#x3d; 3</th>
</tr>
<tr>
<th colspan="2" align="left">Positive</th>
<th colspan="2" align="left">Negative</th>
<th align="left">Mantissa 2&#x2019;s complement</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">
<inline-formula id="inf72">
<mml:math id="m90">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">8</td>
<td align="left">
<inline-formula id="inf73">
<mml:math id="m91">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;8</td>
<td align="left">
<inline-formula id="inf74">
<mml:math id="m92">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf75">
<mml:math id="m93">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">9</td>
<td align="left">
<inline-formula id="inf76">
<mml:math id="m94">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;9</td>
<td align="left">
<inline-formula id="inf77">
<mml:math id="m95">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf78">
<mml:math id="m96">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>010</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">10</td>
<td align="left">
<inline-formula id="inf79">
<mml:math id="m97">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>010</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;10</td>
<td align="left">
<inline-formula id="inf80">
<mml:math id="m98">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf81">
<mml:math id="m99">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">11</td>
<td align="left">
<inline-formula id="inf82">
<mml:math id="m100">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;11</td>
<td align="left">
<inline-formula id="inf83">
<mml:math id="m101">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf84">
<mml:math id="m102">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">12</td>
<td align="left">
<inline-formula id="inf85">
<mml:math id="m103">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;12</td>
<td align="left">
<inline-formula id="inf86">
<mml:math id="m104">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf87">
<mml:math id="m105">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">13</td>
<td align="left">
<inline-formula id="inf88">
<mml:math id="m106">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;13</td>
<td align="left">
<inline-formula id="inf89">
<mml:math id="m107">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf90">
<mml:math id="m108">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">14</td>
<td align="left">
<inline-formula id="inf91">
<mml:math id="m109">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;14</td>
<td align="left">
<inline-formula id="inf92">
<mml:math id="m110">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10010</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf93">
<mml:math id="m111">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">15</td>
<td align="left">
<inline-formula id="inf94">
<mml:math id="m112">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;15</td>
<td align="left">
<inline-formula id="inf95">
<mml:math id="m113">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td colspan="5" align="left">Bias &#x3d; 8</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf96">
<mml:math id="m114">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">8/32</td>
<td align="left">
<inline-formula id="inf97">
<mml:math id="m115">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;8/32</td>
<td align="left">
<inline-formula id="inf98">
<mml:math id="m116">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf99">
<mml:math id="m117">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">9/32</td>
<td align="left">
<inline-formula id="inf100">
<mml:math id="m118">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;9/32</td>
<td align="left">
<inline-formula id="inf101">
<mml:math id="m119">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf102">
<mml:math id="m120">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>010</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">10/32</td>
<td align="left">
<inline-formula id="inf103">
<mml:math id="m121">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>010</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;10/32</td>
<td align="left">
<inline-formula id="inf104">
<mml:math id="m122">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf105">
<mml:math id="m123">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">11/32</td>
<td align="left">
<inline-formula id="inf106">
<mml:math id="m124">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;11/32</td>
<td align="left">
<inline-formula id="inf107">
<mml:math id="m125">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf108">
<mml:math id="m126">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">12/32</td>
<td align="left">
<inline-formula id="inf109">
<mml:math id="m127">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;12/32</td>
<td align="left">
<inline-formula id="inf110">
<mml:math id="m128">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf111">
<mml:math id="m129">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">13/32</td>
<td align="left">
<inline-formula id="inf112">
<mml:math id="m130">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;13/32</td>
<td align="left">
<inline-formula id="inf113">
<mml:math id="m131">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf114">
<mml:math id="m132">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">14/32</td>
<td align="left">
<inline-formula id="inf115">
<mml:math id="m133">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;14/32</td>
<td align="left">
<inline-formula id="inf116">
<mml:math id="m134">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10010</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#xa0;<inline-formula id="inf117">
<mml:math id="m135">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">15/32</td>
<td align="left">
<inline-formula id="inf118">
<mml:math id="m136">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;15/32</td>
<td align="left">
<inline-formula id="inf119">
<mml:math id="m137">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>For the maximum exponent <inline-formula id="inf120">
<mml:math id="m138">
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula>, the values for &#x201c;bias &#x3d; 8&#x201d; shown in <xref ref-type="table" rid="T2">Table 2</xref> indicate that despite the greatly reduced value of the maximum number that can be represented relative to the symmetric bias case (&#x201c;bias &#x3d; 3&#x201d;), the components of distribution function <inline-formula id="inf121">
<mml:math id="m139">
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
</mml:math>
</inline-formula> and velocity <italic>u</italic>/<italic>c</italic> will be so small that these can still be represented without risking an overflow, as discussed next.</p>
<p>The choice of suitable values for <italic>N</italic>
<sub>
<italic>E</italic>
</sub> and exponent bias for the scaled and normalized D1Q3 model can be made based on the flow physics that is modelled. For the D1Q3 model, the lattice speed of sound is defined as <inline-formula id="inf122">
<mml:math id="m140">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>c</mml:mi>
<mml:mo>/</mml:mo>
<mml:msqrt>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msqrt>
</mml:math>
</inline-formula>. The iso-thermal model used here was derived for flows with weak or negligible compressibility effects. For a compressible fluid, a local Mach number can be defined as: <inline-formula id="inf123">
<mml:math id="m141">
<mml:mi>M</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>u</mml:mi>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mo>/</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msqrt>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msqrt>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>u</mml:mi>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mo>/</mml:mo>
<mml:mi>c</mml:mi>
</mml:math>
</inline-formula>. For the weakly compressible-flow conditions it is required that <italic>M</italic> &#x3c; 0.3 or smaller. Therefore, <italic>u</italic>/<italic>c</italic> should generally be limited to maximum values of 0.1&#x2013;0.15. Clearly, in the modified and re-scaled D1Q3 model employing a symmetric bias will introduce a range of numbers far from optimal for the D1Q3 model. As shown in <xref ref-type="table" rid="T2">Table 2</xref>, for <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3, a bias of 8 gives ample margin at the upper end of the floating-point range when representing <italic>u</italic>/<italic>c</italic>. However, since the (scaled) and re-normalized equilibrium distribution functions combine terms <italic>O</italic>(<italic>u</italic>) and <italic>O</italic>(<italic>u</italic>
<sup>2</sup>) it was decided that a bias of 9 could potentially leave too little margin in the floating-point representation of <italic>g</italic>
<sub>
<italic>i</italic>
</sub> components.</p>
</sec>
<sec id="s7-2">
<title>7.2 Quantum circuit implementation&#x2014;Streaming operation</title>
<p>In Lattice Boltzmann models, the non-linear convection term of the Navier-Stokes equation is effectively (partly) replaced by a linear streaming of the distribution functions from one lattice point to a neighboring lattice point during a time step. For the modified D1Q3 model, only two directions specified by <inline-formula id="inf124">
<mml:math id="m142">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (&#x201c;&#x2212;1&#x201d;) and <inline-formula id="inf125">
<mml:math id="m143">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (&#x201c;&#x2b;1&#x201d;) need to be considered since the remaining two are &#x201c;at rest.&#x201d; Assuming a uniformly-spaced one-dimensional domain with 64 lattice points and periodic boundary conditions, a possible quantum-circuit implementation for the streaming operations is illustrated in <xref ref-type="fig" rid="F3">Figure 3</xref>. This type of linear operators was previously detailed by <xref ref-type="bibr" rid="B50">Todorova and Steijl (2020)</xref> and will therefore not be analyzed further here.</p>
<fig id="F3" position="float">
<label>FIGURE 3</label>
<caption>
<p>Quantum circuit implementing the &#x201c;streaming&#x201d; operation for directions 0 <inline-formula id="inf126">
<mml:math id="m144">
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> and 3 <inline-formula id="inf127">
<mml:math id="m145">
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> on uniformly-space 1D mesh (64 cells encoded with 6 qubits) with periodic boundary conditions. Design assumed amplitude-based encoding of data. Most-significant qubit as used in data ordering is at the top of circuits.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g003.tif"/>
</fig>
</sec>
</sec>
<sec id="s8">
<title>8 Quantum circuit implementation&#x2014;Equilibrium distribution function</title>
<sec id="s8-1">
<title>8.1 Mapping of computational problem on qubit register</title>
<p>The quantum-circuit was designed with input data encoded in qubits at the top of the circuit (most significant qubits), followed by qubits representing the output of the computation performed. The remaining qubits further &#x201c;down&#x201d; (i.e., less significant in the employed memory indexing) generally act as ancillae qubits or as workspace. These ancillae and workspace qubits are all initialized in state <inline-formula id="inf128">
<mml:math id="m146">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and will be returned to <inline-formula id="inf129">
<mml:math id="m147">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> at the time of completion of the quantum circuit. In later sections, a modified and transformed design will be considered were the ordering is altered to facilitate efficient simulation. For the original circuit, the qubit register for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3 can be summarized as follows:<disp-formula id="equ1">
<mml:math id="m148">
<mml:mtable class="eqnarray-star">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>indices&#x2009;for&#x2009;</mml:mtext>
<mml:mn>4</mml:mn>
<mml:mtext>&#x2009;discrete&#x2009;velocities</mml:mtext>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mn>3</mml:mn>
<mml:mo>-</mml:mo>
<mml:mtext>bit&#x2009;representation&#x2009;of&#x2009;exponent&#x2009;of&#x2009;</mml:mtext>
<mml:mi>u</mml:mi>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>u</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>sign&#x2009;bit&#x2009;of&#x2009;input&#x2009;velocity&#x2009;</mml:mtext>
<mml:mi>u</mml:mi>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mn>3</mml:mn>
<mml:mo>-</mml:mo>
<mml:mtext>bit&#x2009;representation&#x2009;of&#x2009;mantissa&#x2009;of&#x2009;</mml:mtext>
<mml:mi>u</mml:mi>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mn>3</mml:mn>
<mml:mo>-</mml:mo>
<mml:mtext>bit&#x2009;representation&#x2009;of&#x2009;exponent&#x2009;of&#x2009;</mml:mtext>
<mml:msup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>g</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>sign&#x2009;bit&#x2009;of&#x2009;output&#x2009;</mml:mtext>
<mml:msup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mn>3</mml:mn>
<mml:mo>-</mml:mo>
<mml:mtext>bit&#x2009;representation&#x2009;of&#x2009;mantissa&#x2009;of&#x2009;</mml:mtext>
<mml:msup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mn>3</mml:mn>
<mml:mo>-</mml:mo>
<mml:mtext>bit&#x2009;representation&#x2009;of&#x2009;exponent&#x2009;of&#x2009;</mml:mtext>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mn>3</mml:mn>
<mml:mo>-</mml:mo>
<mml:mtext>bit&#x2009;representation&#x2009;of&#x2009;mantissa&#x2009;of&#x2009;</mml:mtext>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>c</mml:mi>
<mml:mi>u</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>state&#x2009;</mml:mtext>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mtext>&#x2009;defines&#x2009;that&#x2009;</mml:mtext>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mtext>is&#x2009;truncated&#x2009;to&#x2009;0</mml:mtext>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>r</mml:mi>
<mml:mn>4</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>r</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>r</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>r</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>workspace&#x2009;qubits&#x2009;ordered&#x2009;for&#x2009;</mml:mtext>
<mml:mn>4</mml:mn>
<mml:mo>-</mml:mo>
<mml:mtext>qubit&#x2009;addition</mml:mtext>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>workspace&#x2009;qubit&#x2009;named&#x2009;to&#x2009;represent&#x2009;&#x2019;carry&#x2019;&#x2009;bit&#x2009;in&#x2009;</mml:mtext>
<mml:mn>4</mml:mn>
<mml:mo>-</mml:mo>
<mml:mtext>qubit&#x2009;addition</mml:mtext>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>r</mml:mi>
<mml:mn>7</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>r</mml:mi>
<mml:mn>6</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>r</mml:mi>
<mml:mn>5</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>workspace&#x2009;qubits&#x2009;ordered&#x2009;for&#x2009;</mml:mtext>
<mml:mn>4</mml:mn>
<mml:mo>-</mml:mo>
<mml:mtext>qubit&#x2009;squaring</mml:mtext>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mi>n</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>workspace&#x2009;qubit&#x2009;</mml:mtext>
<mml:mo>-</mml:mo>
<mml:mtext>&#x2009;mostly&#x2009;used&#x2009;as&#x2009;control&#x2009;qubit</mml:mtext>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
</disp-formula>
</p>
<p>This shows that 37 qubits are required in this original design. Data related to <italic>g</italic>
<sub>0</sub> and <italic>g</italic>
<sub>3</sub> are stored in the vector for <inline-formula id="inf130">
<mml:math id="m149">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and <inline-formula id="inf131">
<mml:math id="m150">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. Similarly, states with <inline-formula id="inf132">
<mml:math id="m151">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>01</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and <inline-formula id="inf133">
<mml:math id="m152">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> represent data for the (identical) distribution functions <italic>g</italic>
<sub>1</sub> and <italic>g</italic>
<sub>2</sub>. For the floating-point representations of input <italic>u</italic> and each component of output <inline-formula id="inf134">
<mml:math id="m153">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula>, 7 qubits are needed using the hidden-qubit approach. For the temporary storage of <italic>u</italic>
<sup>2</sup>, the sign bit can be omitted. In the following, for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3 an exponent &#x201c;bias &#x3d; 8&#x201d; is used in the floating-point representations.</p>
</sec>
<sec id="s8-2">
<title>8.2 Overview of quantum circuit design</title>
<p>
<xref ref-type="fig" rid="F4">Figure 4</xref> shows the first part of the quantum circuit designed to compute the equilibrium distribution function <inline-formula id="inf135">
<mml:math id="m154">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula> for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3. The first step involves setting <inline-formula id="inf136">
<mml:math id="m155">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mi>c</mml:mi>
<mml:mi>u</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> for the cases with a guaranteed truncation of <italic>u</italic>
<sup>2</sup>&#x2014;for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3 this truncation always occurs for <inline-formula id="inf137">
<mml:math id="m156">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, <inline-formula id="inf138">
<mml:math id="m157">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and <inline-formula id="inf139">
<mml:math id="m158">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>010</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. In the next step, the mantissa of <italic>u</italic> is set into the required positions in the workspace, defined by <inline-formula id="inf140">
<mml:math id="m159">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, for all cases without truncation of <italic>u</italic>
<sup>2</sup> to 0. The operation <italic>SQ</italic>4 then computes the square of the mantissa and stores the results in <inline-formula id="inf141">
<mml:math id="m160">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>r</mml:mi>
<mml:mn>7</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>r</mml:mi>
<mml:mn>6</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>r</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. Operation <italic>CC</italic>
<sub>
<italic>u</italic>2</sub> then creates a (temporary) &#x201c;copy&#x201d; of the <italic>u</italic>
<sup>2</sup> defined in the quantum-floating format in the qubits <inline-formula id="inf142">
<mml:math id="m161">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (defining exponent) and <inline-formula id="inf143">
<mml:math id="m162">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (defining mantissa using hidden-qubit approach). For <italic>u</italic>
<sup>2</sup> no sign qubit is needed. To clear the workspace for further use, operation <italic>ISQ</italic>4 un-computes the mantissa squaring, followed by the removal of the copy of the mantissa of <italic>u</italic> from qubits <inline-formula id="inf144">
<mml:math id="m163">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>.</p>
<fig id="F4" position="float">
<label>FIGURE 4</label>
<caption>
<p>Quantum circuit design for evaluation of <inline-formula id="inf145">
<mml:math id="m164">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula> in modified D1Q3 model. Velocity <italic>u</italic> and distribution functions defined as quantum floating-point numbers with <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3. Most-significant qubits at top of circuit. Part 1.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g004.tif"/>
</fig>
<p>The quantum-circuit implementation for <italic>SQ</italic>4 and <italic>ISQ</italic>4 are shown in <xref ref-type="fig" rid="F5">Figures 5</xref>, <xref ref-type="fig" rid="F6">6</xref>, respectively. Here, <italic>FAdd</italic> represents a 4-qubit Cuccaro full adder, and <italic>Rmv</italic> the un-computation of this adder. The required shift in the used shift-and-add approach are performed by <italic>Sh</italic> (in <italic>SQ</italic>4) and <italic>Sh</italic>&#x2019; (shift in reversed direction in <italic>ISQ</italic>4). Following the definition of <italic>u</italic>
<sup>2</sup> in quantum floating-point format, the equilibrium distribution for directions <italic>e</italic>
<sub>1</sub> and <italic>e</italic>
<sub>2</sub> (defined by <inline-formula id="inf146">
<mml:math id="m165">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>01</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and <inline-formula id="inf147">
<mml:math id="m166">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>) is defined using the operator 0110 in <xref ref-type="fig" rid="F4">Figure 4</xref>.</p>
<fig id="F5" position="float">
<label>FIGURE 5</label>
<caption>
<p>Quantum circuit defining <italic>SQ</italic>4 with 4-qubit mantissa qubits (<italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4, using hidden qubit approach) and a 3-qubit exponent (<italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3).</p>
</caption>
<graphic xlink:href="fmech-08-925637-g005.tif"/>
</fig>
<fig id="F6" position="float">
<label>FIGURE 6</label>
<caption>
<p>Quantum circuit defining <italic>ISQ</italic>4 with 4-qubit mantissa qubits (<italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4, using hidden qubit approach) and a 3-qubit exponent (<italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3).</p>
</caption>
<graphic xlink:href="fmech-08-925637-g006.tif"/>
</fig>
<p>To define the equilibrium distribution functions for directions <italic>e</italic>
<sub>0</sub> and <italic>e</italic>
<sub>3</sub> (defined by <inline-formula id="inf148">
<mml:math id="m167">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and <inline-formula id="inf149">
<mml:math id="m168">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>), the addition of &#xb1; <italic>u</italic> and <italic>u</italic>
<sup>2</sup> is required. This addition operator for the signed values defined in the <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3 format is performed using a modulo-5 Cuccaro adder, denoted by <italic>MA</italic>5. Operation 0011<italic>a</italic> initializes this addition step, followed by the operation 0011<italic>b</italic> that uses the created result to define the equilibrium distribution functions for directions <italic>e</italic>
<sub>0</sub> and <italic>e</italic>
<sub>3</sub> in qubits <inline-formula id="inf150">
<mml:math id="m169">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (exponent), <inline-formula id="inf151">
<mml:math id="m170">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>g</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (sign qubit) and <inline-formula id="inf152">
<mml:math id="m171">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (mantissa qubits using hidden-qubit approach).</p>
<p>
<xref ref-type="fig" rid="F7">Figure 7</xref> shows the second part of the quantum circuit designed to compute the equilibrium distribution function <inline-formula id="inf153">
<mml:math id="m172">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula> for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3. The first step involves the un-computation of the modulo-5 addition (denoted by <italic>UMA</italic>5), followed by operation 0011<italic>c</italic> used to clear the inputs to this addition. Upon completion of operation 0011<italic>c</italic>, the 14 workspace qubits are all in state <inline-formula id="inf154">
<mml:math id="m173">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. However, at this stage, the temporary copy of <italic>u</italic>
<sup>2</sup> still resides in qubits <inline-formula id="inf155">
<mml:math id="m174">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and <inline-formula id="inf156">
<mml:math id="m175">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. To clear these qubits to state <inline-formula id="inf157">
<mml:math id="m176">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, the square of the mantissa of <italic>u</italic>
<sup>2</sup> needs to be re-computed using <italic>SQ</italic>4. Then, <italic>CC</italic>
<sub>
<italic>u</italic>2</sub> is used to set the 6 qubits defining <italic>u</italic>
<sup>2</sup> in quantum floating point format to <inline-formula id="inf158">
<mml:math id="m177">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. Then, <italic>ISQ</italic>4 un-computes the mantissa squaring step. Finally the remaining workspace qubits can be cleared along with the qubit <inline-formula id="inf159">
<mml:math id="m178">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>c</mml:mi>
<mml:mi>u</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, which for cases with truncation of <italic>u</italic>
<sup>2</sup> to 0 is re-set to <inline-formula id="inf160">
<mml:math id="m179">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>.</p>
<fig id="F7" position="float">
<label>FIGURE 7</label>
<caption>
<p>Quantum circuit design for evaluation of <inline-formula id="inf161">
<mml:math id="m180">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula> in modified D1Q3 model. Velocity <italic>u</italic> and distribution functions defined as quantum floating-point numbers with <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3. Most-significant qubits at top of circuit. Part 2.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g007.tif"/>
</fig>
<p>At this stage, the output of the quantum circuit has the required format: the qubits <inline-formula id="inf162">
<mml:math id="m181">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (exponent), <inline-formula id="inf163">
<mml:math id="m182">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>g</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (sign qubit) and <inline-formula id="inf164">
<mml:math id="m183">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> define the equilibrium distribution function for all four directions in the modified D1Q3 model, while the rest of the qubits is left unchanged.</p>
<p>In operator 0110, the previously computed term <italic>u</italic>
<sup>2</sup> is used to set &#x2212;<italic>u</italic>
<sup>2</sup>/2 for the two &#x201c;rest&#x201d; directions (<inline-formula id="inf165">
<mml:math id="m184">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>01</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and <inline-formula id="inf166">
<mml:math id="m185">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>). For these directions the &#x201c;&#x2212;&#x201d; sign can be trivially introduced by setting the sign qubit of <inline-formula id="inf167">
<mml:math id="m186">
<mml:msup>
<mml:mrow>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula>, <inline-formula id="inf168">
<mml:math id="m187">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>g</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. For the direction 0 defined by <inline-formula id="inf169">
<mml:math id="m188">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, the equilibrium distribution function is of the form &#x2212;<italic>u</italic>/2 &#x2b; <italic>u</italic>
<sup>2</sup>/2. For this direction (and for direction 3 with distribution function of the form <italic>u</italic>/2 &#x2b; <italic>u</italic>
<sup>2</sup>/2), first the terms &#x2212;<italic>u</italic> &#x2b; <italic>u</italic>
<sup>2</sup> and &#x2b;<italic>u</italic> &#x2b; <italic>u</italic>
<sup>2</sup> are computed using a 5-qubit modulo adder <italic>MA</italic>5 (and its reverse <italic>UMA</italic>5), while the division by 2 is introduced when setting the result in quantum-floating point format. The sign change to &#x2032; &#x2212; <italic>u</italic>&#x2032; for direction 0 is created by switching to 2&#x2019;s complement notation or the 4 mantissa qubits. Based on the assumption of positive input velocity <italic>u</italic>, the 5 input qubits (as &#x201c;a&#x201d; input to Cuccaro modulo adder) representing mantissa of <italic>u</italic> are initially set as <inline-formula id="inf170">
<mml:math id="m189">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (with <inline-formula id="inf171">
<mml:math id="m190">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> for sub-normal numbers). The quantum-circuit implementation of operator <italic>SgnA</italic>5 performing this sign change is shown in <xref ref-type="fig" rid="F8">Figure 8</xref>. With <italic>u</italic> &#x226a; 1 in the D1Q3 model, the term &#x2212;<italic>u</italic> &#x2b; <italic>u</italic>
<sup>2</sup> will always be a negative number. Since the 4 mantissa qubits of <inline-formula id="inf172">
<mml:math id="m191">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula> are not stored in 2&#x2019;s complement formulation for negative values (i.e., the sign is defined by <inline-formula id="inf173">
<mml:math id="m192">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>g</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>), a similar sign change to <italic>SgnA</italic>5 needs to be applied on the output of the 5-qubit modulo adder. With the guaranteed negative result for direction 0, it is sufficient to perform the 2&#x2019;s complement conversion on only to the 4 qubits (for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 considered here) used to define mantissa qubits of <inline-formula id="inf174">
<mml:math id="m193">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula>. The operator <italic>SgnB</italic>4 performs this change. Its quantum-circuit implementation is also shown in <xref ref-type="fig" rid="F8">Figure 8</xref>.</p>
<fig id="F8" position="float">
<label>FIGURE 8</label>
<caption>
<p>Quantum circuit-implementations of <italic>SgnA</italic>5 and <italic>SgnB</italic>4 used to introduced sign change in 5-qubit modulo addition.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g008.tif"/>
</fig>
</sec>
</sec>
<sec id="s9">
<title>9 Reduction for FPGA acceleration of QC simulation</title>
<p>The quantum-circuit implementation for the computation of the equilibrium distribution functions of the modified D1Q3 model shown in <xref ref-type="fig" rid="F4">Figures 4</xref>, <xref ref-type="fig" rid="F7">7</xref> will be transformed in this section to facilitate a more efficient quantum circuit simulation using FPGA acceleration. The &#x201c;original&#x201d; circuit designed for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3 uses 37 qubits. As a first step toward &#x201c;reduced&#x201d; circuits, circuit re-ordering and partial specialization of one or more qubits is used.</p>
<p>The key ideas behind the considered reduction/transformation are as follows:<list list-type="simple">
<list-item>
<p>&#x2022; The circuit evaluates the distribution functions for 4 directions based on a single input <italic>u</italic> defined in quantum floating-point format&#x2014;therefore specialized circuits can be created based on the selected input for <italic>u</italic>;</p>
</list-item>
<list-item>
<p>&#x2022; The specialized input is defined using 7 qubits: <inline-formula id="inf175">
<mml:math id="m194">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>u</mml:mi>
<mml:mi>e</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (exponent), <inline-formula id="inf176">
<mml:math id="m195">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>u</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (sign) and <inline-formula id="inf177">
<mml:math id="m196">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (defines mantissa using hidden-qubit appraoch)&#x2014;so reduced circuits with 7 fewer can be created for particular values of <italic>u</italic>;</p>
</list-item>
<list-item>
<p>&#x2022; The two most significant qubits in the design shown in <xref ref-type="fig" rid="F4">Figures 4</xref>, <xref ref-type="fig" rid="F7">7</xref>, i.e., <inline-formula id="inf178">
<mml:math id="m197">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> define the direction vector (<italic>i</italic> &#x2208; [0, 3]). If required, a further reduction or transformation can be performed, so that only the equilibrium distribution function for a single direction is evaluated. This allows a further reduction by 2 qubits relative to the original circuit;</p>
</list-item>
<list-item>
<p>&#x2022; The qubit <inline-formula id="inf179">
<mml:math id="m198">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>c</mml:mi>
<mml:mi>u</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> only depends on the exponent of <italic>u</italic>, so at compile time for specialized circuits this information regarding truncation of <italic>u</italic>
<sup>2</sup> is known. Therefore, also <inline-formula id="inf180">
<mml:math id="m199">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>c</mml:mi>
<mml:mi>u</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> can be eliminated in transformed circuits, specialized for specific <italic>u</italic> input</p>
</list-item>
</list>
</p>
<p>Using the above transformation steps, reduced circuits with 27 qubits can be created for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3, as compared to the original number of 37.</p>
<sec id="s9-1">
<title>9.1 Further reduction</title>
<p>The transformation steps detailed in the previous section enabled a reduction to computational kernels with 27 qubits as compared to the 37-qubit full circuit. For a further reduction, the 14-qubit workspace needs to be transformed. Specifically, the arithmetic operations in <italic>SQ</italic>4, <italic>ISQ</italic>4, <italic>MA</italic>5 and <italic>UMA</italic>5 need to be transformed and specialized for specific inputs. Since the Quantum Computer simulator used here employs a memory allocation with the top qubits in the circuits shown acting as the most significant qubits, the overall circuit design shown in <xref ref-type="fig" rid="F4">Figures 4</xref>, <xref ref-type="fig" rid="F7">7</xref> needs to be changed: the qubits defining workspace need to be moved towards the top of the quantum circuit, and therefore, the qubits storing <italic>u</italic>
<sup>2</sup> and <inline-formula id="inf181">
<mml:math id="m200">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula> in quantum floating-point format need to be moved down toward less significant bit locations.</p>
<p>Following this re-ordering, a further reduction requires specializing (and factoring out) one or more mantissa qubits, starting from the most significant mantissa qubit of <italic>u</italic>, i.e., <inline-formula id="inf182">
<mml:math id="m201">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, followed by <inline-formula id="inf183">
<mml:math id="m202">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, etc. Using this approach, requires transformation to the <italic>u</italic>
<sup>2</sup> computations as well as modulo-additions, as discussed in following sections.</p>
</sec>
<sec id="s9-2">
<title>9.2 Reduction of the <italic>u</italic>
<sup>2</sup> computation</title>
<p>To illustrate the further reduction of the number of qubits, the computation of <italic>u</italic>
<sup>2</sup> is analyzed first. In the interest of clarity, this section will consider the reduced circuits for the evaluation of <inline-formula id="inf184">
<mml:math id="m203">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mspace width="0.3333em"/>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>01</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf185">
<mml:math id="m204">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mspace width="0.3333em"/>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula>, since these identical terms only involve the term <italic>u</italic>
<sup>2</sup>/2. <xref ref-type="fig" rid="F9">Figure 9</xref> shows the reduced quantum circuit with 26 qubit resulting from eliminating the two most-significant mantissa qubits in squaring operations for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3. As can be seen, the circuit only involves the two mantissa qubits <inline-formula id="inf186">
<mml:math id="m205">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, and <italic>SQ</italic>4 and <italic>ISQ</italic>4 represent reduced squaring (and un-computation) for specific choices of <inline-formula id="inf187">
<mml:math id="m206">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. For the further reduction by 2 qubits to 26-qubits, the operations <italic>SQ</italic>4 and <italic>ISQ</italic>4 involve 12 qubits in the workspace. The operation <italic>CC</italic>
<sub>
<italic>u</italic>2</sub> sets the squared-velocity values in terms of quantum-floating point format in <inline-formula id="inf188">
<mml:math id="m207">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (exponent) and <inline-formula id="inf189">
<mml:math id="m208">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (mantissa), and for the considered reduction to 26 qubits, the quantum circuit implementations for <italic>CC</italic>
<sub>
<italic>u</italic>2</sub> are detailed for <inline-formula id="inf190">
<mml:math id="m209">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, <inline-formula id="inf191">
<mml:math id="m210">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> or <inline-formula id="inf192">
<mml:math id="m211">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> in <xref ref-type="fig" rid="F10">Figure 10</xref>. For <inline-formula id="inf193">
<mml:math id="m212">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, the operator is identical to that for <inline-formula id="inf194">
<mml:math id="m213">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, apart from the <italic>NOT</italic> operation on <inline-formula id="inf195">
<mml:math id="m214">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> that for <inline-formula id="inf196">
<mml:math id="m215">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> is performed on <inline-formula id="inf197">
<mml:math id="m216">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>s</mml:mi>
<mml:mi>q</mml:mi>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> instead. <xref ref-type="fig" rid="F11">Figure 11</xref> shows the quantum-circuit definitions of the reduced mantissa-squaring and adders (as well as the reverse circuits), for the 26-qubit reduced quantum-circuit implementation.</p>
<fig id="F9" position="float">
<label>FIGURE 9</label>
<caption>
<p>Reduced circuit with 26 qubits: <inline-formula id="inf198">
<mml:math id="m217">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>01</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> or <inline-formula id="inf199">
<mml:math id="m218">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, <inline-formula id="inf200">
<mml:math id="m219">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, <inline-formula id="inf201">
<mml:math id="m220">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, <inline-formula id="inf202">
<mml:math id="m221">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> or <inline-formula id="inf203">
<mml:math id="m222">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (and therefore <inline-formula id="inf204">
<mml:math id="m223">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>c</mml:mi>
<mml:mi>u</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>).</p>
</caption>
<graphic xlink:href="fmech-08-925637-g009.tif"/>
</fig>
<fig id="F10" position="float">
<label>FIGURE 10</label>
<caption>
<p>
<italic>CC</italic>
<sub>
<italic>u</italic>2</sub> for reduced circuit with 26 qubits. Squared velocity <italic>u</italic>
<sup>2</sup> defined as quantum floating-point numbers with <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3. Label indicates for which <inline-formula id="inf205">
<mml:math id="m224">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> circuit was derived.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g010.tif"/>
</fig>
<fig id="F11" position="float">
<label>FIGURE 11</label>
<caption>
<p>Definition of <italic>SQ</italic>4 and I<italic>SQ</italic>4 for reduced quantum circuit (26 qubit) for |<italic>mu</italic>2)&#x3d; |0)&#x3d; (|<italic>qu</italic>3|<italic>qu</italic>2)&#x3d; |10) for normalized input). <italic>CAdd</italic>
<sup>10</sup> and <italic>CRmv</italic>
<sup>10</sup> are defined as <italic>Add</italic>
<sup>10 </sup>and <italic>Rmv</italic>
<sup>10</sup> with |<italic>anc</italic>) acting as control qubit.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g011.tif"/>
</fig>
<p>
<xref ref-type="fig" rid="F12">Figure 12</xref> shows the reduced quantum circuit with 25 qubit resulting from eliminating the three most-significant mantissa qubits in squaring operations for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3. As can be seen, the circuit only involves the mantissa qubit <inline-formula id="inf206">
<mml:math id="m225">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, and <italic>SQ</italic>4 and <italic>ISQ</italic>4 represent reduced squaring (and un-computation) for specific choices of <inline-formula id="inf207">
<mml:math id="m226">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. For the further reduction by 3 qubits to 25-qubits, the operations <italic>SQ</italic>4 and <italic>ISQ</italic>4 involve 11 qubits in the workspace as can be seen in the quantum-circuit implementations shown in <xref ref-type="fig" rid="F13">Figure 13</xref>. For the reduced quantum circuit with 25 qubits, <xref ref-type="fig" rid="F14">Figure 14</xref> shows the quantum-circuit implementation of the &#x201c;shift&#x201d; operations used in the &#x201c;shift-and-add&#x201d; approach. For <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4, a further reduction to 24 qubis can be made, by reducing out qubit <inline-formula id="inf208">
<mml:math id="m227">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> from the <italic>SQ</italic>4 and <italic>ISQ</italic>4 operations. For this further reduction to 24 qubits, quantum-circuit implementation of operations <italic>SQ</italic>4 and <italic>ISQ</italic>4 are shown in <xref ref-type="fig" rid="F15">Figure 15</xref>. The addition and remove operators are specialized for the 4 mantissa qubits <inline-formula id="inf209">
<mml:math id="m228">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>.</p>
<fig id="F12" position="float">
<label>FIGURE 12</label>
<caption>
<p>Reduced circuit with 25 qubits: <inline-formula id="inf210">
<mml:math id="m229">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>01</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> or <inline-formula id="inf211">
<mml:math id="m230">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, <inline-formula id="inf212">
<mml:math id="m231">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, <inline-formula id="inf213">
<mml:math id="m232">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, <inline-formula id="inf214">
<mml:math id="m233">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> or <inline-formula id="inf215">
<mml:math id="m234">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (and therefore <inline-formula id="inf216">
<mml:math id="m235">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>c</mml:mi>
<mml:mi>u</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>).</p>
</caption>
<graphic xlink:href="fmech-08-925637-g012.tif"/>
</fig>
<fig id="F13" position="float">
<label>FIGURE 13</label>
<caption>
<p>Definition of <italic>SQ</italic>4 and I<italic>SQ</italic>4 for reduced quantum circuit (25 qubit) for |<italic>mu</italic>2|<italic>mu</italic>1&#x232A; &#x3d; |00&#x232A; &#x3d; (|<italic>qu</italic>3|<italic>qu</italic>2|<italic>qu</italic>1&#x232A; &#x3d; |100&#x232A; for normalized input). <italic>CAdd</italic>
<sup>100</sup> and <italic>CRmv</italic>
<sup>100</sup> are defined as <italic>Add</italic>
<sup>100</sup> and <italic>Rmv</italic>
<sup>100</sup> with |anc&#x232A; acting as control qubit.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g013.tif"/>
</fig>
<fig id="F14" position="float">
<label>FIGURE 14</label>
<caption>
<p>Shift operators used for left- and right-shifting of results register in reduced circuit with 25 qubits.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g014.tif"/>
</fig>
<fig id="F15" position="float">
<label>FIGURE 15</label>
<caption>
<p>Definition of <italic>SQ</italic>4 and <italic>ISQ</italic>4 for reduced quantum circuit (24 qubit) for <inline-formula id="inf217">
<mml:math id="m236">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (<inline-formula id="inf218">
<mml:math id="m237">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> for normalized input). Controlled add/remove units not needed for the further reduction by 4 qubits (all mantissa qubits for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4).</p>
</caption>
<graphic xlink:href="fmech-08-925637-g015.tif"/>
</fig>
<p>The operation <italic>CC</italic>
<sub>
<italic>u</italic>2</sub> defines squared-velocity values in terms of quantum-floating point format, and for the considered reduction to 25 qubits, the quantum circuit implementations follows directly from those discussed for the reduction to 26 qubits, since <inline-formula id="inf225">
<mml:math id="m244">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> are not involved in this step. The operation 0110 finally sets the equilibrium distributions functions <inline-formula id="inf226">
<mml:math id="m245">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> (for <inline-formula id="inf227">
<mml:math id="m246">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>01</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>) and <inline-formula id="inf228">
<mml:math id="m247">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> (for <inline-formula id="inf229">
<mml:math id="m248">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>) in quantum floating point format, based on the definition of <italic>u</italic>
<sup>2</sup> in floating-point format defined previously. The quantum circuit implementation of 0110 for the reduced circuits with 25 and 26 qubits (identical in both cases) is shown in <xref ref-type="fig" rid="F16">Figure 16</xref>.</p>
<fig id="F16" position="float">
<label>FIGURE 16</label>
<caption>
<p>Operator 0110 for reduced circuit with 25 or 26 qubits. Squared velocity u<sub>2</sub> defined as quantumfloating-point numbers with <italic>N<sub>M</sub>
</italic> = 4 and <italic>N<sub>E</sub>
</italic> = 3.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g016.tif"/>
</fig>
</sec>
<sec id="s9-3">
<title>9.3 Reduction including the modulo-adder</title>
<p>Following the analysis of the evaluation of the <italic>u</italic>
<sup>2</sup> terms in quantum circuits with partial reduction of the workspace qubits, the focus now moves to the more complex case of also reducing the modulo adder (and its reverse) used in computing the summations <italic>u</italic> &#x2b; <italic>u</italic>
<sup>2</sup> and &#x2212;<italic>u</italic> &#x2b; <italic>u</italic>
<sup>2</sup>. The use of 2&#x2019;s complement method in the current implementation of <inline-formula id="inf230">
<mml:math id="m249">
<mml:msub>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula> evaluation poses particular challenges in the further reduction process, as detailed in this section. In the interest of clarity, this section will consider the reduced circuits for the evaluation of <inline-formula id="inf231">
<mml:math id="m250">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mspace width="0.3333em"/>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf232">
<mml:math id="m251">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mspace width="0.3333em"/>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula>, since these represent the only directions for which the modulo-addition steps is required. <xref ref-type="fig" rid="F17">Figure 17</xref> shows the reduced quantum circuit with 25 qubit resulting from eliminating the three most-significant mantissa qubits in the arithmetic operations for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3. As can be seen, the circuit only involves the mantissa qubit <inline-formula id="inf233">
<mml:math id="m252">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. The operation 0011<italic>a</italic> prepares the modulo-adder step and depends on the mantissa qubits of <italic>u</italic> as well as on the exponent of <italic>u</italic> (represented by <inline-formula id="inf234">
<mml:math id="m253">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>). Similarly 0011<italic>c</italic> un-computes these steps to reset workspace to <inline-formula id="inf235">
<mml:math id="m254">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> after completion of the addition step and setting <inline-formula id="inf236">
<mml:math id="m255">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> and <inline-formula id="inf237">
<mml:math id="m256">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> in quantum floating point format. The (reduced) modulo-5 adder <italic>MA</italic>5 (and its reverse <italic>UMA</italic>5) only depend on the specific choice of mantissa qubits that were reduced, i.e., in this step there is no dependency on exponent <inline-formula id="inf238">
<mml:math id="m257">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. Based on the outcome of modulo-5 adder, the operation 0011<italic>b</italic> sets <inline-formula id="inf239">
<mml:math id="m258">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> and <inline-formula id="inf240">
<mml:math id="m259">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> in <inline-formula id="inf241">
<mml:math id="m260">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (mantissa), <inline-formula id="inf242">
<mml:math id="m261">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>g</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (sign) and <inline-formula id="inf243">
<mml:math id="m262">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>g</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (exponents) for <inline-formula id="inf244">
<mml:math id="m263">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and <inline-formula id="inf245">
<mml:math id="m264">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, respectively.</p>
<fig id="F17" position="float">
<label>FIGURE 17</label>
<caption>
<p>Reduced circuit with 25 qubits: <inline-formula id="inf246">
<mml:math id="m265">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> or <inline-formula id="inf247">
<mml:math id="m266">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, <inline-formula id="inf248">
<mml:math id="m267">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, <inline-formula id="inf249">
<mml:math id="m268">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, <inline-formula id="inf250">
<mml:math id="m269">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> or <inline-formula id="inf251">
<mml:math id="m270">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> (and therefore <inline-formula id="inf252">
<mml:math id="m271">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>c</mml:mi>
<mml:mi>u</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>).</p>
</caption>
<graphic xlink:href="fmech-08-925637-g017.tif"/>
</fig>
<p>Following the process detailed in the previous section, for a further reduction by 2 qubits to 26 qubits would result in a similar quantum circuit, then involving <inline-formula id="inf253">
<mml:math id="m272">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and <inline-formula id="inf254">
<mml:math id="m273">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. For brevity, this quantum circuit is not shown here.</p>
<p>The operation 0011<italic>a</italic> comprises two parts. The first part uses quantum-floating point representation of <italic>u</italic>
<sup>2</sup> to set the &#x201c;b&#x201d; register of the modulo-5 Cuccaro adder (i.e., the register that gets overwritten with addition result). Here, a shift is used to account for the difference in exponent of <italic>u</italic> and <italic>u</italic>
<sup>2</sup>. This part of the 0011<italic>a</italic> is not affected by the partial reduction of workspace qubits. The second part of 0011<italic>a</italic> set &#x2212;<italic>u</italic> (for <inline-formula id="inf255">
<mml:math id="m274">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>) or <italic>u</italic> (for <inline-formula id="inf256">
<mml:math id="m275">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>) into &#x201c;a&#x201d; register of modulo-5 adder. <xref ref-type="fig" rid="F18">Figure 18</xref> shows the quantum-circuit implementation of this second step before a reduction of workspace qubits is performed. It can be seen that in a partial reduction of the workspace qubits, one or more of the qubits in the &#x201c;a&#x201d; register need to be removed. For the example of the reduction to 26 qubits, the qubits <inline-formula id="inf257">
<mml:math id="m276">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mn>4</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> will be eliminated. For the reduction to 25 qubits, qubits <inline-formula id="inf258">
<mml:math id="m277">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mn>4</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> will be involved as indicated with the red box in <xref ref-type="fig" rid="F18">Figure 18</xref>.</p>
<fig id="F18" position="float">
<label>FIGURE 18</label>
<caption>
<p>Re-arranged quantum circuit (without further reduction on workspace qubits). Quantum circuit shows setting of &#x2212; <italic>u</italic> (for <inline-formula id="inf259">
<mml:math id="m278">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>) or <italic>u</italic> (for <inline-formula id="inf260">
<mml:math id="m279">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>) into &#x201c;a&#x201d; register of modulo-5 adder. Velocity <italic>u</italic> and squared velocity <italic>u</italic>
<sup>2</sup> are defined as quantum floating-point numbers with <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 and <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g018.tif"/>
</fig>
<p>The quantum circuit illustrated in <xref ref-type="fig" rid="F18">Figure 18</xref> first &#x201c;copies&#x201d; the mantissa qubits (including the &#x201c;hidden&#x201d; qubit) into the &#x201c;a&#x201d; register for <inline-formula id="inf261">
<mml:math id="m280">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and for <inline-formula id="inf262">
<mml:math id="m281">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. To perform &#x2212;<italic>u</italic> &#x2b; <italic>u</italic>
<sup>2</sup>, the second part of the circuit transforms the qubits to 2&#x2019;s complement for <inline-formula id="inf263">
<mml:math id="m282">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. Without this change to 2&#x2019;s complement formulation, i.e., for <inline-formula id="inf264">
<mml:math id="m283">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> the reduction of the workspace for the modulo-5 adder can be performed using the approach previously shown for the 4-qubit adders in the evaluation of <italic>u</italic>
<sup>2</sup>.</p>
<p>For <inline-formula id="inf265">
<mml:math id="m284">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, in most cases, the need arises to use different computational kernels (derived for different choice of the reduced qubits), depending of the state of the remaining mantissa qubits of <italic>u</italic>. The following three examples illustrate this:<list list-type="simple">
<list-item>
<p>(1) Reduction by 2 qubits to 26-qubit circuit, <inline-formula id="inf266">
<mml:math id="m285">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. For normalized inputs, we then have <inline-formula id="inf267">
<mml:math id="m286">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> in the representation without hidden qubit. For <inline-formula id="inf268">
<mml:math id="m287">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>: &#x201c;-u&#x201d; into modulo-5 adder, now 4 cases need to be considered:</p>
<list list-type="simple">
<list-item>
<p>&#x2022; <inline-formula id="inf269">
<mml:math id="m288">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and there for &#x201c;&#x2212;u&#x201d;: <inline-formula id="inf270">
<mml:math id="m289">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</p>
</list-item>
<list-item>
<p>&#x2022; <inline-formula id="inf271">
<mml:math id="m290">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and there for &#x201c;&#x2212;u&#x201d;: <inline-formula id="inf272">
<mml:math id="m291">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</p>
</list-item>
<list-item>
<p>&#x2022; <inline-formula id="inf273">
<mml:math id="m292">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1010</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and there for &#x201c;&#x2212;u&#x201d;: <inline-formula id="inf274">
<mml:math id="m293">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</p>
</list-item>
<list-item>
<p>&#x2022; <inline-formula id="inf275">
<mml:math id="m294">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and there for &#x201c;-u&#x201d;: <inline-formula id="inf276">
<mml:math id="m295">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</p>
</list-item>
</list>
</list-item>
</list>showing that modulo-5 kernels derived for <inline-formula id="inf277">
<mml:math id="m296">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mn>4</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and for <inline-formula id="inf278">
<mml:math id="m297">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mn>4</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> are needed, depending on <inline-formula id="inf279">
<mml:math id="m298">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. In addition for <inline-formula id="inf280">
<mml:math id="m299">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> a <italic>NOT</italic> operation on <inline-formula id="inf281">
<mml:math id="m300">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> just before and after performing the addition is needed;<list list-type="simple">
<list-item>
<p>(2) Reduction by 3 qubits to 25-qubit circuit, <inline-formula id="inf282">
<mml:math id="m301">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. For normalized inputs, we then have <inline-formula id="inf283">
<mml:math id="m302">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> in the representation without hidden qubit. For <inline-formula id="inf284">
<mml:math id="m303">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>: &#x201c;&#x2212;u&#x201d; into modulo-5 adder, now 2 cases need to be considered:</p>
<list list-type="simple">
<list-item>
<p>&#x2022; <inline-formula id="inf285">
<mml:math id="m304">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and there for &#x201c;&#x2212;u&#x201d;: <inline-formula id="inf286">
<mml:math id="m305">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</p>
</list-item>
<list-item>
<p>&#x2022; <inline-formula id="inf287">
<mml:math id="m306">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and there for &#x201c;&#x2212;u&#x201d;: <inline-formula id="inf288">
<mml:math id="m307">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</p>
</list-item>
</list>
</list-item>
</list>similar to the reduction-to-26-qubits example, it follows that modulo-5 kernels derived for <inline-formula id="inf289">
<mml:math id="m308">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mn>4</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and for <inline-formula id="inf290">
<mml:math id="m309">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mn>4</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1011</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> are needed for this example, again with a switch between these kernels that depends on <inline-formula id="inf291">
<mml:math id="m310">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>;<list list-type="simple">
<list-item>
<p>(3) Reduction by 4 qubits to 24-qubit circuit, i.e., with all mantissa qubits for <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 reduced out in the transformed circuit. For the example <inline-formula id="inf292">
<mml:math id="m311">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, the normalized input showing the hidden qubit is <inline-formula id="inf293">
<mml:math id="m312">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>q</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. For <inline-formula id="inf294">
<mml:math id="m313">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, &#x201c;&#x2212;u&#x201d; is then represented as <inline-formula id="inf295">
<mml:math id="m314">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10111</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>
</p>
</list-item>
</list>
</p>
<p>For the first two examples, <xref ref-type="fig" rid="F19">Figure 19</xref> shows the quantum-circuit implementation of the reduced <italic>MA</italic>5 operation for <inline-formula id="inf296">
<mml:math id="m315">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. The circuits were derived by first creating two separate kernels, e.g. for <inline-formula id="inf297">
<mml:math id="m316">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mn>4</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and for <inline-formula id="inf298">
<mml:math id="m317">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mn>4</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>3</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> in the reduction-by-2 qubits example. Then, the differences between the kernels are performed conditional and ancilla qubit <inline-formula id="inf299">
<mml:math id="m318">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mi>n</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> in the combined circuits shown.</p>
<fig id="F19" position="float">
<label>FIGURE 19</label>
<caption>
<p>Quantum circuits for <italic>MA</italic>5 used in reduced circuit with 26 qubits and with 25 qubits for <inline-formula id="inf300">
<mml:math id="m319">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g019.tif"/>
</fig>
<p>Note: The quantum circuit reductions shown here were performed manually and certainly pose major challenges for automation by circuit compilation methods.</p>
</sec>
</sec>
<sec id="s10">
<title>10 Complexity analysis</title>
<p>For the full quantum circuit introduced here, the case with 4 mantissa qubits (<italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4) and 3 exponent qubits (<italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3) is described in detail in the present work. A crucial factor in applying this quantum algorithm as well as its simulation on classical hardware is its computational complexity in terms of space (number of qubits&#x2014;or circuit width) and time (number of gate operations and circuit depth) as a function of <italic>N</italic>
<sub>
<italic>M</italic>
</sub> and <italic>N</italic>
<sub>
<italic>E</italic>
</sub>. For a well-conditioned computational problem such as the flow field governed by the D1Q3 model (with velocity <italic>u</italic>, squared velocity <italic>u</italic>
<sup>2</sup> and re-scaled distribution functions all &#x226a; 1 in magnitude), it can be expected that meaningful simulations can be performed with <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3. However, to reduce the impact of rounding and truncation errors, realistic applications will involve <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3e; 4. Therefore, the growth of circuit width and depth as function of increasing values of <italic>N</italic>
<sub>
<italic>M</italic>
</sub> is of particular interest in the complexity analysis presented here.</p>
<sec id="s10-1">
<title>10.1 Full circuit&#x2014;Before reduction</title>
<p>For the D1Q3 model 2 qubits <inline-formula id="inf301">
<mml:math id="m320">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> are required independent of <italic>N</italic>
<sub>
<italic>M</italic>
</sub> and <italic>N</italic>
<sub>
<italic>E</italic>
</sub>. Using the hidden-qubit approach, the <italic>u</italic>-velocity is defined in terms of exponent, sign and mantissa using <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x2b; 1 &#x2b; <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x2212; 1 &#x3d; <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x2b; <italic>N</italic>
<sub>
<italic>M</italic>
</sub> qubits. For the output <inline-formula id="inf302">
<mml:math id="m321">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mo>&#x20d7;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula>, similarly <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x2b; <italic>N</italic>
<sub>
<italic>M</italic>
</sub> are required since the same floating-point format is used. A single qubit <inline-formula id="inf303">
<mml:math id="m322">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>c</mml:mi>
<mml:mi>u</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> is used to identify cases with truncation to 0 of <italic>u</italic>
<sup>2</sup>. The temporary storage of <italic>u</italic>
<sup>2</sup> in floating-point representation requires <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x2b; <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x2212; 1 qubits since a &#x201c;sign&#x201d; qubit is not required. The remaining qubits represent the &#x201c;workspace&#x201d; of the algorithm. Two computational steps are performed (as well as their un-computation) within this space: the shift-and-add based evaluation of <italic>u</italic>
<sup>2</sup> and the &#x201c;signed&#x201d; addition &#xb1;<italic>u</italic> &#x2b; <italic>u</italic>
<sup>2</sup> for directions <inline-formula id="inf304">
<mml:math id="m323">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and <inline-formula id="inf305">
<mml:math id="m324">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. For the example <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x3d; 4 this addition is performed using a 5-qubit modulo adder. The modulo adder requires 2<italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x2b; 1 qubits. The <italic>u</italic>
<sup>2</sup> evaluation a 2<italic>N</italic>
<sub>
<italic>M</italic>
</sub> results register, <italic>N</italic>
<sub>
<italic>M</italic>
</sub> qubits for unsigned velocity input, 1 &#x201c;carry&#x201d; qubit as well as 1 ancilla qubit. In total, the <italic>u</italic>
<sup>2</sup> evaluation therefore requires 3<italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x2b; 2 qubits. This exceeds the requirement of the modulo adder and therefore the workspace needs a total of 3<italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x2b; 2 qubits. The total space complexity of the original quantum circuit therefore is:<disp-formula id="equ2">
<mml:math id="m325">
<mml:mn>2</mml:mn>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>2</mml:mn>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>M</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>&#x2b;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>M</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>3</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>M</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>4</mml:mn>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>3</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>6</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>M</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
</disp-formula>
</p>
</sec>
<sec id="s10-2">
<title>10.2 Quantum circuit after reduction steps</title>
<p>After the first reduction step introduced in <xref ref-type="sec" rid="s9">Section 9</xref>, the following qubits were removed from the original circuit: 2 qubits <inline-formula id="inf306">
<mml:math id="m326">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x2b; <italic>N</italic>
<sub>
<italic>M</italic>
</sub> (input &#x201c;u&#x201d; in signed floating-point format) as well as the single <inline-formula id="inf307">
<mml:math id="m327">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>c</mml:mi>
<mml:mi>u</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> qubit. Therefore, the total space complexity for the quantum circuit following this first reduction step is therefore:<disp-formula id="equ3">
<mml:math id="m328">
<mml:mn>4</mml:mn>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>3</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>6</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>M</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:mo>&#x2b;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>M</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>2</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>5</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>M</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
</disp-formula>
</p>
<p>The further reduction detailed in <xref ref-type="sec" rid="s9-1">Section 9.1</xref>, one or more of the <italic>N</italic>
<sub>
<italic>M</italic>
</sub> qubits defining the unsigned velocity input into the <italic>u</italic>
<sup>2</sup> evaluation were eliminated. In its most aggressive form, this reduction step can eliminate all <italic>N</italic>
<sub>
<italic>M</italic>
</sub> qubits defining the unsigned velocity input, so that the space complexity reduces further to:<disp-formula id="equ4">
<mml:math id="m329">
<mml:mn>1</mml:mn>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>2</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>5</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>M</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>M</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>2</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>4</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>M</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
</disp-formula>
</p>
<p>To illustrate the complexity for different choices of <italic>N</italic>
<sub>
<italic>M</italic>
</sub>, <xref ref-type="table" rid="T3">Table 3</xref> summarized the required number of qubits for <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3 and increasing <italic>N</italic>
<sub>
<italic>M</italic>
</sub> for the original quantum circuits as well as the reduction steps 1 and 2.</p>
<table-wrap id="T3" position="float">
<label>TABLE 3</label>
<caption>
<p>Required number of qubits for original and transformed quantum circuits (<italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3).</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="left">
<italic>N</italic>
<sub>
<italic>M</italic>
</sub>
</th>
<th align="left">Original</th>
<th align="left">Reduction 1</th>
<th align="left">Reduction 2</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">4</td>
<td align="left">4 &#x2b; 9 &#x2b; 24 &#x3d; 37</td>
<td align="left">1 &#x2b; 6 &#x2b; 20 &#x3d; 27</td>
<td align="left">1 &#x2b; 6 &#x2b; 16 &#x3d; 23</td>
</tr>
<tr>
<td align="left">5</td>
<td align="left">4 &#x2b; 9 &#x2b; 30 &#x3d; 43</td>
<td align="left">1 &#x2b; 6 &#x2b; 25 &#x3d; 32</td>
<td align="left">1 &#x2b; 6 &#x2b; 20 &#x3d; 27</td>
</tr>
<tr>
<td align="left">6</td>
<td align="left">4 &#x2b; 9 &#x2b; 36 &#x3d; 49</td>
<td align="left">1 &#x2b; 6 &#x2b; 30 &#x3d; 37</td>
<td align="left">1 &#x2b; 6 &#x2b; 24 &#x3d; 31</td>
</tr>
<tr>
<td align="left">7</td>
<td align="left">4 &#x2b; 9 &#x2b; 42 &#x3d; 55</td>
<td align="left">1 &#x2b; 6 &#x2b; 35 &#x3d; 42</td>
<td align="left">1 &#x2b; 6 &#x2b; 28 &#x3d; 35</td>
</tr>
<tr>
<td align="left">8</td>
<td align="left">4 &#x2b; 9 &#x2b; 48 &#x3d; 61</td>
<td align="left">1 &#x2b; 6 &#x2b; 40 &#x3d; 47</td>
<td align="left">1 &#x2b; 6 &#x2b; 32 &#x3d; 39</td>
</tr>
<tr>
<td align="left">12</td>
<td align="left">4 &#x2b; 9 &#x2b; 72 &#x3d; 85</td>
<td align="left">1 &#x2b; 6 &#x2b; 60 &#x3d; 67</td>
<td align="left">1 &#x2b; 6 &#x2b; 48 &#x3d; 55</td>
</tr>
<tr>
<td align="left">16</td>
<td align="left">4 &#x2b; 9 &#x2b; 96 &#x3d; 109</td>
<td align="left">1 &#x2b; 6 &#x2b; 80 &#x3d; 87</td>
<td align="left">1 &#x2b; 6 &#x2b; 64 &#x3d; 71</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>
<xref ref-type="fig" rid="F20">Figure 20</xref> shows the memory required to store the qubit information as a pair of 32-bit floating point numbers. For reference, the red lines show the FPGA board memory and 1&#xa0;TB, 1&#xa0;PB, 1&#xa0;EB and 1&#xa0;ZB. To put this into context: the UK&#x2019;s largest supercomputer, Archer, comprises 4,920 nodes with each 64&#xa0;GB of memory, so the total memory is still less than 1&#xa0;PB.</p>
<fig id="F20" position="float">
<label>FIGURE 20</label>
<caption>
<p>Memory requirements for the original circuit and the two types of reduced circuits as a function of <italic>N</italic>
<sub>
<italic>M</italic>
</sub>, for <italic>N</italic>
<sub>
<italic>E</italic>
</sub> &#x3d; 3</p>
</caption>
<graphic xlink:href="fmech-08-925637-g020.tif"/>
</fig>
</sec>
</sec>
<sec id="s11">
<title>11 Examples of D1Q3 quantum circuit reduced to 25 qubits</title>
<p>In this section, two examples are considered of reduced circuits with 25 qubits:<list list-type="simple">
<list-item>
<p>&#x2022; Example 1: velocity <italic>u</italic> defined as <inline-formula id="inf308">
<mml:math id="m330">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>01000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>8</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>32</mml:mn>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>4</mml:mn>
</mml:math>
</inline-formula> or <inline-formula id="inf309">
<mml:math id="m331">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>01001</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>9</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>32</mml:mn>
</mml:math>
</inline-formula>. Alternatively, in terms of unsigned hidden-qubit formulation for mantissa: <inline-formula id="inf310">
<mml:math id="m332">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>000</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> or <inline-formula id="inf311">
<mml:math id="m333">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>001</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>;</p>
</list-item>
<list-item>
<p>&#x2022; Example 2: velocity <italic>u</italic> defined as <inline-formula id="inf312">
<mml:math id="m334">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>01100</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>12</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>64</mml:mn>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>3</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>16</mml:mn>
</mml:math>
</inline-formula> or <inline-formula id="inf313">
<mml:math id="m335">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>01101</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>13</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>64</mml:mn>
</mml:math>
</inline-formula>. In terms of unsigned hidden-qubit formulation for mantissa: <inline-formula id="inf314">
<mml:math id="m336">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>100</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> or <inline-formula id="inf315">
<mml:math id="m337">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>101</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>.</p>
</list-item>
</list>
</p>
<p>With a further reduction by 3 qubits, this means that only <inline-formula id="inf316">
<mml:math id="m338">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>u</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> acts as input qubit, and therefore the reduced circuits represented by both examples only compute 2 separate input velocities <italic>u</italic> each, as itemized above.</p>
<p>The equilibrium distribution functions <inline-formula id="inf317">
<mml:math id="m339">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> (defined by <inline-formula id="inf318">
<mml:math id="m340">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>) and <inline-formula id="inf319">
<mml:math id="m341">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> (defined by <inline-formula id="inf320">
<mml:math id="m342">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:mi>v</mml:mi>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>) are shown in <xref ref-type="table" rid="T4">Table 4</xref>.</p>
<table-wrap id="T4" position="float">
<label>TABLE 4</label>
<caption>
<p>Input and output of examples for 25-qubit example circuits. Mantissa is shown without &#x201c;hidden qubit.&#x201d;</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="left">
<italic>u</italic>
</th>
<th align="left">
<italic>u</italic>
<sup>2</sup>
</th>
<th align="left">
<inline-formula id="inf321">
<mml:math id="m343">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>u</mml:mi>
<mml:mo>/</mml:mo>
<mml:mn>2</mml:mn>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>/</mml:mo>
<mml:mn>2</mml:mn>
</mml:math>
</inline-formula>
</th>
<th align="left">
<inline-formula id="inf322">
<mml:math id="m344">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>u</mml:mi>
<mml:mo>/</mml:mo>
<mml:mn>2</mml:mn>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>/</mml:mo>
<mml:mn>2</mml:mn>
</mml:math>
</inline-formula>
</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">
<inline-formula id="inf323">
<mml:math id="m345">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>8</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>32</mml:mn>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf324">
<mml:math id="m346">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>8</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>128</mml:mn>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf325">
<mml:math id="m347">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>6</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>64</mml:mn>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf326">
<mml:math id="m348">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>010</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>10</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>64</mml:mn>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf327">
<mml:math id="m349">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>001</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>9</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>32</mml:mn>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf328">
<mml:math id="m350">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>010</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>10</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>128</mml:mn>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf329">
<mml:math id="m351">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>7</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>64</mml:mn>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf330">
<mml:math id="m352">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>11</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>64</mml:mn>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf331">
<mml:math id="m353">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>12</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>64</mml:mn>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf332">
<mml:math id="m354">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>011</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>001</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>9</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>256</mml:mn>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf333">
<mml:math id="m355">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>010</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>10</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>128</mml:mn>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf334">
<mml:math id="m356">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>14</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>128</mml:mn>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">
<inline-formula id="inf335">
<mml:math id="m357">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>13</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>64</mml:mn>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf336">
<mml:math id="m358">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>011</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>010</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>10</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>256</mml:mn>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf337">
<mml:math id="m359">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>11</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>128</mml:mn>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf338">
<mml:math id="m360">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>111</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>15</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>128</mml:mn>
</mml:math>
</inline-formula>
</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>Here, the term &#x2212;<italic>u</italic> &#x2b; <italic>u</italic>
<sup>2</sup> required in <inline-formula id="inf339">
<mml:math id="m361">
<mml:msubsup>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mi>q</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> was evaluated as follows using a modulo-5 adder. For positive numbers, a 5-qubit input with a leading <inline-formula id="inf340">
<mml:math id="m362">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, followed by the hidden qubit and <italic>N</italic>
<sub>
<italic>M</italic>
</sub> &#x2212; 1 &#x3d; 3 mantissa qubits is used, while for negative numbers, the 4-qubit representation (including hidden qubit) is transformed into its 5-qubit 2&#x2019;s complement. Furthermore, mantissa qubits are shifted where necessary to account for difference in exponents of the two inputs. Such shifts are performed before transformation to 2&#x2019;s complement. Then, for the four examples in the table above, the &#x201c;signed&#x201d; addition can be summarized as:<disp-formula id="equ5">
<mml:math id="m363">
<mml:mtable class="eqnarray-star">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>u</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>8</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>32</mml:mn>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>000</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
<mml:mo>:</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11000</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00010</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11010</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2192;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>u</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>6</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>32</mml:mn>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>12</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>64</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>u</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>9</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>32</mml:mn>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>001</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
<mml:mo>:</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10111</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00010</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>11001</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2192;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>u</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>110</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>7</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>32</mml:mn>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>14</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>64</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>u</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>12</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>64</mml:mn>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
<mml:mo>:</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10100</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00010</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10110</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2192;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>u</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>010</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>10</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>64</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>u</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>13</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>64</mml:mn>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
<mml:mo>:</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10011</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>00010</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>10101</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2192;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>u</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>101</mml:mn>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mn>011</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>11</mml:mn>
<mml:mo>/</mml:mo>
<mml:mn>64</mml:mn>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
</disp-formula>
</p>
<p>As can be seen, in the top two examples, the outcomes &#x2212;6/32 and &#x2212;7/32 result from the modulo-5 mantissa addition, so that a re-normalization is required. This leads to the normalized numbers &#x2212;12/64 and &#x2212;14/64, respectively. For the bottom two examples, such a re-normalization was not required.</p>
</sec>
<sec id="s12">
<title>12 Evaluation</title>
<sec id="s12-1">
<title>12.1 Experimental setup</title>
<p>We evaluated our approach on a single-node FPGA system. Our host system has a dual Intel Xeon E5-2609 V2 2.5&#xa0;GHz processor and 64&#xa0;GB RAM (DDR3, 1.6&#xa0;GHz). This system hosts a Nallatech PCIe-385N A7 FPGA board with 8&#xa0;GB RAM (DDR3) connected through a PCIe 2 connection. The system runs Scientific Linux 6.8 and we used the Intel SDK for OpenCL Version 17.1 to communicate with and program the FPGA device. The CPU used for evaluation is the same as the FPGA host. The host code is compiled using G&#x2b;&#x2b; (GCC version 4.7.2). To evaluate the CPU approach, we run the same OpenCL kernel with the same host code. Our GPU system has access to an NVIDIA GK110B (GeForce GTX TITAN Black), with access to 6&#xa0;GB of VRAM, which is used for the GPU evaluation target. The GPU system compiles the C&#x2b;&#x2b; host code with G&#x2b;&#x2b; (GCC version 5.4.0).</p>
</sec>
<sec id="s12-2">
<title>12.2 Experimental results</title>
<sec id="s12-2-1">
<title>12.2.1 FPGA resource utilization</title>
<p>We compiled our source code with the AOC tool provided by the Intel SDK for OpenCL. <xref ref-type="table" rid="T5">Table 5</xref> summarizes the FPGA resource utilization and maximum operating frequency (<italic>F</italic>
<sub>max</sub>) after synthesis for the presented architecture for 1 through 8 compute units. We see that while we cannot double our current maximum number of compute units directly, we still have room to improve the design by simply adding more compute units, potentially up to 12 units. This is still to be demonstrated as adjustments have to be made to allow for a non-power of 2 number of compute units.</p>
<table-wrap id="T5" position="float">
<label>TABLE 5</label>
<caption>
<p>FPGA resource utilization and maximum frequency for a baseline (Over-PCIe) Single-Qubit gate QWM kernel for 1 through 8 compute units and 8 maximum controls per gate.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="left">NCU</th>
<th align="left">1</th>
<th align="left">2</th>
<th align="left">4</th>
<th align="left">8</th>
<th align="left">Total available</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">ALUTs</td>
<td align="left">62,136 (18%)</td>
<td align="left">79,396 (23%)</td>
<td align="left">117,368 (34%)</td>
<td align="left">194,506 (56%)</td>
<td align="left">345,200</td>
</tr>
<tr>
<td align="left">FFs</td>
<td align="left">69,040 (10%)</td>
<td align="left">89,752 (13%)</td>
<td align="left">124,272 (28%)</td>
<td align="left">201,822 (29%)</td>
<td align="left">690,400</td>
</tr>
<tr>
<td align="left">RAMs</td>
<td align="left">403 (20%)</td>
<td align="left">464 (23%)</td>
<td align="left">584 (29%)</td>
<td align="left">821 (41%)</td>
<td align="left">2014</td>
</tr>
<tr>
<td align="left">DSPs</td>
<td align="left">16 (1%)</td>
<td align="left">32 (2%)</td>
<td align="left">64 (4%)</td>
<td align="left">128 (8%)</td>
<td align="left">1,590</td>
</tr>
<tr>
<td align="left">
<italic>F</italic>
<sub>max</sub> (MHz)</td>
<td align="left">292.82</td>
<td align="left">299.85</td>
<td align="left">271.81</td>
<td align="left">254.00</td>
<td align="left">&#x2014;</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
<sec id="s12-2-2">
<title>12.2.2 Full square circuits</title>
<p>
<xref ref-type="fig" rid="F21">Figure 21</xref> shows the runtime results for several full squaring circuits with input mantissa sizes of 4&#xa0;bits through 8&#xa0;bits. The FPGA outperforms the CPU for a small number of qubits, which is demonstrative of the higher overhead needed by the CPU to run the circuit. For a higher number of qubits, the CPU clearly outperforms our current baseline FPGA implementation. This is down to the current implementation not having any FPGA-specific optimizations (discussed below). In particular, to achieve universality, this architecture can run a number of different gates based on the gate opcode (or gate matrix) passed to it by the host. While this is necessary for some algorithms which require universality, some classes of circuits can be performed with a reduced set of operational gates, for which we can specialize the FPGA architecture. <xref ref-type="bibr" rid="B3">Aminian et al. (2008)</xref> demonstrate this in their work discussed in <xref ref-type="sec" rid="s3-2">Section 3.2</xref>.</p>
<fig id="F21" position="float">
<label>FIGURE 21</label>
<caption>
<p>Total circuit and average gate simulation times for the squaring circuits with different input sizes. Logarithmic scale is representative of growing circuit qubit count.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g021.tif"/>
</fig>
</sec>
<sec id="s12-2-3">
<title>12.2.3 Reduced square circuits</title>
<p>
<xref ref-type="fig" rid="F22">Figure 22</xref> shows the runtime results for the full 4-bit input mantissa squaring circuit and two reduced specializations with three fewer qubits. As expected, the lower qubit reduced circuits outperform the full circuit and require considerably less memory. This demonstrates the advantage in runtime gained by performing the proposed reductions on a small circuit. For the two demonstrated reduced circuits, the FPGA slightly outperforms the CPU, which again is down to the CPU having more overhead. This will not be the case for a larger circuit being simulated on this baseline architecture.</p>
<fig id="F22" position="float">
<label>FIGURE 22</label>
<caption>
<p>Total circuit simulation times for the full SQ4 and the reduced SQ4 circuit with two different input specializations.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g022.tif"/>
</fig>
</sec>
<sec id="s12-2-4">
<title>12.2.4 Reduced 25-qubit D1Q3</title>
<p>
<xref ref-type="fig" rid="F23">Figure 23</xref> shows the total circuit runtime results for the reduced 25-qubit D1Q3 with several specializations for <inline-formula id="inf341">
<mml:math id="m364">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>d</mml:mi>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and <inline-formula id="inf342">
<mml:math id="m365">
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>e</mml:mi>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. The observed variations in total circuit runtime between the different specializations of the D1Q3 circuit are due to the number of quantum gates being different across these specialized reduced circuits. Because of the memory restrictions of our CPU and FPGA systems, we were unable to run the full 37-qubit version of this circuit. In this work, the main motivation for the introduced circuit transformations is to facilitate the simulation of large circuits, which without these reductions would not fit in the memory. Alternatively, similar transformations can also be used on smaller circuits that do fit in the device&#x2019;s memory to reduce their execution times, by taking advantage of fine-grained parallelism, as demonstrated in the previous section. For evaluating the circuit for different inputs, different quantum circuit specializations have to be ran on the architecture; however, since the architecture is circuit-independent, there is no extra cost for running different circuits on it. Since no FPGA bitstream compilation has to be run between circuit evaluations, this achieves our goal of reusability, up to some constant maximum number of controls per gate.</p>
<fig id="F23" position="float">
<label>FIGURE 23</label>
<caption>
<p>Total circuit simulation times for the reduced D1Q3 circuit with different input specializations.</p>
</caption>
<graphic xlink:href="fmech-08-925637-g023.tif"/>
</fig>
</sec>
</sec>
<sec id="s12-3">
<title>12.3 Discussion</title>
<p>The above results show the potential of our approach of circuit transformations to reduce the number of qubits in exchange for a higher number of control bits. <xref ref-type="table" rid="T6">Table 6</xref> shows a summary of the runtimes used to infer the following performance and power consumption results. With the current status of our work, in absolute terms, the performance of the simulation on the FPGA is about half as fast as on the CPU host. The GPU benefits from very high memory bandwidth and thousands of compute threads, and thus it shines for this particular approach of simulation (QWM with a full state vector), beating the FPGA by a factor of 20 for high-qubit circuits.</p>
<table-wrap id="T6" position="float">
<label>TABLE 6</label>
<caption>
<p>Runtime results in seconds for architecture with 8 NCU and 8 NCONTROLS. Displayed results for reduced circuits is the average runtime across different specializations, which vary in circuit width.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="left"/>
<th align="left">FPGA</th>
<th align="left">CPU</th>
<th align="left">GPU</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">SQ4</td>
<td align="char" char=".">0.0013</td>
<td align="char" char=".">0.0010</td>
<td align="char" char=".">0.0026</td>
</tr>
<tr>
<td align="left">Reduced SQ4</td>
<td align="char" char=".">0.0036</td>
<td align="char" char=".">0.0043</td>
<td align="char" char=".">0.0016</td>
</tr>
<tr>
<td align="left">Reduced D1Q3</td>
<td align="char" char=".">18.59</td>
<td align="char" char=".">10.49</td>
<td align="char" char=".">0.877</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>However, as explained before, to scale to larger numbers of qubits, it is necessary to move to clusters of FPGAs. For supercomputer clusters, the dominant factor is the energy consumption and therefore we need to consider the performance per Watt. From that perspective, the picture is quite different: the measured power consumption of the FPGA board is 25&#xa0;W (<xref ref-type="bibr" rid="B47">Segal et al., 2014</xref>); the host CPU consumes 160&#xa0;W (not including RAM power consumption). So already the FPGA simulation has more than 3&#xd7; better performance per Watt than the CPU. Our evaluation GPU consumes 250&#xa0;W of power, meaning it is about 2&#xd7; better than the FPGA in terms of performance per Watt.</p>
</sec>
<sec id="s12-4">
<title>12.4 Future further improvements</title>
<p>Furthermore, there is a lot of scope for improvement of the FPGA performance. We used a baseline over-PCIe architecture without pipeline control to obtain the presented results. For parallelisation on the device, the architecture currently relies on the dynamic scheduler of the OpenCL NDRange construct. It is unclear how well this pipelines our design and we estimate the architecture would likely benefit from tighter control over pipelining. This would involve using OpenCL channels to explicitly control the flow of the amplitudes through the design. In addition, we are currently not applying any caching techniques in our design, several of which can be applied. Each of our kernels currently reads two values at a time from the distributed RAM of the FPGA, performs some computation on them, and writes them back. We can make better utilization of the DRAM&#x2019;s bandwidth by reading the required amplitudes in consecutive blocks. Due to the exponential strides between the amplitudes, it may not always be possible to fill the cache in one memory read with matching amplitudes. However, we can show that this is possible with two contiguous memory reads. Furthermore, another optimization technique which would be particularly useful for circuits like the ones presented here is state vector compression. For circuits whose intermediary state vectors present repetition in their amplitude values, it is not always necessary to store the full state vector in memory. Instead, memory access is replaced by computation over a compressed state vector space; a pattern very suitable for application on an FPGA.</p>
<p>With these improvements, which are the focus of our research at the moment, it is expected that the FPGA will outperform the CPU even in absolute terms, so that we are confident that the FPGA simulation can achieve an order of magnitude better performance per Watt. We are also aiming to show that an optimized FPGA architecture can outperform a GPU in performance per Watt and total energy consumption.</p>
</sec>
</sec>
<sec id="s13">
<title>13 Conclusion</title>
<p>Quantum circuits for the non-linear equilibrium distribution function for the D1Q3 lattice-based model were introduced as a step towards more complete models such as D2Q9 and D3Q27. A key feature of the derived circuits is the use of the quantum computational basis encoding along with the use of a reduced-precision floating-point representation. This in contrast to existing work typically employing fixed-point representation in quantum algorithms using the quantum computational basis encoding. It is demonstrated that for modest precision (e.g., using 4-bit mantissas) quantum circuits with fewer than 40 qubits can be derived. Even with further ancillae qubits that result from transpiling the circuit to native gates available on quantum hardware, this shows that for Noisy Intermediate-Scale Quantum (NISQ) Computer-era hardware, demonstration of the introduced quantum circuits is feasible. The quantum-circuit transformation introduced and detailed in this work show that starting from the full circuit, reduced circuits can effectively be created so that step-by-step the behavior of the full quantum circuit can be analyzed using more limited resources, while taking advantage of the fine-grained parallelism offered by FPGAs.</p>
<p>We demonstrate reductions from 37 to 23 qubits for the quantum circuit computing the equilibrium distribution function of D1Q3 model with input velocity defined in floating-point format with a 4-qubit mantissa and 3-qubit exponent. For increased mantissa qubit count of 16, a reduction from 109 to 71 qubits occurs. We show that the reduced circuit can be successfully run on an FPGA system and that the FPGA simulation has more than 3&#xd7; better performance per Watt compared to the CPU simulation.</p>
<p>In future work, the quantum-circuit transformation methods will be analyzed further and extended to wider range of circuits. In terms of fluid dynamics applications, the step towards D2Q9 and D3Q27 is the aim of future work. We will also explore a number of techniques to improve the FPGA simulation performance, with the aim of obtaining a 10&#xd7; improvement in performance per Watt over the CPU and outperforming the GPU in energy consumption.</p>
</sec>
</body>
<back>
<sec sec-type="data-availability" id="s14">
<title>Data availability statement</title>
<p>The raw data supporting the conclusion of this article will be made available by the authors, without undue reservation.</p>
</sec>
<sec id="s15">
<title>Author contributions</title>
<p>YM: Development of Haskell compilation toolchain and FPGA architecture&#x2014;Presenting results of encoded reduced quantum circuits for D1Q3 and analysis WV: Summary and discussion of presented results and power efficiency analysis RS: Derivation of the quantum circuit implementation of the D1Q3 model&#x2014;Initiated the work on the circuit transformation methods for reducing required number of qubits&#x2014;Manual derivation of the example reduced circuits provided.</p>
</sec>
<sec id="s16">
<title>Funding</title>
<p>This work was supported by a PhD studentship from the College of Science and Engineering at the University of Glasgow.</p>
</sec>
<sec sec-type="COI-statement" id="s17">
<title>Conflict of interest</title>
<p>The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p>
</sec>
<sec sec-type="disclaimer" id="s18">
<title>Publisher&#x2019;s note</title>
<p>All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.</p>
</sec>
<ref-list>
<title>References</title>
<ref id="B1">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Aaronson</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Gottesman</surname>
<given-names>D.</given-names>
</name>
</person-group> (<year>2004</year>). <article-title>Improved simulation of stabilizer circuits</article-title>. <source>Phys. Rev. A</source> <volume>70</volume>, <fpage>052328</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevA.70.052328</pub-id> </citation>
</ref>
<ref id="B2">
<citation citation-type="confproc">
<person-group person-group-type="author">
<name>
<surname>A&#xef;meur</surname>
<given-names>E.</given-names>
</name>
<name>
<surname>Brassard</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Gambs</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>2007</year>). &#x201c;<article-title>Quantum clustering algorithms</article-title>,&#x201d; in <conf-name>ICML &#x2019;07: Proceedings of the 24th International Conference on Machine Learning</conf-name> (<publisher-loc>New York, NY, USA</publisher-loc>: <publisher-name>Association for Computing Machinery</publisher-name>), <fpage>1</fpage>&#x2013;<lpage>8</lpage>. <pub-id pub-id-type="doi">10.1145/1273496.1273497</pub-id> </citation>
</ref>
<ref id="B3">
<citation citation-type="confproc">
<person-group person-group-type="author">
<name>
<surname>Aminian</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Saeedi</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Zamani</surname>
<given-names>M. S.</given-names>
</name>
<name>
<surname>Sedighi</surname>
<given-names>M.</given-names>
</name>
</person-group> (<year>2008</year>). &#x201c;<article-title>FPGA-based circuit model emulation of quantum algorithms</article-title>,&#x201d; in <conf-name>2008 IEEE Computer Society Annual Symposium on VLSI</conf-name> (<publisher-loc>Montpellier, France</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>399</fpage>&#x2013;<lpage>404</lpage>. <pub-id pub-id-type="doi">10.1109/ISVLSI.2008.43</pub-id> </citation>
</ref>
<ref id="B4">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Aramon</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Rosenberg</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Valiante</surname>
<given-names>E.</given-names>
</name>
<name>
<surname>Miyazawa</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Tamura</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Katzgraber</surname>
<given-names>H. G.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Physics-inspired optimization for quadratic unconstrained problems using a digital annealer</article-title>. <source>Front. Phys.</source> <volume>7</volume>. <pub-id pub-id-type="doi">10.3389/fphy.2019.00048</pub-id> </citation>
</ref>
<ref id="B5">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Berman</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Ezhov</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Kamenev</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Yepez</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>2002</year>). <article-title>Simulation of the diffusion equation on a type-II quantum computer</article-title>. <source>Phys. Rev. A</source> <volume>66</volume>, <fpage>012310</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevA.66.012310</pub-id> </citation>
</ref>
<ref id="B6">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Berry</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Childs</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Ostrander</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Wang</surname>
<given-names>G.</given-names>
</name>
</person-group> (<year>2017</year>). <article-title>Quantum algorithm for linear differential equations with exponentially improved dependence on precision</article-title>. <source>Commun. Math. Phys.</source> <volume>356</volume>, <fpage>1057</fpage>&#x2013;<lpage>1081</lpage>. <pub-id pub-id-type="doi">10.1007/s00220-017-3002-y</pub-id> </citation>
</ref>
<ref id="B7">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Berry</surname>
<given-names>D.</given-names>
</name>
</person-group> (<year>2014</year>). <article-title>High-order quantum algorithm for solving linear differential equations</article-title>. <source>J. Phys. A Math. Theor.</source> <volume>47</volume>, <fpage>105301</fpage>. <pub-id pub-id-type="doi">10.1088/1751-8113/47/10/105301</pub-id> </citation>
</ref>
<ref id="B8">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Bonny</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Haq</surname>
<given-names>A.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>Emulation of high-performance correlation-based quantum clustering algorithm for two-dimensional data on FPGA</article-title>. <source>Quantum Inf. process.</source> <volume>19</volume>, <fpage>179</fpage>. <pub-id pub-id-type="doi">10.1007/s11128-020-02683-9</pub-id> </citation>
</ref>
<ref id="B9">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Budinski</surname>
<given-names>L.</given-names>
</name>
</person-group> (<year>2021</year>). <article-title>Quantum algorithm for the advection&#x2013;diffusion equation simulated with the lattice Boltzmann method</article-title>. <source>Quantum Inf. process.</source> <volume>20</volume>, <fpage>57</fpage>. <pub-id pub-id-type="doi">10.1007/s11128-021-02996-3</pub-id> </citation>
</ref>
<ref id="B10">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Cao</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Papageorgiou</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Petras</surname>
<given-names>I.</given-names>
</name>
<name>
<surname>Traub</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Kais</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>2013</year>). <article-title>Quantum algorithm and circuit design solving the Poisson equation</article-title>. <source>New J. Phys.</source> <volume>15</volume>, <fpage>013021</fpage>. <pub-id pub-id-type="doi">10.1088/1367-2630/15/1/013021</pub-id> </citation>
</ref>
<ref id="B11">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Childs</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Liu</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>Quantum spectral methods for differential equations</article-title>. <source>Commun. Math. Phys.</source> <volume>375</volume>, <fpage>1427</fpage>&#x2013;<lpage>1457</lpage>. <pub-id pub-id-type="doi">10.1007/s00220-020-03699-z</pub-id> </citation>
</ref>
<ref id="B12">
<citation citation-type="confproc">
<person-group person-group-type="author">
<name>
<surname>Conceicao</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Reis</surname>
<given-names>R.</given-names>
</name>
</person-group> (<year>2015</year>). &#x201c;<article-title>Efficient emulation of quantum circuits on classical hardware</article-title>,&#x201d; in <conf-name>2015 IEEE 6th Latin American Symposium on Circuits &#x26; Systems (LASCAS)</conf-name> (<publisher-loc>Montevideo, Uruguay</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>1</fpage>&#x2013;<lpage>4</lpage>. <pub-id pub-id-type="doi">10.1109/LASCAS.2015.7250404</pub-id> </citation>
</ref>
<ref id="B13">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Costa</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Jordan</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Ostrander</surname>
<given-names>A.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Quantum algorithm for simulating the wave equation</article-title>. <source>Phys. Rev. A . Coll. Park.</source> <volume>99</volume>, <fpage>012323</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevA.99.012323</pub-id> </citation>
</ref>
<ref id="B14">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Steijl</surname>
<given-names>R.</given-names>
</name>
</person-group> (<year>2020</year>). &#x201c;<article-title>Quantum algorithms for fluid simulations</article-title>,&#x201d; in <source>Advances in quantum communication and information</source>. Editor <person-group person-group-type="editor">
<name>
<surname>Bulnes</surname>
<given-names>F.</given-names>
</name>
</person-group> (<publisher-loc>London</publisher-loc>: <publisher-name>IntechOpen</publisher-name>). <comment>ISBN 9781789852684</comment>. <pub-id pub-id-type="doi">10.5772/intechopen.86685</pub-id> </citation>
</ref>
<ref id="B15">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Steijl</surname>
<given-names>R.</given-names>
</name>
</person-group> (<year>2022</year>). &#x201c;<article-title>Quantum algorithms for nonlinear equations in fluid mechanics</article-title>,&#x201d; in <source>Quantum computing and communications</source>. Editor <person-group person-group-type="editor">
<name>
<surname>Zhao</surname>
<given-names>Y.</given-names>
</name>
</person-group> (<publisher-loc>London</publisher-loc>: <publisher-name>IntechOpen</publisher-name>). <comment>ISBN 9781839681332</comment>. <pub-id pub-id-type="doi">10.5772/intechopen.95023</pub-id> </citation>
</ref>
<ref id="B16">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>De Raedt</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Hams</surname>
<given-names>A. H.</given-names>
</name>
<name>
<surname>Michielsen</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>De Raedt</surname>
<given-names>K.</given-names>
</name>
</person-group> (<year>2000</year>). <article-title>Quantum computer emulator</article-title>. <source>Comput. Phys. Commun.</source> <volume>132</volume>, <fpage>1</fpage>&#x2013;<lpage>20</lpage>. <pub-id pub-id-type="doi">10.1016/S0010-4655(00)00132-6</pub-id> </citation>
</ref>
<ref id="B17">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>De Raedt</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Michielsen</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>De Raedt</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Trieu</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Arnold</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Richter</surname>
<given-names>M.</given-names>
</name>
<etal/>
</person-group> (<year>2007</year>). <article-title>Massively parallel quantum computer simulator</article-title>. <source>Comput. Phys. Commun.</source> <volume>176</volume>, <fpage>121</fpage>&#x2013;<lpage>136</lpage>. <pub-id pub-id-type="doi">10.1016/j.cpc.2006.08.007</pub-id> </citation>
</ref>
<ref id="B18">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Fillion-Gourdeau</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Lorin</surname>
<given-names>E.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Simple digital quantum algorithm for symmetric first-order linear hyperbolic systems</article-title>. <source>Numer. Algorithms</source> <volume>82</volume>, <fpage>1009</fpage>&#x2013;<lpage>1045</lpage>. <pub-id pub-id-type="doi">10.1007/s11075-018-0639-3</pub-id> </citation>
</ref>
<ref id="B19">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Gaitan</surname>
<given-names>F.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>Finding flows of a Navier&#x2013;Stokes fluid through quantum computing</article-title>. <source>npj Quantum Inf.</source> <volume>6</volume>, <fpage>61</fpage>. <pub-id pub-id-type="doi">10.1038/s41534-020-00291-0</pub-id> </citation>
</ref>
<ref id="B20">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Garcia</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Markov</surname>
<given-names>I.</given-names>
</name>
</person-group> (<year>2015</year>). <article-title>Simulation of quantum circuits via stabilizer frames</article-title>. <source>IEEE Trans. Comput.</source> <volume>64</volume>, <fpage>2323</fpage>&#x2013;<lpage>2336</lpage>. <pub-id pub-id-type="doi">10.1109/TC.2014.2360532</pub-id> </citation>
</ref>
<ref id="B21">
<citation citation-type="book">
<comment>[Dataset]</comment> <person-group person-group-type="author">
<name>
<surname>Garc&#xed;a-Molina</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Rodr&#xed;guez-Mediavilla</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Garc&#xed;a-Ripoll</surname>
<given-names>J. J.</given-names>
</name>
</person-group> (<year>2021</year>). <source>Solving partial differential equations in quantum computers</source>. </citation>
</ref>
<ref id="B22">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Garc&#xed;a-Ripoll</surname>
<given-names>J. J.</given-names>
</name>
</person-group> (<year>2021</year>). <article-title>Quantum-inspired algorithms for multivariate analysis: From interpolation to partial differential equations</article-title>. <source>Quantum</source> <volume>5</volume>, <fpage>431</fpage>. <pub-id pub-id-type="doi">10.22331/q-2021-04-15-431</pub-id> </citation>
</ref>
<ref id="B23">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Green</surname>
<given-names>A. S.</given-names>
</name>
<name>
<surname>LeFanu</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Ross</surname>
<given-names>N. J.</given-names>
</name>
<name>
<surname>Selinger</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Valiron</surname>
<given-names>B.</given-names>
</name>
</person-group> (<year>2013</year>). <article-title>Quipper: A scalable quantum programming language</article-title>. <source>arXiv.org, 1304:3390</source>. </citation>
</ref>
<ref id="B24">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Guti&#xe9;rrez</surname>
<given-names>E.</given-names>
</name>
<name>
<surname>Romero</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Trenas</surname>
<given-names>M. A.</given-names>
</name>
<name>
<surname>Zapata</surname>
<given-names>E. L.</given-names>
</name>
</person-group> (<year>2010</year>). <article-title>Quantum computer simulation using the cuda programming model</article-title>. <source>Comput. Phys. Commun.</source> <volume>181</volume>, <fpage>283</fpage>&#x2013;<lpage>300</lpage>. <pub-id pub-id-type="doi">10.1016/j.cpc.2009.09.021</pub-id> </citation>
</ref>
<ref id="B25">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Han</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Kim</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>2002</year>). <article-title>Quantum-inspired evolutionary algorithm for a class of combinatorial optimization</article-title>. <source>IEEE Trans. Evol. Comput.</source> <volume>6</volume>, <fpage>580</fpage>&#x2013;<lpage>593</lpage>. <pub-id pub-id-type="doi">10.1109/TEVC.2002.804320</pub-id> </citation>
</ref>
<ref id="B26">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Harrow</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Hassidim</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Lloyd</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>2009</year>). <article-title>Quantum algorithm for linear systems of equations</article-title>. <source>Phys. Rev. Lett.</source> <volume>103</volume>, <fpage>150502</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevLett.103.150502</pub-id> </citation>
</ref>
<ref id="B27">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Itani</surname>
<given-names>W.</given-names>
</name>
<name>
<surname>Succi</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Analysis of carleman linearization of lattice Boltzmann</article-title>. <source>Fluids</source> <volume>7</volume>, <fpage>24</fpage>. <pub-id pub-id-type="doi">10.3390/fluids7010024</pub-id> </citation>
</ref>
<ref id="B28">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Kelly</surname>
<given-names>A.</given-names>
</name>
</person-group> (<year>2018</year>). <article-title>Simulating quantum computers using OpenCL</article-title>. <source>arXiv:1805.00988 [quant-ph]</source>. <comment>ArXiv: 1805.00988</comment>. </citation>
</ref>
<ref id="B29">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Kerenidis</surname>
<given-names>I.</given-names>
</name>
<name>
<surname>Prakash</surname>
<given-names>A.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>Quantum gradient descent for linear systems and least squares</article-title>. <source>Phys. Rev. A</source> <volume>101</volume>, <fpage>022316</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevA.101.022316</pub-id> </citation>
</ref>
<ref id="B30">
<citation citation-type="confproc">
<person-group person-group-type="author">
<name>
<surname>Khalid</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Zilic</surname>
<given-names>Z.</given-names>
</name>
<name>
<surname>Radecka</surname>
<given-names>K.</given-names>
</name>
</person-group> (<year>2004</year>). &#x201c;<article-title>FPGA emulation of quantum circuits</article-title>,&#x201d; in <conf-name>IEEE International Conference on Computer Design: VLSI in Computers and Processors, 2004. ICCD 2004. Proceedings</conf-name> (<publisher-loc>San Jose, CA, USA</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>310</fpage>&#x2013;<lpage>315</lpage>. <pub-id pub-id-type="doi">10.1109/ICCD.2004.1347938</pub-id> </citation>
</ref>
<ref id="B31">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Khalid</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Mujahid</surname>
<given-names>U.</given-names>
</name>
<name>
<surname>Jafri</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Choi</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Muhammad</surname>
<given-names>N.</given-names>
</name>
</person-group> (<year>2021</year>). <article-title>An FPGA-based hardware abstraction of quantum computing systems</article-title>. <source>J. Comput. Electron.</source> <volume>20</volume>, <fpage>2001</fpage>&#x2013;<lpage>2018</lpage>. <pub-id pub-id-type="doi">10.1007/s10825-021-01765-w</pub-id> </citation>
</ref>
<ref id="B32">
<citation citation-type="book">
<comment>[Dataset]</comment> <person-group person-group-type="author">
<name>
<surname>Knudsen</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Mendl</surname>
<given-names>C. B.</given-names>
</name>
</person-group> (<year>2020</year>). <source>Solving differential equations via continuous-variable quantum computers</source>. </citation>
</ref>
<ref id="B33">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lee</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Khalil-Hani</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Marsono</surname>
<given-names>M.</given-names>
</name>
</person-group> (<year>2016</year>). <article-title>An FPGA-based quantum computing emulation framework based on serial-parallel architecture</article-title>. <source>Int. J. Reconfigurable Comput.</source> <volume>18</volume>, <fpage>1</fpage>. <pub-id pub-id-type="doi">10.1155/2016/5718124</pub-id> </citation>
</ref>
<ref id="B34">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lee</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Khalil-Hani</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Marsono</surname>
<given-names>M.</given-names>
</name>
</person-group> (<year>2018</year>). <article-title>Improved quantum circuit modelling based on Heisenberg representation</article-title>. <source>Quantum Inf. process.</source> <volume>17</volume> (<issue>36</issue>), <fpage>36</fpage>&#x2013;<lpage>28</lpage>. <pub-id pub-id-type="doi">10.1007/s11128-017-1806-5</pub-id> </citation>
</ref>
<ref id="B35">
<citation citation-type="book">
<comment>[Dataset]</comment> <person-group person-group-type="author">
<name>
<surname>Leyton</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Osborne</surname>
<given-names>T.</given-names>
</name>
</person-group> (<year>2008</year>). <source>A quantum algorithm to solve nonlinear differential equations</source>. </citation>
</ref>
<ref id="B36">
<citation citation-type="book">
<comment>[Dataset]</comment> <person-group person-group-type="author">
<name>
<surname>Liu</surname>
<given-names>J. P.</given-names>
</name>
<name>
<surname>&#xd8;ie Kolden</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Krovi</surname>
<given-names>H. K.</given-names>
</name>
<name>
<surname>Loureiro</surname>
<given-names>N. F.</given-names>
</name>
<name>
<surname>Trivisa</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Childs</surname>
<given-names>A. M.</given-names>
</name>
</person-group> (<year>2021</year>). <source>Efficient quantum algorithm for dissipative nonlinear differential equations</source>. </citation>
</ref>
<ref id="B37">
<citation citation-type="book">
<comment>[Dataset]</comment> <person-group person-group-type="author">
<name>
<surname>Lloyd</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Palma</surname>
<given-names>G. D.</given-names>
</name>
<name>
<surname>Gokler</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Kiani</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Liu</surname>
<given-names>Z. W.</given-names>
</name>
<name>
<surname>Marvian</surname>
<given-names>M.</given-names>
</name>
<etal/>
</person-group> (<year>2020</year>). <source>Quantum algorithm for nonlinear differential equations</source>. </citation>
</ref>
<ref id="B38">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lu</surname>
<given-names>X.</given-names>
</name>
<name>
<surname>Yuan</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Zhang</surname>
<given-names>W.</given-names>
</name>
</person-group> (<year>2013</year>). <article-title>Workflow of the grover algorithm simulation incorporating cuda and gpgpu</article-title>. <source>Comput. Phys. Commun.</source> <volume>184</volume>, <fpage>2035</fpage>&#x2013;<lpage>2041</lpage>. <pub-id pub-id-type="doi">10.1016/j.cpc.2013.03.017</pub-id> </citation>
</ref>
<ref id="B39">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Ma</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Li</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Zhao</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>Quantum qr decomposition in the computational basis</article-title>. <source>Quantum Inf. process.</source> <volume>19</volume>, <fpage>271</fpage>. <pub-id pub-id-type="doi">10.1007/s11128-020-02777-4</pub-id> </citation>
</ref>
<ref id="B40">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Mahmud</surname>
<given-names>N.</given-names>
</name>
<name>
<surname>El-Araby</surname>
<given-names>E.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Dimension reduction using Quantum Wavelet Transform on a high-performance reconfigurable computer</article-title>. <source>Int. J. Reconfigurable Comput.</source> <volume>2019</volume>, <fpage>1</fpage>. <pub-id pub-id-type="doi">10.1155/2019/1949121</pub-id> </citation>
</ref>
<ref id="B41">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Mahmud</surname>
<given-names>N.</given-names>
</name>
<name>
<surname>Haase-Divine</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Kuhnke</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Rai</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>MacGillivray</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>El-Araby</surname>
<given-names>E.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>Efficient computation techniques and hardware architectures for unitary transformations in support of quantum algorithm emulation</article-title>. <source>J. Signal Process. Syst.</source> <volume>92</volume>, <fpage>1017</fpage>&#x2013;<lpage>1037</lpage>. <pub-id pub-id-type="doi">10.1007/s11265-020-01569-4</pub-id> </citation>
</ref>
<ref id="B42">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Montanaro</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Pallister</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>2016</year>). <article-title>Quantum algorithms and the finite element method</article-title>. <source>Phys. Rev. A</source> <volume>93</volume>, <fpage>032324</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevA.93.032324</pub-id> </citation>
</ref>
<ref id="B43">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Nielsen</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Chuang</surname>
<given-names>I.</given-names>
</name>
</person-group> (<year>2010</year>). <source>Quantum computation and quantum information</source>. <edition>10th Anniversary Edition</edition>. <publisher-loc>Cambridge</publisher-loc>: <publisher-name>Cambridge University Press</publisher-name>. </citation>
</ref>
<ref id="B44">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Pilch</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Dlugopolski</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>An FPGA-based real quantum computer emulator</article-title>. <source>J. Comput. Electron.</source> <volume>18</volume>, <fpage>329</fpage>&#x2013;<lpage>342</lpage>. <pub-id pub-id-type="doi">10.1007/s10825-018-1287-5</pub-id> </citation>
</ref>
<ref id="B45">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Rosenbaum</surname>
<given-names>D.</given-names>
</name>
</person-group> (<year>2010</year>). <article-title>Binary superposed quantum decision diagrams</article-title>. <source>Quantum Inf. process.</source> <volume>9</volume>, <fpage>463</fpage>&#x2013;<lpage>496</lpage>. <pub-id pub-id-type="doi">10.1007/s11128-009-0153-6</pub-id> </citation>
</ref>
<ref id="B46">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Scherer</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Valiron</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Mau</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Alexander</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>van den Berg</surname>
<given-names>E.</given-names>
</name>
<name>
<surname>Chapuran</surname>
<given-names>T.</given-names>
</name>
</person-group> (<year>2017</year>). <article-title>Concrete resource analysis of the quantum linear-system algorithm used to compute the electromagnetic scattering cross section of a 2D target</article-title>. <source>Quantum Inf. process.</source> <volume>16</volume>, <fpage>60</fpage>. <pub-id pub-id-type="doi">10.1007/s11128-016-1495-5</pub-id> </citation>
</ref>
<ref id="B47">
<citation citation-type="confproc">
<person-group person-group-type="author">
<name>
<surname>Segal</surname>
<given-names>O.</given-names>
</name>
<name>
<surname>Nasiri</surname>
<given-names>N.</given-names>
</name>
<name>
<surname>Margala</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Vanderbauwhede</surname>
<given-names>W.</given-names>
</name>
</person-group> (<year>2014</year>). &#x201c;<article-title>High level programming of fpgas for hpc and data centric applications</article-title>,&#x201d; in <conf-name>2014 IEEE High Performance Extreme Computing Conference (HPEC)</conf-name> (<publisher-name>IEEE</publisher-name>), <fpage>1</fpage>&#x2013;<lpage>3</lpage>. </citation>
</ref>
<ref id="B48">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Steijl</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Barakos</surname>
<given-names>G.</given-names>
</name>
</person-group> (<year>2018</year>). <article-title>Parallel evaluation of quantum algorithms for computational fluid dynamics</article-title>. <source>Comput. Fluids</source> <volume>173</volume>, <fpage>22</fpage>&#x2013;<lpage>28</lpage>. <pub-id pub-id-type="doi">10.1016/j.compfluid.2018.03.080</pub-id> </citation>
</ref>
<ref id="B49">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Tabakin</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Julia-Diaz</surname>
<given-names>B.</given-names>
</name>
</person-group> (<year>2009</year>). <article-title>Qcmpi: A parallel environment for quantum computing</article-title>. <source>Comput. Phys. Commun.</source> <volume>180</volume>, <fpage>948</fpage>&#x2013;<lpage>964</lpage>. <pub-id pub-id-type="doi">10.1016/j.cpc.2008.11.021</pub-id> </citation>
</ref>
<ref id="B50">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Todorova</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Steijl</surname>
<given-names>R.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>Quantum algorithm for the collisionless Boltzmann equation</article-title>. <source>J. Comput. Phys.</source> <volume>409</volume>, <fpage>109347</fpage>. <pub-id pub-id-type="doi">10.1016/j.jcp.2020.109347</pub-id> </citation>
</ref>
<ref id="B51">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Viamontes</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Markov</surname>
<given-names>I.</given-names>
</name>
<name>
<surname>Hayes</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>2003</year>). <article-title>Improving gate-level simulation of quantum circuits</article-title>. <source>Quantum Inf. process.</source> <volume>2</volume>, <fpage>347</fpage>&#x2013;<lpage>380</lpage>. <pub-id pub-id-type="doi">10.1023/b:qinp.0000022725.70000.4a</pub-id> </citation>
</ref>
<ref id="B52">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Xu</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Daley</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Givi</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Somma</surname>
<given-names>R.</given-names>
</name>
</person-group> (<year>2018</year>). <article-title>Turbulent mixing simulation via a quantum algorithm</article-title>. <source>AIAA J.</source> <volume>56</volume>, <fpage>687</fpage>&#x2013;<lpage>699</lpage>. <pub-id pub-id-type="doi">10.2514/1.J055896</pub-id> </citation>
</ref>
<ref id="B53">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Xue</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Wu</surname>
<given-names>Y.-C.</given-names>
</name>
<name>
<surname>Guo</surname>
<given-names>G.-P.</given-names>
</name>
</person-group> (<year>2021</year>). <article-title>Quantum homotopy perturbation method for nonlinear dissipative ordinary differential equations</article-title>. <source>New J. Phys.</source> <volume>23</volume>, <fpage>123035</fpage>. <pub-id pub-id-type="doi">10.1088/1367-2630/ac3eff</pub-id> </citation>
</ref>
<ref id="B54">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Yepez</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>2001</year>). <article-title>Quantum lattice-gas model for computational fluid dynamics</article-title>. <source>Phys. Rev. E</source> <volume>63</volume>, <fpage>046702</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevE.63.046702</pub-id> </citation>
</ref>
<ref id="B55">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Zhou</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Loke</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Izaac</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Wang</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>2017</year>). <article-title>Quantum fourier transform in computational basis</article-title>. <source>Quantum Inf. process.</source> <volume>16</volume>, <fpage>82</fpage>. <pub-id pub-id-type="doi">10.1007/s11128-017-1515-0</pub-id> </citation>
</ref>
</ref-list>
</back>
</article>