Skip to main content
QUICK REVIEW

[Paper Review] Alternation in Quantum Programming: From Superposition of Data to Superposition of Programs

Mingsheng Ying, Nengkun Yu|arXiv (Cornell University)|Feb 20, 2014
Quantum Computing Algorithms and ArchitectureComputer Science40 references10 citations
TL;DR

This paper introduces a novel quantum programming paradigm—superposition of programs—by generalizing classical alternation to the quantum realm, leading to the development of QGCL, a quantum extension of Dijkstra's GCL. It defines two distinct forms of alternation: classical (of quantum programs) and quantum alternation, the latter enabling true superposition of programs and forming the core of a new semantics based on guarded composition of operator-valued functions.

ABSTRACT

We extract a novel quantum programming paradigm - superposition of programs - from the design idea of a popular class of quantum algorithms, namely quantum walk-based algorithms. The generality of this paradigm is guaranteed by the universality of quantum walks as a computational model. A new quantum programming language QGCL is then proposed to support the paradigm of superposition of programs. This language can be seen as a quantum extension of Dijkstra's GCL (Guarded Command Language). Surprisingly, alternation in GCL splits into two different notions in the quantum setting: classical alternation (of quantum programs) and quantum alternation, with the latter being introduced in QGCL for the first time. Quantum alternation is the key program construct for realizing the paradigm of superposition of programs. The denotational semantics of QGCL are defined by introducing a new mathematical tool called the guarded composition of operator-valued functions. Then the weakest precondition semantics of QGCL can straightforwardly derived. Another very useful program construct in realizing the quantum programming paradigm of superposition of programs, called quantum choice, can be easily defined in terms of quantum alternation. The relation between quantum choices and probabilistic choices is clarified through defining the notion of local variables. We derive a family of algebraic laws for QGCL programs that can be used in program verification, transformations and compilation. The expressive power of QGCL is illustrated by several examples where various variants and generalizations of quantum walks are conveniently expressed using quantum alternation and quantum choice. We believe that quantum programming with quantum alternation and choice will play an important role in further exploiting the power of quantum computing.

Motivation & Objective

  • To identify and formalize a new quantum programming paradigm—superposition of programs—inspired by quantum walk-based algorithms.
  • To address the limitation of classical control flow in quantum programming by introducing quantum alternation as a fundamental construct.
  • To develop a formal semantics for quantum programs that supports both quantum control and data superposition.
  • To provide a foundation for verification, transformation, and compilation of quantum programs through algebraic laws and weakest precondition semantics.

Proposed method

  • Proposes QGCL as a quantum extension of Dijkstra’s GCL, incorporating quantum alternation and quantum choice as first-class constructs.
  • Introduces a new mathematical tool—guarded composition of operator-valued functions—to define the denotational semantics of QGCL.
  • Derives weakest precondition semantics from the denotational framework, enabling formal verification of quantum programs.
  • Defines quantum choice in terms of quantum alternation, clarifying its relationship with probabilistic choice via the notion of local variables.
  • Establishes a family of algebraic laws for program transformation and optimization in QGCL.
  • Illustrates expressive power through examples of quantum walks with multiple coins and entangled walkers, expressed using quantum alternation and choice.

Experimental results

Research questions

  • RQ1How can alternation in classical programming be generalized to support superposition of quantum programs?
  • RQ2What are the distinct quantum counterparts of classical alternation and how do they differ in computational behavior?
  • RQ3How can a quantum programming language be designed to support both quantum data and quantum control flow?
  • RQ4What formal semantics and verification techniques are needed for programs with quantum alternation and choice?
  • RQ5Can quantum alternation enable more efficient or novel quantum algorithms compared to classical control flow?

Key findings

  • Quantum alternation is introduced as a new program construct that enables superposition of programs, distinct from classical alternation of quantum programs.
  • The denotational semantics of QGCL are defined using guarded composition of operator-valued functions, providing a rigorous mathematical foundation.
  • Weakest precondition semantics are derived from the denotational model, enabling formal verification of quantum programs.
  • Quantum choice is defined in terms of quantum alternation, and its relationship to probabilistic choice is clarified via local variables.
  • A family of algebraic laws for QGCL is established, supporting program transformation, optimization, and verification.
  • Examples show that QGCL can elegantly express complex quantum walks with multiple coins and entangled control, demonstrating its expressive power.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.