Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

arXiv:2205.09776

mat2qubit: A lightweight pythonic package for qubit encodings of vibrational, bosonic, graph coloring, routing, scheduling, and general matrix problems

Nicolas P. D. Sawaya

Published May 19, 2022• 1 citation
arXivHTMLPDF

Abstract

Preparing problems for execution on quantum computers can require many compilation steps. Automated compilation software is useful not only for easier and faster problem execution, but also for facilitating the comparison between different algorithmic choices. Here we describe mat2qubit, a Python package for encoding several classes of classical and quantum problems into qubit representations. It is intended for use especially on Hamiltonians and functions defined over variables (e.g. particles) with cardinality larger than 2. More specifically, mat2qubit may be used to compile bosonic, phononic/vibrational, and spin-$s$ problems, as well as classical problems such as graph coloring, routing, scheduling, and classical linear algebra more generally. In order to facilitate numerical analyses and ease of programmability, a built-in computer algebra system (CAS) allows for fully symbolic preparation and manipulation of problems (with symbolic operators, symbolic coefficients, and symbolic particle labels) before the final compilation into qubits is performed. We expect this code to be useful in the preparation and analysis of various classes of physics, chemistry, materials, and optimization problems for execution on digital quantum computers.

DOI
10.48550/arxiv.2205.09776

Related papers

Symbolic Hamiltonian Compiler for Hybrid Qubit-Boson Processors

Ethan Decker, Erik Gustafson, Evan McKinney +7 more

Quantum simulation of the interactions of fermions and bosons - the fundamental particles of nature - is essential for modeling complex quantum systems in material science, chemistry and high-energy physics and has been proposed as a promising application of fermion-boson quantum computers, which overcome the overhead encountered in mapping fermions and bosons to qubits. However, compiling the simulation of specific fermion-boson Hamiltonians into the natively available fermion-boson gate set is challenging. In particular, the large local dimension of bosons renders matrix-based compilation methods, as used for qubits and in existing tools such as Bosonic Qiskit or OpenFermion, challenging. We overcome this issue by introducing a novel symbolic compiler based on matrix-free symbolic manipulation of second quantised Hamiltonians, which automates the decomposition of fermion-boson second quantized problems into qubit-boson instruction set architectures. This integration establishes a comprehensive pipeline for simulating quantum systems on emerging qubit-boson and fermion-boson hardware, paving the way for their large-scale usage.

arXiv:2506.00215•IEEE International Conference on Quantum Computing and Engineering (QCE)•Aug 30, 2025•0 citations

Encoding trade-offs and design toolkits in quantum algorithms for discrete optimization: coloring, routing, scheduling, and other problems

Nicolas P. D. Sawaya, Albert T. Schmitz, Stuart Hadfield

Challenging combinatorial optimization problems are ubiquitous in science and engineering. Several quantum methods for optimization have recently been developed, in different settings including both exact and approximate solvers. Addressing this field of research, this manuscript has three distinct purposes. First, we present an intuitive method for synthesizing and analyzing discrete ( i . e . , integer-based) optimization problems, wherein the problem and corresponding algorithmic primitives are expressed using a discrete quantum intermediate representation (DQIR) that is encoding-independent. This compact representation often allows for more efficient problem compilation, automated analyses of different encoding choices, easier interpretability, more complex runtime procedures, and richer programmability, as compared to previous approaches, which we demonstrate with a number of examples. Second, we perform numerical studies comparing several qubit encodings; the results exhibit a number of preliminary trends that help guide the choice of encoding for a particular set of hardware and a particular problem and algorithm. Our study includes problems related to graph coloring, the traveling salesperson problem, factory/machine scheduling, financial portfolio rebalancing, and integer linear programming. Third, we design low-depth graph-derived partial mixers (GDPMs) up to 16-level quantum variables, demonstrating that compact (binary) encodings are more amenable to QAOA than previously understood. We expect this toolkit of programming abstractions and low-level building blocks to aid in designing quantum algorithms for discrete combinatorial problems.

