Table of Contents
Fetching ...

Expectation-based Analysis of Higher-Order Quantum Programs

Martin Avanzini, Alejandro Díaz-Caro, Emmanuel Hainry, Romain Péchoux

TL;DR

The paper addresses the challenge of analyzing higher‑order quantum programs by extending expectation transformers to the quantum setting. It introduces a CPS‑based transformation from a universal quantum language to a cost‑structure language built on Kegelspitzen, enabling formal reasoning about expected costs and values. A refinement‑type system is then used to derive sound upper bounds for these expectations, demonstrated on quantum cointossing, higher‑order quantum cointossing, and Grover search. The approach provides a compositional, classical reasoning framework for quantitative properties of quantum programs and lays the groundwork for automated analysis. This work broadens the toolkit for resource and performance analysis in quantum programming languages, with potential applications to compiler analyses and resource‑aware quantum software development.

Abstract

The paper extends the expectation transformer based analysis of higher-order probabilistic programs to the quantum higher-order setting. The quantum language we are considering can be seen as an extension of PCF, featuring unbounded recursion. The language admits classical and quantum data, as well as a tick operator to account for costs. Our quantum expectation transformer translates such programs into a functional, non-quantum language, enriched with a type and operations over so called cost-structures. By specializing the cost-structure, this methodology makes it possible to study several expectation based properties of quantum programs, such as average case cost, probabilities of events or expected values, in terms of the translated non-quantum programs, this way enabling classical reasoning techniques. As a show-case, we adapt a refinement type system, capable of reasoning on upper-bounds.

Expectation-based Analysis of Higher-Order Quantum Programs

TL;DR

The paper addresses the challenge of analyzing higher‑order quantum programs by extending expectation transformers to the quantum setting. It introduces a CPS‑based transformation from a universal quantum language to a cost‑structure language built on Kegelspitzen, enabling formal reasoning about expected costs and values. A refinement‑type system is then used to derive sound upper bounds for these expectations, demonstrated on quantum cointossing, higher‑order quantum cointossing, and Grover search. The approach provides a compositional, classical reasoning framework for quantitative properties of quantum programs and lays the groundwork for automated analysis. This work broadens the toolkit for resource and performance analysis in quantum programming languages, with potential applications to compiler analyses and resource‑aware quantum software development.

Abstract

The paper extends the expectation transformer based analysis of higher-order probabilistic programs to the quantum higher-order setting. The quantum language we are considering can be seen as an extension of PCF, featuring unbounded recursion. The language admits classical and quantum data, as well as a tick operator to account for costs. Our quantum expectation transformer translates such programs into a functional, non-quantum language, enriched with a type and operations over so called cost-structures. By specializing the cost-structure, this methodology makes it possible to study several expectation based properties of quantum programs, such as average case cost, probabilities of events or expected values, in terms of the translated non-quantum programs, this way enabling classical reasoning techniques. As a show-case, we adapt a refinement type system, capable of reasoning on upper-bounds.

Paper Structure

This paper contains 35 sections, 11 theorems, 63 equations, 9 figures.

Key Result

Theorem 4.1

If $\Theta \vdash_\mathsf{CS} T : \mathsf{S}$ then $\llbracket T \rrbracket_{\rho}^{\mathbb{K}} \in \llbracket \mathsf{S}\rrbracket^{\mathbb{K}}$ for all $\rho \Vdash \Theta$.

Figures (9)

  • Figure 1: Grammar for the Quantum Language
  • Figure 2: PARS of the Quantum Language
  • Figure 3: Types, Contexts, Judgments, and Rules for the Quantum Language.
  • Figure 4: Grammar for the Cost-Structure Language.
  • Figure 5: Types, Contexts, and Rules for the Cost-Structure Language.
  • ...and 4 more figures

Theorems & Definitions (27)

  • Definition 2.1
  • Definition 2.2
  • Definition 2.3: KP17
  • Definition 2.4: AMPPZ22
  • Example 2.5
  • Theorem 4.1
  • proof
  • Definition 4.2: Quantum Expectation Transformers
  • Theorem 4.3
  • proof
  • ...and 17 more