# Quantum Algorithms for Weighted Constrained Sampling and Weighted Model Counting

arXiv: https://arxiv.org/abs/2407.12816 · HTML: https://mlsanity.com/paper/2407.12816/

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- Builds on 6 of its 55 references that are in the map.
- First posted on arXiv 29 Jun 2024.

## Builds on (most cited first, 6 of 6)

- [From Statistical Relational to Neurosymbolic Artificial Intelligence: a Survey](https://mlsanity.com/paper/2108.11451/) (2021)
- [The Model Counting Competition 2020](https://mlsanity.com/paper/2012.01323/) (2020)
- [Distribution-Aware Sampling and Weighted Model Counting for SAT](https://mlsanity.com/paper/1404.2984/) (2014)
- [On the Hardness of Probabilistic Neurosymbolic Learning](https://mlsanity.com/paper/2406.04472/) (2024)
- [The Sum-Product Theorem: A Foundation for Learning Tractable Models](https://mlsanity.com/paper/1611.03553/) (2016)
- [Solving #SAT and Bayesian Inference with Backtracking Search](https://mlsanity.com/paper/1401.3458/) (2014)

## Built on by (most cited first, 1 of 1)

- [A Quantum Information Theoretic Approach to Tractable Probabilistic Models](https://mlsanity.com/paper/2506.01824/) (2025)

## Abstract (arXiv)

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^fracn2+1/√WMC) oracle calls, where where n is the number of Boolean variables and WMC is the normalized between 0 and 1 weighted model count of the formula, while a classical algorithm has a complexity of Omega(1/WMC). QWMC takes Theta(2^fracn2) oracle calss, while classically the best complexity is Theta(2n), thus achieving a quadratic speedup.
