# Quantum Algorithms for Wmc, Mpe and Map

50 Pages Posted: 22 Jul 2022

### Abstract

In Weighted Model Counting (WMC) we are given a propositional formula and a weight for each literal and we want to compute the sum of the weights of the models of the formula. In Most Probable Explanation (MPE) we seek the model with the highest weight while in Maximum A Posteriori (MAP) we look for the state of a subset of variables that maximizes the sum of the weights of the models that agree on that state.WMC, MPE and MAP find interesting applications in inference for graphical modes. In particular, algorithms based on WMC have a complexity of [[EQUATION]], where [[EQUATION]] is the number of variables and [[EQUATION]] is the treewidth.In this paper, we propose QWMC, QMPE and QMAP, quantum algorithms for performing WMC, MPE and MAP, respectively. They are all 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, QWMC solves the problem approximately witha complexity of [[EQUATION]], where [[EQUATION]] is the number of Boolean variables, while classically the best complexity is [[EQUATION]], thus achieving a quadratic speedup. QMPE and QMAP require [[EQUATION]] oracle calls, where [[EQUATION]] is the normalized between 0 and 1 weighted model count of the formula, while a classical algorithm has a complexity of [[EQUATION]], again obtaining a quadratic speedup.

**Keywords:** Quantum Computing, Weighted Model Counting, Most Probable Explanation, Maximum A Posteriori

**Suggested Citation:**
Suggested Citation