arXiv:2203.14432•Quantum•Sep 14, 2023•14 citations

DiracQ: A Package for Algebraic Manipulation of Non-Commuting Quantum Variables

John G. Wright, B. Sriram Shastry

In several problems of quantum many body physics, one is required to handle complex expressions originating in the non-commutative nature of quantum operators. Their manipulation requires precise ordering and application of simplification rules. This can be cumbersome, tedious and error prone, and often a challenge to the most expert researcher. In this paper we present a software package DiracQ to facilitate such manipulations. The package DiracQ consists of functions based upon and extending considerably the symbolic capabilities of Mathematica. With DiracQ, one can proceed with large scale algebraic manipulations of expressions containing combinations of ordinary numbers or symbols (the c-numbers) and arbitrary sets of non-commuting variables (the q-numbers) with user defined properties. The DiracQ package is user extendable and comes encoded with the algebraic properties of several standard operators in popular usage. These include Fermionic and Bosonic creation and annihilation operators, spin operators, and canonical position and momentum operators. An example book is provided with some suggestive calculations of large-scale algebraic manipulations.

Journal of Open Research Software•Nov 20, 2015•2 citations

A Quantum Framework for K Coloring of Graphs

Lord Sen, Shyamapada Mukherjee

Graph coloring is a well-known NP-complete problem with applications in scheduling, register allocation, frequency assignment, and network optimization. Quantum computing offers the potential for polynomial or even super-polynomial speedups in certain problem instances, yet practical quantum graph coloring methods must carefully balance qubit resources, circuit depth, and constraint enforcement. We proposed a solver agnostic quantum framework for $K$-coloring. Along with a novel encoding and efficient constraint implementation for its exact coloring exploiting Grover search and almost optimal coloring by the Quantum Approximate Optimization Algorithm \emph{(QAOA)}, and \emph{Quantum Annealing}. Unlike using $O(NK)$ qubits as in \emph{SOTA}, we reduced the qubit requirements to $O(N \log_2 K)$, along with optimized comparator circuits enforcing adjacency constraints. Further symmetry-based graph reduction is incorporated as an optional preprocessing step to further reduce the instance size before quantum execution.

quant-pharXiv:2609.32348•International Conference on Computational Intelligence and Communication Networks (CICN)•Sep 29, 2026•0 citations

Symbolic solution for computational quantum many-body theory development

Jinmo Zhao

Computational many-body theories in quantum chemistry, condensed matter, and nuclear physics aim to provide sufficiently accurate description of and insights into the motion of many interacting particles. Due to their intrinsic complexity, the development of such theories generally involves very complex, tedious, and error-prone symbolic manipulations. Here a complete solution to automate the symbolics in many-body theory development is attempted. General data structures based on an existing computer algebra system are designed to specifically address the symbolic problems for which there is currently no satisfactory handling. Based on the data structures, algorithms are given to accomplish common symbolic manipulations and simplifications. Noncommutative algebraic systems, tensors with symmetry, and symbolic summations can all enjoy deep simplifications efficient enough for theories of very complex form. After the symbolic derivation, novel algorithms for automatic optimization of tensor contractions and their sums are devised, which can be used together with automatic code generation tools. In this way, the burden of symbolic tasks in theory development can be vastly reduced, with the potential to spare scientists more time and energy for the actual art and science of many-body theories.

•Mar 2, 2018•3 citations

Resource-efficient digital quantum simulation of d-level systems for photonic, vibrational, and spin-s Hamiltonians

Nicolas P. D. Sawaya, Tim Menke, Thi Ha Kyaw +3 more

