Table of Contents
Fetching ...

Quantum Algorithms for Weighted Constrained Sampling and Weighted Model Counting

Fabrizio Riguzzi

TL;DR

The paper addresses the computational challenges of weighted probabilistic reasoning by introducing three quantum algorithms—$QWMC$, $QMPE$, and $QMAP$—that extend Grover search and quantum counting to incorporate literal weights. By encoding weights with rotation gates and using a weighted Grover operator, these algorithms achieve a quadratic speedup over classical black-box approaches, with $QWMC$ requiring $\Theta(2^{n/2})$ oracle calls and $QMPE$/$QMAP$ needing $O(1/\sqrt{WMC})$ calls. The authors provide normalization techniques for non-summing weights, derive complexity bounds, and validate the approach with simulations and implementations in $Q#$ and $Qiskit$, including a sprinkler example. The work demonstrates potential practical impact for probabilistic inference in high-treewidth models and offers a scalable quantum primitive that can serve as a subroutine in classical inference frameworks like junction trees. Overall, the results establish a clear quantum advantage for weighted logical inference under black-box access and pave the way for further exploration under realistic noise and hardware constraints.

Abstract

We consider the problems of weighted constrained sampling and weighted model counting, where we are given a propositional formula and a weight for each world. The first problem consists of sampling worlds with a probability proportional to their weight given that the formula is satisfied. The latter is the problem of computing the sum of the weights of the models of the formula. Both have applications in many fields such as probabilistic reasoning, graphical models, statistical physics, statistics and hardware verification. In this article, we propose QWCS and QWMC, quantum algorithms for performing weighted constrained sampling and weighted model counting, respectively. Both are based on the quantum search/quantum model counting algorithms that are modified to take into account the weights. In the black box model of computation, where we can only query an oracle for evaluating the Boolean function given an assignment, QWCS requires $O(2^{\frac{n}{2}}+1/\sqrt{\text{WMC}})$ oracle calls, where where $n$ is the number of Boolean variables and $\text{WMC}$ is the normalized between 0 and 1 weighted model count of the formula, while a classical algorithm has a complexity of $Ω(1/\text{WMC})$. QWMC takes $Θ(2^{\frac{n}{2}})$ oracle calss, while classically the best complexity is $Θ(2^n)$, thus achieving a quadratic speedup.

Quantum Algorithms for Weighted Constrained Sampling and Weighted Model Counting

TL;DR

The paper addresses the computational challenges of weighted probabilistic reasoning by introducing three quantum algorithms—, , and —that extend Grover search and quantum counting to incorporate literal weights. By encoding weights with rotation gates and using a weighted Grover operator, these algorithms achieve a quadratic speedup over classical black-box approaches, with requiring oracle calls and / needing calls. The authors provide normalization techniques for non-summing weights, derive complexity bounds, and validate the approach with simulations and implementations in and , including a sprinkler example. The work demonstrates potential practical impact for probabilistic inference in high-treewidth models and offers a scalable quantum primitive that can serve as a subroutine in classical inference frameworks like junction trees. Overall, the results establish a clear quantum advantage for weighted logical inference under black-box access and pave the way for further exploration under realistic noise and hardware constraints.

Abstract

We consider the problems of weighted constrained sampling and weighted model counting, where we are given a propositional formula and a weight for each world. The first problem consists of sampling worlds with a probability proportional to their weight given that the formula is satisfied. The latter is the problem of computing the sum of the weights of the models of the formula. Both have applications in many fields such as probabilistic reasoning, graphical models, statistical physics, statistics and hardware verification. In this article, we propose QWCS and QWMC, quantum algorithms for performing weighted constrained sampling and weighted model counting, respectively. Both are based on the quantum search/quantum model counting algorithms that are modified to take into account the weights. In the black box model of computation, where we can only query an oracle for evaluating the Boolean function given an assignment, QWCS requires oracle calls, where where is the number of Boolean variables and is the normalized between 0 and 1 weighted model count of the formula, while a classical algorithm has a complexity of . QWMC takes oracle calss, while classically the best complexity is , thus achieving a quadratic speedup.
Paper Structure (23 sections, 13 theorems, 137 equations, 32 figures, 1 table)

This paper contains 23 sections, 13 theorems, 137 equations, 32 figures, 1 table.

Key Result

Lemma 1

The Grover operation applied to the uniform superposition state $\ket{\psi}$ rotates it by angle $\theta=2\arcsin\sqrt{M/N}$ where $M$ is the number of solutions of $\phi(x)=1$, supposing $M\leq N/2$.

Figures (32)

  • Figure 1: Quantum search algorithm.
  • Figure 2: Grover operator $G$.
  • Figure 3: Visualization of the effect of Grover operator (Figure 6.3 from nielsen2010quantum).
  • Figure 4: First stage of phase estimation. On the right we have omitted normalization factors of $\frac{1}{\sqrt{2}}$.
  • Figure 5: The complete phase estimation circuit.
  • ...and 27 more figures

Theorems & Definitions (31)

  • Definition 1: WMC
  • Definition 2: MPE
  • Definition 3: MAP
  • Example 1
  • Lemma 1
  • proof
  • Theorem 1
  • proof
  • Theorem 2
  • proof
  • ...and 21 more