Extended Quantum Computing Patterns
Quantum Application Testing
Aliases: –
Tags:
© M. Beisel, J. Barzen, F. Leymann, and B. Weder, Operations Patterns for Hybrid Quantum Applications, in Proceedings of the 15th International Conference on Cloud Computing and Services Science (CLOSER). SciTePress, 2025.
Intent
How to ensure the correctness of all functionalities of a hybrid quantum application?
Context
Hybrid quantum applications are realized using a plethora of different artifacts, such as quantum circuits, classical programs, deployment models, and control and data flow specifications Weder et al.,2021b. The correctness of the functionality of all artifacts as well as their interactions must be ensured.
Forces
Quantum applications comprise heterogeneous programs, e.g., using different programming languages and data formats. The execution of quantum circuits is probabilistic and arbitrary unknown quantum states can not be copied, hence, obtaining information about a qubit without disturbing the corresponding quantum system state is impossible [Ali et al., 2021], [Buzek and Hillery, 1996]. Further, simulating the execution of larger quantum circuits is impossible due to the exponential resources required for simulating additional qubits [Zhou et al., 2020]. The changing characteristics of quantum devices may lead to different results when executing the same quantum circuit at different times, even when using the same quantum devices [Tannu and Qureshi, 2019)].
Solution
Utilize a holistic testing strategy comprising the following steps as depicted in Figure 5: (i) Unit tests for the classical programs. (ii) Specific tests for the quantum circuits. This includes mathematical verification of quantum circuits [Chareton et al., 2021], [Wang et al., 2008], adding and evaluating assertations to ensure certain states [Huang and Martonosi, 2019], [Liu et al., 2020], as well as white and black box tests for quantum circuits [Miranskyy et al., 2020]. (iii) Deployment tests verifying that the application was provisioned as intended (Wurster et al., 2018). (iv) Integration tests validating the interplay of the various software artifacts [Wu et al., 2003].
Result
By testing all artifacts of a quantum application, as well as their interplay and execution environment, the reliability of the quantum application is significantly increased. Well-tested artifacts of hybrid applications promote their reuse for other applications ([Weder et al., 2022], [Zhao, 2020]. To automate the testing procedure it may be integrated, e.g., into the application’s continuous integration and development (CI/CD) pipeline [Romero- Alvarez et al., 2024].
Examples
–
Related Patterns
The correct functionality of hybrid quantum applications also depends on hardware characteristics and the current calibration of quantum devices. To select a suitable quantum device for testing the quantum application, the Quantum Hardware Selection pattern can be utilized. The Quantum Application Archive pattern can include test specifications enabling integration and deployment tests in the target environment. Due to the increased complexity when integrating quantum and classical programs, each Classical-Quantum Interface [Bühler et al., 2023] should be tested.
Known Uses
Different lifecycles for hybrid quantum applications include a dedicated testing phase focussing on the quantum-specific as well as integration aspects Gheorghe-Pop et al.; [Weder et al., 2022], [Zhao, 2020]. Becker et al., 2023 introduce a testing pipeline for hybrid quantum applications that includes tests for classical programs as well as quantum circuits. Romero- Alvarez et al., 2024 present a concept to integrate hybrid quantum applications into CI/CD pipelines. They enable the automated testing and deployment of hybrid quantum applications including the classical programs and quantum circuits.