Abstract Simulation of quantum systems is expected to be one of the most important applications of quantum computing, with much of the theoretical work so far having focused on fermionic and spin- $$\frac{1}{2}$$ 1 2 systems. Here, we instead consider encodings of d -level (i.e., qudit) quantum operators into multi-qubit operators, studying resource requirements for approximating operator exponentials by Trotterization. We primarily focus on spin- s and truncated bosonic operators in second quantization, observing desirable properties for approaches based on the Gray code, which to our knowledge has not been used in this context previously. After outlining a methodology for implementing an arbitrary encoding, we investigate the interplay between Hamming distances, sparsity patterns, bosonic truncation, and other properties of local operators. Finally, we obtain resource counts for five common Hamiltonian classes used in physics and chemistry, while modeling the possibility of converting between encodings within a Trotter step. The most efficient encoding choice is heavily dependent on the application and highly sensitive to d , although clear trends are present. These operation count reductions are relevant for running algorithms on near-term quantum hardware because the savings effectively decrease the required circuit depth. Results and procedures outlined in this work may be useful for simulating a broad class of Hamiltonians on qubit-based digital quantum computers.

arXiv:1909.12847•npj Quantum Information•Jun 2, 2020•162 citations
Preparing problems for execution on quantum computers can require many compilation steps. Automated compilation software is useful not only for easier and faster problem execution, but also for facilitating the comparison between different algorithmic choices. Here we describe mat2qubit, a Python package for encoding several classes of classical and quantum problems into qubit representations. It is intended for use especially on Hamiltonians and functions defined over variables (e.g. particles) with cardinality larger than 2. More specifically, mat2qubit may be used to compile bosonic, phononic/vibrational, and spin-sss problems, as well as classical problems such as graph coloring, routing, scheduling, and classical linear algebra more generally. In order to facilitate numerical analyses and ease of programmability, a built-in computer algebra system (CAS) allows for fully symbolic preparation and manipulation of problems (with symbolic operators, symbolic coefficients, and symbolic particle labels) before the final compilation into qubits is performed. We expect this code to be useful in the preparation and analysis of various classes of physics, chemistry, materials, and optimization problems for execution on digital quantum computers.
Quantum simulation of the interactions of fermions and bosons - the fundamental particles of nature - is essential for modeling complex quantum systems in material science, chemistry and high-energy physics and has been proposed as a promising application of fermion-boson quantum computers, which overcome the overhead encountered in mapping fermions and bosons to qubits. However, compiling the simulation of specific fermion-boson Hamiltonians into the natively available fermion-boson gate set is challenging. In particular, the large local dimension of bosons renders matrix-based compilation methods, as used for qubits and in existing tools such as Bosonic Qiskit or OpenFermion, challenging. We overcome this issue by introducing a novel symbolic compiler based on matrix-free symbolic manipulation of second quantised Hamiltonians, which automates the decomposition of fermion-boson second quantized problems into qubit-boson instruction set architectures. This integration establishes a comprehensive pipeline for simulating quantum systems on emerging qubit-boson and fermion-boson hardware, paving the way for their large-scale usage.
Challenging combinatorial optimization problems are ubiquitous in science and engineering. Several quantum methods for optimization have recently been developed, in different settings including both exact and approximate solvers. Addressing this field of research, this manuscript has three distinct purposes. First, we present an intuitive method for synthesizing and analyzing discrete ( i . e . , integer-based) optimization problems, wherein the problem and corresponding algorithmic primitives are expressed using a discrete quantum intermediate representation (DQIR) that is encoding-independent. This compact representation often allows for more efficient problem compilation, automated analyses of different encoding choices, easier interpretability, more complex runtime procedures, and richer programmability, as compared to previous approaches, which we demonstrate with a number of examples. Second, we perform numerical studies comparing several qubit encodings; the results exhibit a number of preliminary trends that help guide the choice of encoding for a particular set of hardware and a particular problem and algorithm. Our study includes problems related to graph coloring, the traveling salesperson problem, factory/machine scheduling, financial portfolio rebalancing, and integer linear programming. Third, we design low-depth graph-derived partial mixers (GDPMs) up to 16-level quantum variables, demonstrating that compact (binary) encodings are more amenable to QAOA than previously understood. We expect this toolkit of programming abstractions and low-level building blocks to aid in designing quantum algorithms for discrete combinatorial problems.
In several problems of quantum many body physics, one is required to handle complex expressions originating in the non-commutative nature of quantum operators. Their manipulation requires precise ordering and application of simplification rules. This can be cumbersome, tedious and error prone, and often a challenge to the most expert researcher. In this paper we present a software package DiracQ to facilitate such manipulations. The package DiracQ consists of functions based upon and extending considerably the symbolic capabilities of Mathematica. With DiracQ, one can proceed with large scale algebraic manipulations of expressions containing combinations of ordinary numbers or symbols (the c-numbers) and arbitrary sets of non-commuting variables (the q-numbers) with user defined properties. The DiracQ package is user extendable and comes encoded with the algebraic properties of several standard operators in popular usage. These include Fermionic and Bosonic creation and annihilation operators, spin operators, and canonical position and momentum operators. An example book is provided with some suggestive calculations of large-scale algebraic manipulations.
Graph coloring is a well-known NP-complete problem with applications in scheduling, register allocation, frequency assignment, and network optimization. Quantum computing offers the potential for polynomial or even super-polynomial speedups in certain problem instances, yet practical quantum graph coloring methods must carefully balance qubit resources, circuit depth, and constraint enforcement. We proposed a solver agnostic quantum framework for KKK-coloring. Along with a novel encoding and efficient constraint implementation for its exact coloring exploiting Grover search and almost optimal coloring by the Quantum Approximate Optimization Algorithm \emph{(QAOA)}, and \emph{Quantum Annealing}. Unlike using O(NK)O(NK)O(NK) qubits as in \emph{SOTA}, we reduced the qubit requirements to O(Nlog⁡2K)O(N \log_2 K)O(Nlog2​K), along with optimized comparator circuits enforcing adjacency constraints. Further symmetry-based graph reduction is incorporated as an optional preprocessing step to further reduce the instance size before quantum execution.
Computational many-body theories in quantum chemistry, condensed matter, and nuclear physics aim to provide sufficiently accurate description of and insights into the motion of many interacting particles. Due to their intrinsic complexity, the development of such theories generally involves very complex, tedious, and error-prone symbolic manipulations. Here a complete solution to automate the symbolics in many-body theory development is attempted. General data structures based on an existing computer algebra system are designed to specifically address the symbolic problems for which there is currently no satisfactory handling. Based on the data structures, algorithms are given to accomplish common symbolic manipulations and simplifications. Noncommutative algebraic systems, tensors with symmetry, and symbolic summations can all enjoy deep simplifications efficient enough for theories of very complex form. After the symbolic derivation, novel algorithms for automatic optimization of tensor contractions and their sums are devised, which can be used together with automatic code generation tools. In this way, the burden of symbolic tasks in theory development can be vastly reduced, with the potential to spare scientists more time and energy for the actual art and science of many-body theories.
Abstract Simulation of quantum systems is expected to be one of the most important applications of quantum computing, with much of the theoretical work so far having focused on fermionic and spin- 12\frac{1}{2}21​ 1 2 systems. Here, we instead consider encodings of d -level (i.e., qudit) quantum operators into multi-qubit operators, studying resource requirements for approximating operator exponentials by Trotterization. We primarily focus on spin- s and truncated bosonic operators in second quantization, observing desirable properties for approaches based on the Gray code, which to our knowledge has not been used in this context previously. After outlining a methodology for implementing an arbitrary encoding, we investigate the interplay between Hamming distances, sparsity patterns, bosonic truncation, and other properties of local operators. Finally, we obtain resource counts for five common Hamiltonian classes used in physics and chemistry, while modeling the possibility of converting between encodings within a Trotter step. The most efficient encoding choice is heavily dependent on the application and highly sensitive to d , although clear trends are present. These operation count reductions are relevant for running algorithms on near-term quantum hardware because the savings effectively decrease the required circuit depth. Results and procedures outlined in this work may be useful for simulating a broad class of Hamiltonians on qubit-based digital quantum computers.