---
title: Effective 24-Qubit Calculation
url: https://www.emergentmind.com/topics/effective-24-qubit-calculation
type: topic
---

# Effective 24-Qubit Calculation

Effective 24 qubit calculations employ semi-boolean polynomial (SBP) encoding to realize compact, high-performance, ancilla-free arithmetic circuits for unsigned integers, signed integers, and floating-point representations. These constructions optimize resource usage and circuit depth, enabling practical modular arithmetic and constant multiplication in the 24-qubit regime, as presented in the SBP formalism of "Efficient Floating Point Arithmetic for Quantum Computers" [2112.10537]. The following exposition details the encoding principles, constant multiplication workflow, signed and floating-point extensions, resource breakdown for the 24-qubit case, and trade-offs in circuit realization.

## 1. Semi-Boolean Polynomial Encoding for Modular Arithmetic

Arithmetic over the ring $\mathbb{Z}/2^m\mathbb{Z}$ can be reformulated as the evaluation of semi-boolean polynomials, in which any $m$-qubit state $\lvert y \rangle$ is prepared in the Fourier basis by $H^{\otimes m}\lvert 0 \rangle = (1/\sqrt{2^m})\sum_{k=0}^{2^m-1}\lvert k\rangle$. The SBP construction makes use of the diagonal $G$-gate:
$$
U_G(y) = \bigotimes_{i=0}^{m-1} P_i(2\pi y 2^i / 2^m),
$$
which imparts a phase $e^{2\pi i y k/2^m}$ on computational basis state $\lvert k \rangle$. Applying an inverse quantum Fourier transform (QFT$^\dagger$) yields $\lvert y \bmod 2^m \rangle$. 

A semi-boolean monomial for input vector $x = (x_0, \ldots, x_{n-1})$ has the form $a \cdot \prod_j x_{b_j}$, for $a \in \mathbb{Z}$. The entire polynomial $\Omega(x)$, comprising a sum over such monomials, is encoded by sequentially applying $U_G$ gates controlled by the necessary $x_{b_{ij}}$ combinations, which are then fused through the additive property:
$$
U_{sbp}(\Omega) = QFT^\dagger \cdot \prod_i U_G(a_i \prod_j x_{b_{ij}}) \cdot H^{\otimes m}.
$$
Thus, $\lvert x \rangle \lvert 0 \rangle \mapsto \lvert x \rangle \lvert \Omega(x) \bmod 2^m \rangle$ after the SBP circuit.

## 2. Ancilla-Free In-Place Multiplication by Classical Constants

To multiply an $n$-qubit register $\lvert x \rangle$ by an odd classical constant $a$ (mod $2^n$), one uses the property that such $a$ are invertible modulo $2^n$, making the mapping reversible:
$$
\lvert x \rangle \mapsto \lvert (a x) \bmod 2^n \rangle.
$$
The procedure is QFT-based:
1. Apply QFT on all $n$ qubits.
2. Replace every controlled-phase (CP) gate's angle $\varphi$ in the QFT with $a\varphi$ (the "phase-cascade").
3. Apply QFT$^\dagger$.

The explicit QFT decomposition is:
$$
QFT\ \lvert x \rangle = \bigotimes_{l=0}^{n-1} H_l \cdot \prod_{k<l} CP_{k \rightarrow l}\left(2\pi 2^k / 2^{l+1}\right) \lvert x \rangle,
$$
modified for multiplication by $a$ as $CP(\varphi) \mapsto CP(a\varphi)$, with the Hadamard gates unaffected due to $a \equiv 1 \bmod 2$. The ancilla-free method requires only the $n$ main qubits.

Resource analysis:
- Qubits: $n$
- H-gates: $2n$
- CP-gates: $3n(n-1)/2$
- Depth: $\approx 3n$

## 3. Extensions: Signed-Integer and Floating-Point Representations

### a) Signed-Integer Encoding

