,
Francesco Pio Marino
,
Gabriele Messina
Creative Commons Attribution 4.0 International license
Classical computers are powerful but fundamentally mundane: they operate through explicit, step-by-step instructions that force programmers to think locally and procedurally. Quantum technologies, by contrast, resemble magical instruments, capable of acting on superpositions, correlations, and entire collections of states at once. Yet, despite their magical nature, quantum computers are still programmed as if they were ordinary machines, relying on long sequences of low-level operations that obscure the underlying algorithmic ideas. Magic, however, is not performed by improvisation alone: it requires a spellbook. In this paper we position Qutes as a book of spells for quantum programmers, providing high-level commands that capture complex quantum behaviour behind concise and expressive syntax. We focus on the manipulation of quantum arrays, which naturally arise in many algorithms but are notoriously cumbersome to manage at the circuit level. We introduce three new array-oriented spells in Qutes: global initialization, parallel pairwise comparison, and parallel (optionally controlled) swap. Individually, these spells encapsulate non-trivial quantum procedures; when combined, they enable programmers to express algorithms in a way that is immediate, readable, and surprisingly elegant. As a final demonstration, we show how these spells can be assembled to produce a remarkably compact implementation of Bubble Sort. While algorithmically simple, this example illustrates a broader message: when the right abstractions are available, quantum programming can feel less like engineering machinery and more like magic.
@InProceedings{faro_et_al:LIPIcs.FUN.2026.15,
author = {Faro, Simone and Marino, Francesco Pio and Messina, Gabriele},
title = {{Spells for Quantum Programmers: Expressive High-Level Commands in Qutes}},
booktitle = {13th International Conference on Fun with Algorithms (FUN 2026)},
pages = {15:1--15:20},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-417-8},
ISSN = {1868-8969},
year = {2026},
volume = {366},
editor = {Iacono, John},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.FUN.2026.15},
URN = {urn:nbn:de:0030-drops-257349},
doi = {10.4230/LIPIcs.FUN.2026.15},
annote = {Keywords: Quantum programming languages, High-level abstractions, Quantum arrays}
}