Quantum Theory and Application of Contextual Optimal Transport

Nicola Mariella, Albert Akhriev, Francesco Tacchino, Christa Zoufal, Juan Carlos Gonzalez-Espitia, Benedek Harsanyi, Eugene Koskin, Ivano Tavernelli, Stefan Woerner, Marianna Rapsomaniki, Sergiy Zhuk, Jannis Born · DOI

Abstract

Optimal Transport (OT) provides a powerful mathematical framework for analyzing the transformation of probability distributions, yet classical "Contextual OT" methods often struggle with computational constraints and rigid assumptions regarding cost functions. This paper introduces QontOT, a quantum computing framework that leverages the inherent properties of unitary operators to model transportation plans. By exploiting the fact that the entry-wise absolute square of a unitary matrix is naturally doubly stochastic, QontOT provides a robust inductive bias for OT tasks. We demonstrate that QontOT performs competitively on biological datasets and achieves superior results on 24-qubit quantum hardware compared to classical neural network baselines.

Introduction

Optimal Transport (OT) is the study of finding the most efficient way to move mass from one distribution to another. In fields like computational biology, this is essential for tracking how cell populations evolve over time or respond to external perturbations, such as drug treatments.

However, real-world applications often require Contextual OT, where the goal is not just to find a single map, but to learn a global rule: given a specific context $p$ (e.g., a dosage of 5mg), how will distribution $A$ transform into distribution $B$? Classical approaches, often termed "Neural OT," typically rely on Brenier’s theorem, which restricts transport maps to the gradients of convex functions. While mathematically sound, this often limits the model to specific cost functions (like squared Euclidean distance) and introduces instability during training. Furthermore, ensuring that a predicted matrix is "doubly stochastic"—where rows and columns sum to one—is computationally taxing for classical architectures.

Methods: The Quantum-OT Bridge

The core innovation of QontOT (Quantum Contextual Optimal Transport) lies in the discovery of a "natural link" between quantum mechanics and the constraints of optimal transport.

1. Unitary to Doubly Stochastic Matrices

In quantum computing, operations are represented by unitary matrices $U$. A key property utilized here is that the Hadamard product of a unitary matrix and its complex conjugate ($U \odot \bar{U}$) always results in a doubly stochastic matrix (DSM). Because quantum circuits naturally produce these matrices, the model possesses a built-in inductive bias for the fundamental requirements of transportation plans without needing the complex normalization layers required by classical networks.

2. The QontOT Ansatz

The researchers designed a parametric quantum circuit (an ansatz) where the parameters are conditioned on the external context (the perturbation). To handle scenarios where source and target distributions are non-uniform, they implemented an "Atop aggregation" scheme. This rescales the generated DSMs into right-stochastic matrices tailored to specific initial marginal distributions.

3. Cost Agnosticism

Unlike classical methods tied to Brenier’s theorem, QontOT is cost-agnostic. It does not rely on the dual formulation of OT, allowing it to work with diverse cost functions, such as cosine distance, which are often more appropriate for complex biological manifolds.

Experimental Evaluation

The framework was evaluated across three primary domains:

  • Synthetic Biological Data: Using the Splatter scRNA-seq simulator, the team created datasets where cell gene expressions were perturbed linearly and non-linearly based on a dosage variable.
  • Real-World Pharmacological Data: The SciPlex dataset was used to evaluate responses to cancer drugs (Mocetinostat and Pracinostat) at varying concentrations.
  • Hardware Stress Test: A specialized task designed to predict complex 8x8 doubly stochastic matrices was executed on the IBM Sherbrooke 127-qubit processor.

Key Results

QontOT demonstrated significant advantages in both theoretical flexibility and empirical performance:

  • Baseline Superiority: On synthetic benchmarks, QontOT significantly outperformed standard "Average" and "Identity" baselines across both Euclidean and Cosine distance metrics.
  • Biological Accuracy: In the SciPlex trials, QontOT remained competitive with state-of-the-art classical models like CellOT and CondOT. While classical models occasionally matched its accuracy, QontOT provided superior interpretability by explicitly predicting the transportation plan (the mapping of specific cell types) rather than acting as a "black-box" push-forward model.
  • Quantum Advantage in Scaling: In the 24-qubit stress test on real hardware, QontOT predicted DSMs with a lower Frobenius distance (error) than NeuCOT, a classical neural network optimized with significantly more parameters. This suggests that the quantum inductive bias remains effective even on current Noisy Intermediate-Scale Quantum (NISQ) devices.

Discussion and Limitations

While QontOT represents a significant step forward, several challenges remain for scaling the technology:

  1. Shot Noise: Quantum computers require repeated measurements ("shots") to estimate probabilities. As the number of entities $d$ grows, the required shots scale as $O(d \log d)$, which may pose a bottleneck for high-resolution data.
  2. Device Noise: Current hardware is susceptible to recalibration spikes and environmental noise, which can affect optimization stability.
  3. Resolution Scaling: The method is currently most effective when cells are grouped into clusters (e.g., 8 or 16 types). Scaling to single-cell resolution involving thousands of individual points is a primary target for future research.

Conclusion

QontOT establishes a novel bridge between quantum unitary operations and the mathematical requirements of Optimal Transport. By providing a cost-agnostic, interpretable, and hardware-efficient framework, it opens new avenues for using quantum computing to solve complex distribution-shifting problems in biology and beyond. Future work may see these doubly stochastic quantum layers integrated into Transformer architectures, where similar mathematical structures have recently been observed to emerge naturally.

Summary updated

BibTeX
@inproceedings{mariella2024quantum,
  author = {Nicola Mariella and Albert Akhriev and Francesco Tacchino and Christa Zoufal and Juan Carlos Gonzalez-Espitia and Benedek Harsanyi and Eugene Koskin and Ivano Tavernelli and Stefan Woerner and Marianna Rapsomaniki and Sergiy Zhuk and Jannis Born},
  title = {{Quantum Theory and Application of Contextual Optimal Transport}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=A9hJvQHEEP},
}
Figure