Abstract

In this paper, we propose quantum circuits for runtime assertions, which can be used for both software debugging and error detection. Runtime assertion is challenging in quantum computing for two key reasons. First, a quantum bit (qubit) cannot be copied, which is known as the non-cloning theorem. Second, when a qubit is measured, its superposition state collapses into a classical state, losing the inherent parallel information. In this paper, we overcome these challenges with runtime computation through ancilla qubits, which are used to indirectly collect the information of the qubits of interest. We design quantum circuits to assert classical states, entanglement, and superposition states.

Highlights

  • Quantum computing features unique advantages over classical computing and recent advances in quantum computer hardware raise high hopes to realize the remarkable potential of quantum computing

  • The second is that any measurement on a qubit in a superposition state will project it into a classical state1

  • A qubit can be in a superposition state, which is a linear combination of classical states, i.e., |ψ⟩ = a|0⟩+b|1⟩, where both a and b are complex number and |a|2+|b|2=1

Read more

Summary

INTRODUCTION

Quantum computing features unique advantages over classical computing and recent advances in quantum computer hardware raise high hopes to realize the remarkable potential of quantum computing. In a recent work by Huang et al [3], statistical assertions, meaning statistical anaylsis on multiple measurement results, are proposed to debug quantum programs. We propose quantum circuits to overcome this limitation and to enable dynamic assertions for quantum programs. Our proposed quantum circuits for dynamic assertions are inspired from quantum error correction. As qubits cannot be copied and cannot be measured directly, our approach for dynamic assertions is to indirectly verify the desired condition to be checked. According to the previous work by Huang et al [3], three types of possible assertions are essential for debugging quantum programs: classical assertions, superposition assertions, and entanglement assertions. Besides proving the correctness of our proposed designs, we verify them on a quantum simulator and employ them on an actual quantum computer, IBM Q

AND RELATED WORK
QUANTUM CIRCUITS FOR DYNAMIC ASSERTIONS
Dynamic Assertion for Classical Values
Dynamic Assertion for Entanglement
EXPERIMENTS
Classical Assertions
Superposition Assertions
Entanglement Assertions
Findings
CONCLUSIONS
Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.