Signed $n$-bit integers $x \in [-2^n, 2^n - 1]$ are encoded via the two's-complement ring isomorphism as $[x]_n := x \bmod 2^{n+1}$. Thus, modular operations (addition, subtraction, multiplication) mod $2^{n+1}$ directly implement signed arithmetic. The SBP circuit extends to $m = n + 1$ qubits for full coverage of the signed range.

### b) IEEE-Style Mono-Quantum Floating-Point

Floating-point numbers of the form $x = \pm 2^k \underline{x}$ are decomposed as follows:
- **Sign**: $s \in \{0,1\}$, encoded in a single qubit.
- **Exponent**: $k \in \mathbb{Z}$, kept classical.
- **Mantissa**: $\underline{x} \in [-2^n, 2^n-1]$, in $n$ signed qubits.

Arithmetic on floating-point numbers reduces to SBP-encoded operations on the mantissas, with exponent tracking managed classically. e.g., to add $x = 2^{k_1} \underline{x}$ and $y = 2^{k_2} \underline{y}$, select an output exponent $k_0 \leq \min(k_1, k_2)$, then:
$$
U_{add}^{k_0} \lvert \underline{x} \rangle \lvert \underline{y} \rangle \lvert 0 \rangle 
= \lvert \underline{x} \rangle \lvert \underline{y} \rangle \lvert [2^{-k_0}(2^{k_1}\underline{x} + 2^{k_2}\underline{y})]_{n+1} \rangle.
$$

## 4. Explicit 24-Qubit Circuit Example: Ancilla-Free In-Place Multiplication

A concrete instantiation uses all 24 qubits to store an unsigned integer $\lvert x_0 \ldots x_{23} \rangle$ and multiplies by $a = 7$ (mod $2^{24}$):
$$
\lvert x \rangle \xrightarrow{\mathrm{QFT}_{24}} \text{phase-cascade}(a=7) \xrightarrow{\mathrm{QFT}_{24}^{-1}} 
\lvert 7x \bmod 2^{24} \rangle
$$

Resource count for $n=24$:
| Resource        | Value  |
|-----------------|--------|
| Qubits          | 24     |
| H-gates         | 48     |
| CP-gates        | 828    |
| Total gates     | 876    |
| Circuit depth   | ≈72    |

- CP count: $3n(n-1)/2 = 828$
- Depth: $3n = 72$ time-steps (each step: at most one H or CP per qubit)
- No ancillas are required.

## 5. Depth vs. Ancilla Trade-Offs and Performance Considerations

- **Depth vs. Ancilla**: The "ancilla-free" construction uses $n=24$ main qubits and achieves depth $\sim3n$. With even 4 extra qubits, certain computations (e.g., multi-controlled monomials) could be isolated into ancillas, enabling CP gate parallelization and reducing depth by up to $2\times$.
- **SWAP Elimination**: Use of the reverse-QFT trick removes the need for end SWAP operations.
- **Monomial Ordering**: In general SBP encoding, monomial sequencing and CP gate scheduling can enable further parallelism if ancillas are present. Constant multiplication requires only the standard QFT order.
- **Phase Resolution**: For $n=24$, the minimum CP angle is $2\pi/2^{24} \approx 3.7 \times 10^{-7}$ rad; feasible implementation requires hardware phase error $\gtrsim 10^{-7}$ rad.
- **GMS Gates**: On ion-trap architectures where native XX gates are available, all 828 CP gates can be replaced with as few as 24 global Mølmer–Sørensen (GMS) pulses, reducing two-qubit depth from $O(n^2)$ to $O(n)$.

## 6. Application Scope and Integration with Higher-Level Quantum Arithmetic

Any odd constant $a < 2^{24}$ can be embedded via the same phase-cascade construction, yielding a generic, compact 24-qubit multiplier. Integration with signed and mono-quantum floating-point representations is immediate: reinterpret the 24 qubits as two's-complement mantissas, and manage the exponent classically. This allows seamless extension to quantum algorithms requiring mixed integer and floating-point arithmetic, maintaining circuit depth at the 24-qubit level for in-place modular multiplication, regardless of signedness or floating-point encoding [2112.10537].

Source: https://www.emergentmind.com/topics/effective-24-qubit-calculation