# Quantum Circuit Implementation of Multi-Dimensional Non-Linear Lattice Models
## 4 Quantum-Circuit Implementation of Modified D1Q3 Lbm  
In previous work by the author [12], the quantum-circuit implementation of the modified D1Q3 model was analyzed in detail. In that work, a design aimed at minimizing the quantum-circuit width was used, while the main focus of that work was the evaluation and simulation of the circuit using a quantum computing simulator with machine acceleration. In contrast, the design for the modified D1Q3 considered here employs a small number of additional qubits but benefits from a significantly reduced circuit depth. This design trade-off can be summarized as follows:  
* The design considered previously [12] ('Design 1') converts the output of the squaring of the \(u\)-velocity mantissa (temporarily) in quantum floating-point format, using \(N_{M}-1+N_{E}\) qubits (with 'hidden-qubit' approach);
* In the current design ('Design2'), the output of the squaring of the \(u\)-velocity mantissa defined by \(2N_{M}\) qubits is maintained for use in successive steps of the quantum circuit;
* Design 1 requires the squaring and un-computation of squaring to be performed twice, in contrast to Design 2, that only involves a single squaring operation of the \(u\)-velocity mantissa. The \(2N_{M}\) qubits defining the squaring are returned to their initial state by a single un-computation of the squaring operation. A detailed complexity analysis in terms of qubits required shows that although the difference between \(N_{M}-1+N_{E}\) (for Design 1) and \(2N_{M}\) (for Design 2) is needed to store the result of the squared \(u\)-velocity, mantissa appears to grow as \(N_{M}-N_{E}\), and therefore, favors Design 1 for small \(N_{E}\) and increasing \(N_{M}\). However, Design 1 also needs a sufficient workspace to perform \(u\)-velocity squaring, such that for \(N_{M}=4\) and \(N_{E}=3\), the difference is reduced to a single-qubit advantage for Design 1. The significant reduction in gate operations needed for un-computation for Design 2 motivates the use of this design approach here. The approach used in Design 2 is also employed for the non-linear lattice model for the one-dimensional Burgers equation in the next section. Figure 2: Step-by-step specialization of the 2-qubit full adder. The example shown adds \(|a1|a0\rangle=|10\rangle\) into 3-qubit register \(|r2|r1|r0\rangle\). In the quantum-circuit implementation, the following qubits are used for \(N_{M}=4\) and \(N_{E}=3\):  
\[|dv1|dv0\rangle : \text{two qubits defining the index of discrete velocity}\] \[|eu2|eu1|eu0\rangle : N_{E}\text{-bit representation of the exponent of }u\] \[|su\rangle : \text{sign bit for $u$-velocity}\text{--here a positive value is assumed}\] \[|mu2|mu1|mu0\rangle : (N_{M}-1)\text{-qbit representation of mantissa of }u\] \[|eg2|eg1|eg0\rangle : N_{E}\text{-qbit representation of the exponent of }g^{eq}\] \[|sg\rangle : \text{sign bit for the considered component of }g^{eq}\] \[|mg2|mg1|mg0\rangle : (N_{M}-1)\text{-qbit representation of the mantissa of }g^{eq}\] \[|cut\rangle : \text{qubit-defining truncation to 0 if in state }|1\rangle\]  
Furthermore, additional qubits ('workspace') are required to perform calculation:  
\[|r7|r8|\dots|r1|r0\rangle : 2N_{M}\text{ qubits to store the squared }u\text{ mantissa}\] \[|dv1|dv0\rangle : \text{two qubits defining the index of discrete velocity}\]0 \[|dv1|dv0\rangle : \text{two qubits defining the index of discrete velocity}\]1 \[|dv1|dv0\rangle : \text{two qubits defining the index of discrete velocity}\]2 \[|dv1|dv0\rangle : \text{two qubits defining the index of discrete velocity}\]3  
Starting from the left-hand side of Figure 3, the steps shown can be summarized as follows:  
* Qubit \(|cut\rangle\) initialized at \(|0\rangle\) is set to \(|1\rangle\) in case \(u^{2}\) gets truncated to 0.