MoMPy: automated construction of moment matrices for semidefinite programming relaxations
This paper introduces MoMPy, an open-source Python package that automates the construction of moment matrices for semidefinite programming hierarchies by efficiently resolving structural identifications through a word-rewriting algorithm, thereby providing a unified, scenario-independent framework for diverse quantum certification tasks.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
In the quantum world, the rules of reality are written in a language of probabilities and hidden connections. Scientists often ask questions that sound simple but are incredibly difficult to answer: How much randomness can a machine truly generate? How well can we tell two quantum states apart if we only know a little about how they were made? Or, how large a violation of a classical rule can a quantum system produce? To find the answers, researchers must explore a vast, unbounded space of possible physical setups. They need to check every conceivable combination of states and measurements to find the absolute limits of what is possible. Because this space is infinite and the math is not straightforward, finding these limits directly is usually impossible. Instead, scientists use a clever trick called a "relaxation." They trade the impossible task of searching through infinite possibilities for a more manageable problem: searching through a giant grid of numbers that represents all the possible outcomes. If this grid of numbers follows a specific mathematical shape, it guarantees that the answer found is a valid limit for the real world.
The challenge, however, is building that grid. The grid is made of "moments," which are essentially the average values of products of quantum operators. In a real physical system, many of these moments are not independent; they are linked by strict rules. For example, if a measurement has two outcomes that cannot happen at the same time, the math says their product must be zero. If two different parts of a system do not interfere with each other, their order in a calculation does not matter. In small problems, a human can figure out these links by hand. But as the problems get bigger and more realistic, the number of these links explodes into the tens of thousands. Getting them wrong makes the answer useless: miss a link, and the limit is too loose; add a fake link, and the answer is wrong. This bookkeeping task has become a major bottleneck, slowing down research and making it hard to trust the results.
Carles Roch i Carceller has addressed this bottleneck with a new software tool called MoMPy. The core achievement of this work is not just that the software builds these grids automatically, but that it does so using a single, unified method that works for almost every type of quantum question. Before this, researchers often had to write different code for different scenarios, such as testing for "non-locality" in separated systems versus testing for "steering" where one side is trusted and the other is not. MoMPy treats all of these as variations of the same underlying structure. The user simply declares the labels of the quantum operators involved and states the basic rules they obey—such as whether they are projectors, whether they cancel each other out, or whether they commute. The software then takes this list and automatically figures out every single hidden connection between the moments, collapsing thousands of potential entries down to the correct, independent variables.
The software works by treating the quantum operators as words in a language. It applies a set of rewriting rules to these words, much like a grammar checker simplifies a sentence. If the rules say that two words are the same, the software merges them. If a rule says a combination is impossible, it marks it as zero. The program is designed to be incredibly efficient, ensuring that it never does the same calculation twice, even for the most complex setups. It has been tested against a slow, brute-force method to prove that it gets the right answer every time. The results show that it can build these massive grids in seconds, even for scenarios that would take much longer with older methods.
What makes this tool particularly powerful is its flexibility. It can handle three different types of quantum problems with the same code. It can work with standard "state" moments, which are used to test the limits of quantum mechanics in Bell experiments. It can handle "tracial" moments, which are better suited for scenarios where the state is part of the measurement process itself. Most impressively, it can also build "block-valued" matrices, where the entries of the grid are not just single numbers but small matrices themselves. This allows it to tackle a recently discovered class of problems that were previously very difficult to model. The author demonstrates that by simply changing a few settings in the software, the same list of operators can be used to solve problems ranging from certifying randomness in a device to determining the minimum dimension of a quantum system needed to produce a specific pattern of results.
The paper validates this approach by applying it to eight distinct physical scenarios, including famous tests like the CHSH inequality and the Mermin inequality, as well as more complex setups involving multiple parties and networks. In every case, the software successfully reproduced known theoretical limits, such as the maximum quantum violation of a Bell inequality, and solved new problems that required no custom code. The tool is written in Python, a common language for scientists, and relies on only one external library, making it easy to install and use. It does not try to solve the entire physics problem for the user; instead, it acts as a highly reliable engine that prepares the mathematical structure, leaving the final optimization to standard solvers.
This work represents a shift in how quantum limits are explored. By automating the tedious and error-prone task of identifying relationships between moments, MoMPy allows researchers to focus on the physics rather than the algebra. It proves that the complex bookkeeping required for these advanced calculations can be abstracted into a simple, declarative process. The software is open-source and available for anyone to use, ensuring that the community can verify the results and build upon them. By making these powerful relaxation techniques accessible and reliable, the tool opens the door to exploring more complex quantum scenarios and certifying the security and randomness of future quantum technologies with greater confidence.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.