Abstract \noindent Efficient quantum arithmetic operations are essential building blocks for complex quantum algorithms, yet few theoretical designs have been implemented in practical quantum programming frameworks. This paper presents the first complete implementation of the T-count optimized non-restoring quantum square root algorithm using the Qrisp quantum programming framework. The algorithm offers better resource efficiency compared to alternative methods, achieving reduced T-count and qubit requirements while avoiding garbage output. Our implementation validates the theoretical resource estimates, confirming a T-count of $14n-14$ and a T-depth of $5n+3$ for $n$-bit inputs. The modular design approach enabled by Qrisp allows the construction of reusable components, including reversible adders, subtractors, and conditional logic blocks built from fundamental quantum gates. The three-stage algorithm, comprising initial subtraction, iterative conditional addition/subtraction, and remainder restoration, is successfully translated from algorithmic description to executable quantum code. Experimental validation across multiple test cases confirms the correctness, with the circuit producing accurate integer square roots and remainders. This work demonstrates the practical realizability of resource-optimized quantum arithmetic algorithms and establishes a foundation for implementing different arithmetic operations in modern quantum programming frameworks.
Abstract \noindent Efficient quantum arithmetic operations are essential building blocks for complex quantum algorithms, yet few theoretical designs have been implemented in practical quantum programming frameworks. This paper presents the first complete implementation of the T-count optimized non-restoring quantum square root algorithm using the Qrisp quantum programming framework. The algorithm offers better resource efficiency compared to alternative methods, achieving reduced T-count and qubit requirements while avoiding garbage output. Our implementation validates the theoretical resource estimates, confirming a T-count of 14n−14 and a T-depth of 5n+3 for n-bit inputs. The modular design approach enabled by Qrisp allows the construction of reusable components, including reversible adders, subtractors, and conditional logic blocks built from fundamental quantum gates. The three-stage algorithm, comprising initial subtraction, iterative conditional addition/subtraction, and remainder restoration, is successfully translated from algorithmic description to executable quantum code. Experimental validation across multiple test cases confirms the correctness, with the circuit producing accurate integer square roots and remainders. This work demonstrates the practical realizability of resource-optimized quantum arithmetic algorithms and establishes a foundation for implementing different arithmetic operations in modern quantum programming frameworks.
Efficient quantum arithmetic is a prerequisite for the practical realization of large-scale quantum algorithms, yet many resource-optimized designs remain at the theoretical level. In this work, we present a complete implementation of the T-count-optimized non-restoring quantum square-root circuit proposed by Muñoz-Coreas E. and Thapliyal H. in the Qrisp quantum programming framework. The implemented design follows the garbageless square-root construction based on reversible arithmetic and is built from modular sub-circuits, including reversible adders, subtractors, controlled add/subtract blocks, and controlled adders. We show that the high-level abstractions provided by Qrisp enable a direct and reusable realization of the algorithm while preserving the theoretical resource advantages of the original circuit. To assess practical feasibility, the circuits were additionally executed on IBM’s ibm_marrakesh superconducting quantum processor. The experimental results show that the algorithm can run on contemporary NISQ hardware for small input sizes, although compilation overhead, two-qubit gate errors, readout errors, and relaxation effects significantly reduce success rates as the circuit size increases. Among the tested runtime techniques, dynamical decoupling provided only limited improvement. These results establish the practical realizability of a resource-efficient quantum square-root circuit and provide insight into the challenges of executing arithmetic-heavy quantum algorithms on present-day hardware. These results demonstrate that the previously proposed T-count-optimized non-restoring square-root circuit can be realized as a modular Qrisp implementation, exported to Qiskit, and experimentally evaluated on contemporary NISQ hardware, while also highlighting the practical limitations imposed by compilation overhead and hardware noise.
Quantum square root operation is a useful building block in implementing important quantum algorithms such as the Harrow–Hassidim–Lloyd (HHL) algorithm, algorithms in physics and quantum chemistry, and also used in computing roots of quadratic equation, evaluating quadratic congruence, solving Hamiltonian and Poisson equations, trigonometric functions, computing logarithm and fractional exponent, and in quantum chemistry [1]–[5]. Quantum circuits could be made fault-tolerant by using error correcting codes and fault-tolerant quantum gates (such as the Clifford + T-gates). However, The T-gates are expensive to implement than other fault-tolerant gates (such as Clifford+T gates) [6] [7]. Therefore, quantum circuits with low T-count and qubit cost is preferred. In this paper, we present a novel quantum square root architecture optimized for T-count and Qubit cost that produces no garbage outputs. The proposed square root circuit accepts integer and fractional inputs. We use the Babylonian method to calculate the square root. To reduce the number of iteration, the initial guess required in the Babylonian method is calculated from the integer square root circuit in [8] which reduces the cost measures. To further save the cost, we use the resource efficient non-restoring division circuit shown in [9] and quantum adder shown in [6]. The proposed quantum square root circuit sees an asymptotic reduction of 95.84% in T-count and 88.89% in Qubit cost with respect to Bhaskar et al. [1]. With respect to Dutta et al. [10] the design sees an asymptotic reduction of 96% in T-count, and 88.89% in Qubit cost.
Quantum computing represents a paradigm shift in computation by leveraging the principles of quantum mechanics such as superposition, entanglement, and interference to perform operations beyond classical limitations. Unlike classical computing systems that rely on irreversible logic operations and suffer from energy dissipation due to information loss, quantum systems utilize reversible unitary transformations that preserve information and improve computational efficiency. This paper presents a comprehensive framework for the design, simulation, and validation of quantum gates and reversible arithmetic circuits, including half adders and half subtractors. The proposed approach systematically maps classical arithmetic logic into quantum circuits using fundamental quantum gates such as Pauli-X, Hadamard, Controlled-NOT (CNOT), and Toffoli gates. The circuits are implemented and simulated using the Qiskit Aer framework, enabling detailed analysis of quantum state evolution and measurement outputs. The results obtained from simulation include program-level outputs, state vector representations, measurement counts, and probability distributions, all of which demonstrate strong agreement with classical truth tables. The analysis confirms the correctness, reversibility, and scalability of the proposed designs. Furthermore, a comparative performance evaluation highlights the advantages of quantum computing over classical approaches in terms of parallelism and energy efficiency. The proposed framework establishes a robust foundation for future implementation of complex Boolean logic and arithmetic operations in quantum systems.
The Quantum Leading-Zero/One Counter (QLZOC) is a fundamental component in quantum arithmetic, playing a critical role in normalization, floating-point units, dynamic range scaling, and logarithmic approximations. Conventional designs primarily rely on direct Boolean-to-quantum mapping, which results in inefficient resource utilization such as irregular gate growth and width-dependent resource overhead. In this work, we propose a scalable, modular, and resource efficient architecture for QLZOC by reformulating the counting process into a sequence of systematic conditional bit-flip operations. Moreover, our design achieves functional polymorphism so that the same design can be easily toggled between zero and one detection, while ensuring seamless scalability to any bit-width without manual re-tuning. We further introduce a Parallel QLZOC (PQLZOC) variant and a Fan-Out optimized (FO-PQLZOC) design. In this work, we evaluate resource efficiency based on the classic criteria about T gates, including the number of total T gates being used (T-count) and the number of sequential T gate layers (T-depth). By exploiting the properties of all-zero/one qubit blocks and a hierarchical merge strategy, the proposed FO-PQLZOC reduces the T-depth from O(m) to O(log m), where m is the input size. Comparative analysis demonstrates that our optimized architecture achieves a 40% reduction in T-count and a 60% reduction in T-depth over state-of-the-art designs, providing a high-performance, T-gate efficient solution for general-purpose quantum arithmetic processors.
Abstract This paper presents a reversible, n‑bit Quantum Arithmetic Logic Unit (QALU) implemented in Qiskit that supports a classical ALU‑like instruction set: ADD, SUB, CMP, AND/OR/XOR and their negations, unary NOT, shifts and rotates, and operand passthrough. The QALU outputs a result register and status flags N, Z, C, V (negative, zero, carry/no‑borrow, signed overflow) and emits explicit comparison outputs EQ, LT u , LT s . The design is modular and operation‑selectable at compile time, enabling clean verification and resource accounting. To evaluate fault‑tolerant efficiency, the circuits are decomposed into a Clifford + T basis and measure T‑count alongside CX‑count and depth. Exhaustive verification on Aer (matrix‑product‑state simulation) confirms correctness for all input pairs for n = 4 across 16 operations. Hardware experiments on IBM Quantum (limited to n = 2) demonstrate end‑to‑end execution with dynamical decoupling and gate twirling, and readout mitigation via mthree. An analytical scaling discussion grounded in ripple‑carry adder theory and known Toffoli/T‑gate constructions is further provided. These results show that a practical, verifiable QALU with flags and compare can be implemented within Qiskit while exposing meaningful fault‑tolerant metrics and hardware‑realistic performance characterization. Key findings from the provided implementation artifacts: (1) Aer exhaustive verification (n = 4): the QALU was exhaustively tested over all 2 2n =256 input pairs for each of 16 operations (4096 total tests), with 0 mismatches against a classical reference model. (2) Resource metrics (n = 4): after transpilation to a Clifford + T‑style basis {cx, h, s, sdg, x, z, t, tdg} at optimization level 3, the highest‑cost operations (ADD, SUB, CMP) report T‑count = 86, CX‑count ≈ 102–106, and depth ≈ 138 on a 24‑qubit circuit instance (including flags and MCX ancillae). (3) IBM hardware test (n = 2): on an automatically selected IBM backend (ibm_torino) using dynamical decoupling and gate twirling plus mthree readout mitigation, an exhaustive run over all 256 circuits yielded raw correctness 91.41% and mitigated correctness 91.02% (slightly worse post‑mitigation, consistent with practical tradeoffs where mitigation noise/calibration drift can dominate at small sizes).
Quantum computing has advanced rapidly in recent decades, driven by developments across the technology stack, including quantum error-correcting codes and efficient quantum algorithms. Among these, quantum arithmetic circuits serve as fundamental building blocks for various promising algorithms. Despite their crucial role, the design of quantum arithmetic circuits faces challenges arising from the no-cloning theorem, qubit limitations, and circuit depth constraints, which significantly impact the efficiency of large-scale quantum computing. We provide an overview of quantum arithmetic circuits in the context of public-key cryptanalysis, with particular emphasis on optimization strategies such as measurement-based uncomputation and conditionally clean ancilla. We review state-of-the-art designs for essential arithmetic operations in public-key cryptanalysis such as addition, multiplication, and modular exponentiation. We also present an overview of the techniques used for fault-tolerant runtime and resource estimation in quantum cryptanalysis. In brief, this chapter emphasizes strategies for designing resource-efficient quantum arithmetic circuits, providing a basis for realistic evaluations of quantum cryptanalytic capabilities.