🤖 AI Summary
This work addresses the safe reuse of *dirty qubits*—qubits initialized in arbitrary, possibly entangled states—in quantum programs. To enable resource-efficient quantum computation without requiring clean ancillae, we propose a *safe uncomputation* mechanism that guarantees full restoration of the initial (potentially entangled) state. We introduce, for the first time in a quantum programming language, a formal semantics for dirty-qubit borrowing, grounded in quantum circuit structure and unitary evolution constraints. Building on formal semantic modeling, quantum circuit analysis, and automated verification techniques, we design a decidable algorithm to rigorously determine whether safe dirty-qubit reuse is feasible for any given circuit. Experimental evaluation on canonical algorithms—including Shor’s and Grover’s—demonstrates concrete safe reuse schemes, yielding significant improvements in qubit resource efficiency. Our approach provides both theoretical foundations and practical tools for near-term, fault-ignorant quantum programming.
📝 Abstract
Dirty qubits are ancillary qubits that can be borrowed from idle parts of a computation, enabling qubit reuse and reducing the demand for fresh, clean qubits-a resource that is typically scarce in practice. For such reuse to be valid, the initial states of the dirty qubits must not affect the functionality of the quantum circuits in which they are employed. Moreover, their original states, including any entanglement they possess, must be fully restored after use-a requirement commonly known as safe uncomputation. In this paper, we formally define the semantics of dirty-qubit borrowing as a feature in quantum programming languages, and introduce a notion of safe uncomputation for dirty qubits in quantum programs. We also present an efficient algorithm, along with experimental results, for verifying safe uncomputation of dirty qubits in certain quantum circuits.