∣*ieb*2∣*ieb*1∣*ieb*0∣*imb*1∣*imb*0∣*a*0∣*imp*5∣ … ∣*imp*0∣*ier*2∣*ier*1∣*ier*0∣*imr*1∣*imr*0∣*icut*∣*isub*i (9)

where ∣*ieb*2∣*ieb*1∣*ieb*0i and ∣*imb*1∣*imb*0i define the exponent and the fractional part of the mantissa of the input, respectively. Qubits ∣*icut*i and ∣*isub*i are initialized as ∣1i, while all other qubits are initialized as ∣0i. The quantum state in the simulation is then initialized with a single non-zero (unit) amplitude, with the index in the quantum state vector defined by the binary representation of input exponent and fractional part of mantissa. With the rounding mode fixed at rounding down to nearest, the intended output can be easily computed before the quantum circuit is simulated. In effect, this defines the index of the single non-zero (unit) amplitude of the output quantum state that should be returned in case the circuit is correct. Upon finalizing the quantum computer simulation the actual quantum state vector obtained is compared against the previously-computed required output. For this verification to be meaningful, the following range of possible inputs and outputs


**Table 3.** *Results from quantum circuit simulation for representative range of inputs (squaring NM* ¼ 3*, NE* ¼ 3*).*

#### *Quantum Computing and Communications*

were considered: (i) input and output are both normalized numbers, (ii) input is normalized number and output is a sub-normal number, (iii) input is a sub-normal number and result truncated to 0, (iv) input is a normalized number, with output overflow. For *NM* ¼ 3 and *NE* ¼ 3, **Table 3** summarizes the input and output states for examples of each of the 4 categories considered. For inital and output the single non-zero amplitudes are shown. Since the simulator employed here stores the full 2*nq* state vector for *nq* qubits, only circuits with ≤28 qubits were considered as a result of limited computational resources and the large number of cases considered (>100). For the squaring operation, *NM* ∈½ � 3, 6 and *NE* ∈½ � 3, 4 were considered, while for multiplication the range of *NM* needed to be reduced, i.e. *NM* ∈½ � 3, 4 .


#### **Table 4.**

*Approximation errors in Taylor-green vortex flow field due to reduced-precision floating-point representation. L*<sup>∞</sup> *and L*<sup>2</sup> *norms of errors relative to IEEE double-precision representation for velocity (u) and pressure (p) for different NM and NE.* 100 � 100 *uniform mesh.*

*Quantum Algorithms for Nonlinear Equations in Fluid Mechanics DOI: http://dx.doi.org/10.5772/intechopen.95023*
