<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article article-type="review-article" dtd-version="2.3" xml:lang="EN" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Quantum Sci. Technol.</journal-id>
<journal-title>Frontiers in Quantum Science and Technology</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Quantum Sci. Technol.</abbrev-journal-title>
<issn pub-type="epub">2813-2181</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="publisher-id">1229471</article-id>
<article-id pub-id-type="doi">10.3389/frqst.2023.1229471</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Quantum Science and Technology</subject>
<subj-group>
<subject>Review</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>Encoding-independent optimization problem formulation for quantum computing</article-title>
<alt-title alt-title-type="left-running-head">Dominguez et al.</alt-title>
<alt-title alt-title-type="right-running-head">
<ext-link ext-link-type="uri" xlink:href="https://doi.org/10.3389/frqst.2023.1229471">10.3389/frqst.2023.1229471</ext-link>
</alt-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" equal-contrib="yes">
<name>
<surname>Dominguez</surname>
<given-names>Federico</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<xref ref-type="author-notes" rid="fn001">
<sup>&#x2020;</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/2323194/overview"/>
</contrib>
<contrib contrib-type="author" equal-contrib="yes">
<name>
<surname>Unger</surname>
<given-names>Josua</given-names>
</name>
<xref ref-type="aff" rid="aff2">
<sup>2</sup>
</xref>
<xref ref-type="author-notes" rid="fn001">
<sup>&#x2020;</sup>
</xref>
</contrib>
<contrib contrib-type="author" equal-contrib="yes">
<name>
<surname>Traube</surname>
<given-names>Matthias</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<xref ref-type="author-notes" rid="fn001">
<sup>&#x2020;</sup>
</xref>
</contrib>
<contrib contrib-type="author" equal-contrib="yes">
<name>
<surname>Mant</surname>
<given-names>Barry</given-names>
</name>
<xref ref-type="aff" rid="aff2">
<sup>2</sup>
</xref>
<xref ref-type="author-notes" rid="fn001">
<sup>&#x2020;</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/2358888/overview"/>
</contrib>
<contrib contrib-type="author" equal-contrib="yes">
<name>
<surname>Ertler</surname>
<given-names>Christian</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<xref ref-type="author-notes" rid="fn001">
<sup>&#x2020;</sup>
</xref>
</contrib>
<contrib contrib-type="author" corresp="yes" equal-contrib="yes">
<name>
<surname>Lechner</surname>
<given-names>Wolfgang</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<xref ref-type="aff" rid="aff2">
<sup>2</sup>
</xref>
<xref ref-type="aff" rid="aff3">
<sup>3</sup>
</xref>
<xref ref-type="corresp" rid="c001">&#x2a;</xref>
<xref ref-type="author-notes" rid="fn001">
<sup>&#x2020;</sup>
</xref>
</contrib>
</contrib-group>
<aff id="aff1">
<sup>1</sup>
<institution>Parity Quantum Computing Germany GmbH</institution>, <addr-line>Munich</addr-line>, <country>Germany</country>
</aff>
<aff id="aff2">
<sup>2</sup>
<institution>Parity Quantum Computing GmbH</institution>, <addr-line>Innsbruck</addr-line>, <country>Austria</country>
</aff>
<aff id="aff3">
<sup>3</sup>
<institution>Institute for Theoretical Physics</institution>, <institution>University of Innsbruck</institution>, <addr-line>Innsbruck</addr-line>, <country>Austria</country>
</aff>
<author-notes>
<fn fn-type="edited-by">
<p>
<bold>Edited by:</bold> <ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/1995947/overview">Julio De Vicente</ext-link>, Universidad Carlos III de Madrid, Spain</p>
</fn>
<fn fn-type="edited-by">
<p>
<bold>Reviewed by:</bold> <ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/2344283/overview">Nicolas Sawaya</ext-link>, Intel, United States</p>
<p>
<ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/1556707/overview">Mingxing Luo</ext-link>, Southwest Jiaotong University, China</p>
</fn>
<corresp id="c001">&#x2a;Correspondence: Wolfgang Lechner, <email>wolfgang@parityqc.com</email>
</corresp>
<fn fn-type="equal" id="fn001">
<label>
<sup>&#x2020;</sup>
</label>
<p>These authors have contributed equally to this work</p>
</fn>
</author-notes>
<pub-date pub-type="epub">
<day>07</day>
<month>09</month>
<year>2023</year>
</pub-date>
<pub-date pub-type="collection">
<year>2023</year>
</pub-date>
<volume>2</volume>
<elocation-id>1229471</elocation-id>
<history>
<date date-type="received">
<day>26</day>
<month>05</month>
<year>2023</year>
</date>
<date date-type="accepted">
<day>15</day>
<month>08</month>
<year>2023</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#xa9; 2023 Dominguez, Unger, Traube, Mant, Ertler and Lechner.</copyright-statement>
<copyright-year>2023</copyright-year>
<copyright-holder>Dominguez, Unger, Traube, Mant, Ertler and Lechner</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/">
<p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p>
</license>
</permissions>
<abstract>
<p>We review encoding and hardware-independent formulations of optimization problems for quantum computing. Using this generalized approach, an extensive library of optimization problems from the literature and their various derived spin encodings are discussed. Common building blocks that serve as a construction kit for formulating these spin Hamiltonians are provided. This previously introduced approach paves the way toward a fully automatic construction of Hamiltonians for arbitrary discrete optimization problems and this freedom in the problem formulation is a key step for tailoring optimal spin Hamiltonians for different hardware platforms.</p>
</abstract>
<kwd-group>
<kwd>qubit encoding</kwd>
<kwd>quantum optimization</kwd>
<kwd>quantum annealing</kwd>
<kwd>QUBO</kwd>
<kwd>PUBO</kwd>
</kwd-group>
<contract-num rid="cn001">Y1067-N27</contract-num>
<contract-sponsor id="cn001">Austrian Science Fund<named-content content-type="fundref-id">10.13039/501100002428</named-content>
</contract-sponsor>
<custom-meta-wrap>
<custom-meta>
<meta-name>section-at-acceptance</meta-name>
<meta-value>Basic Science for Quantum Technologies</meta-value>
</custom-meta>
</custom-meta-wrap>
</article-meta>
</front>
<body>
<sec id="s1">
<title>1 Introduction</title>
<p>Discrete optimization problems are ubiquitous in almost any enterprise and many of these are known to be NP-hard (<xref ref-type="bibr" rid="B47">Lenstra and Rinnooy Kan, 1979</xref>). The objective of such problems is to find the minimum of a real-valued function <italic>f</italic>(<italic>v</italic>
<sub>0</sub>, <italic>&#x2026;</italic>, <italic>v</italic>
<sub>
<italic>N</italic>&#x2212;1</sub>) (the <italic>cost function</italic>) over a set of discrete variables <italic>v</italic>
<sub>
<italic>k</italic>
</sub>. The search space is restricted by hard constraints, which are commonly presented as equalities such as <italic>g</italic>(<italic>v</italic>
<sub>0</sub>, <italic>&#x2026;</italic>, <italic>v</italic>
<sub>
<italic>N</italic>&#x2212;1</sub>) &#x3d; 0 or inequalities as <italic>h</italic>(<italic>v</italic>
<sub>0</sub>, <italic>&#x2026;</italic>, <italic>v</italic>
<sub>
<italic>N</italic>&#x2212;1</sub>) &#x3e; 0. Besides using classical heuristics (<xref ref-type="bibr" rid="B17">Dorigo and Di Caro, 1999</xref>; <xref ref-type="bibr" rid="B53">Melnikov, 2005</xref>) and machine learning methods (<xref ref-type="bibr" rid="B51">Mazyavkina et al., 2021</xref>) to solve these problems, there is a growing interest in applying quantum computation (<xref ref-type="bibr" rid="B2">Au-Yeung et al., 2023</xref>). A common approach for realizing this consists of first encoding the cost function <italic>f</italic> in a Hamiltonian <italic>H</italic> such that a subset of eigenvectors of <italic>H</italic> represents elements in the domain of <italic>f</italic> and the eigenvalues are the respective values of <italic>f</italic>:<disp-formula id="e1">
<mml:math id="m1">
<mml:mi>H</mml:mi>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>&#x3c8;</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>f</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mfenced open="|" close="&#x27e9;">
<mml:mrow>
<mml:mi>&#x3c8;</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>.</mml:mo>
</mml:math>
<label>(1)</label>
</disp-formula>In such an encoding, the ground state of <italic>H</italic> is the solution to the optimization problem. Having obtained a Hamiltonian formulation, one can use a variety of quantum algorithms to find the ground state including adiabatic quantum computing (<xref ref-type="bibr" rid="B23">Farhi et al., 2000</xref>) and variational approaches, for instance, the quantum/classical hybrid quantum approximate optimization algorithm (QAOA) (<xref ref-type="bibr" rid="B22">Farhi et al., 2014</xref>) or generalizations thereof such as the quantum alternating operator ansatz (<xref ref-type="bibr" rid="B34">Hadfield et al., 2019</xref>). On the hardware side, these algorithms can run on gate-based quantum computers, quantum annealers, or specialized Ising machines (<xref ref-type="bibr" rid="B57">Mohseni et al., 2022</xref>).</p>
<p>In the current literature, almost all Hamiltonians for optimization are formulated as Quadratic Unconstrained Binary Optimization (QUBO) problems (<xref ref-type="bibr" rid="B41">Kochenberger et al., 2014</xref>). The success of QUBO reflects the strong hardware limitations of current devices, where multiqubit interactions are not available and must be decomposed into two-qubit interactions using ancilla qubits. Moreover, quantum algorithms with the dynamical implementation of hard constraints (<xref ref-type="bibr" rid="B36">Hen and Sarandy, 2016</xref>; <xref ref-type="bibr" rid="B37">Hen and Spedalieri, 2016</xref>) require driver terms that can be difficult to design and implement on quantum computers. Hence, hard constraints are usually included as energy penalizations of QUBO Hamiltonians. The prevalence of QUBO has also increased the popularity of one-hot encoding, a particular way of mapping (discrete) variables to eigenvalues of spin operators (<xref ref-type="bibr" rid="B49">Lucas, 2014</xref>), since this encoding allows for Hamiltonians with low-order interactions which is especially appropriate for QUBO problems.</p>
<p>However, compelling alternatives to QUBO and one-hot encoding have been proposed in recent years. A growing number of platforms are exploring high-order interactions (<xref ref-type="bibr" rid="B11">Chancellor et al., 2017</xref>; <xref ref-type="bibr" rid="B48">Lu et al., 2019</xref>; <xref ref-type="bibr" rid="B69">Sch&#xf6;ndorf and Wilhelm, 2019</xref>; <xref ref-type="bibr" rid="B76">Wilkinson and Hartmann, 2020</xref>; <xref ref-type="bibr" rid="B55">Menke et al., 2021</xref>; <xref ref-type="bibr" rid="B54">2022</xref>; <xref ref-type="bibr" rid="B16">Dlaska et al., 2022</xref>; <xref ref-type="bibr" rid="B61">Pelegr&#xed; et al., 2022</xref>; <xref ref-type="bibr" rid="B30">Glaser et al., 2023</xref>), while the Parity architecture (<xref ref-type="bibr" rid="B46">Lechner, 2020</xref>; <xref ref-type="bibr" rid="B26">Fellner et al., 2022</xref>; <xref ref-type="bibr" rid="B21">Ender et al., 2023</xref>) (a generalization of the LHZ architecture (<xref ref-type="bibr" rid="B45">Lechner et al., 2015</xref>)) allows the mapping of arbitrary-order interactions to qubits that require only local connectivity. The dynamical implementation of constraints has also been investigated (<xref ref-type="bibr" rid="B34">Hadfield et al., 2019</xref>; <xref ref-type="bibr" rid="B35">2017</xref>; <xref ref-type="bibr" rid="B28">Fuchs et al., 2022</xref>; <xref ref-type="bibr" rid="B77">Zhu et al., 2023</xref>), including the design of approximate drivers (<xref ref-type="bibr" rid="B75">Wang et al., 2020</xref>; <xref ref-type="bibr" rid="B68">Sawaya et al., 2022</xref>) and compilation of constrained problems within the Parity architecture (<xref ref-type="bibr" rid="B18">Drieb-Sch&#xf6;n et al., 2023</xref>). Moreover, simulated and experimental results have shown that alternative encodings outperform the traditional one-hot approach (<xref ref-type="bibr" rid="B10">Chancellor, 2019</xref>; <xref ref-type="bibr" rid="B67">Sawaya et al., 2020</xref>; <xref ref-type="bibr" rid="B12">Chen et al., 2021</xref>; <xref ref-type="bibr" rid="B62">Plewa et al., 2021</xref>; <xref ref-type="bibr" rid="B71">Tamura et al., 2021</xref>; <xref ref-type="bibr" rid="B31">Glos et al., 2022</xref>; <xref ref-type="bibr" rid="B70">Stein et al., 2023</xref>). Clearly, alternative formulations for Hamiltonians need to be explored but when the Hamiltonian has been expressed in QUBO using one-hot encoding, it is not trivial to switch to other formulations. Automatic tools to explore different formulations would therefore be highly beneficial.</p>
<p>We present a library of more than 20 problems which is intended to facilitate the Hamiltonian formulation beyond QUBO and one-hot encoding. We build upon the recent work of <xref ref-type="bibr" rid="B68">Sawaya et al. (2022)</xref> by making use of the encoding-independent approach to revisit common problems in the literature. With this approach, the problems can be encoded trivially using any spin encoding. We also provide a summary of the most popular encodings. Possible constraints of the problems are identified and presented separately from the cost function so that dynamic implementation of the constraints can also be easily explored. Two additional subgoals that are addressed in this library are:<list list-type="simple">
<list-item>
<p>&#x2022; Meta parameters/choices: We present and review the most important choices made in the process of mapping optimization problems in a mathematical formulation to spin Hamiltonians. These mainly include the encodings, which can greatly influence the computational cost and performance of the optimization, but also free meta parameters or the use of auxiliary variables. These degrees of freedom are a consequence of the fact that the optimal solution is typically encoded only in the ground state. Other low-energy eigenstates encode good approximations to the optimal solution and it can be convenient to make approximations so that the solution corresponds to these states (<xref ref-type="bibr" rid="B58">Montanez-Barrera et al., 2022</xref>).</p>
</list-item>
<list-item>
<p>&#x2022; (Partial) automation: Usually, each problem needs to be evaluated individually. The resulting cost functions are not necessarily unique and there is no known trivial way of automatically creating <italic>H</italic>. By providing a collection of building blocks of cost functions and heuristics for selecting parameters, the creation of the cost function and constraints is assisted. This enables a general representation of problems in an encoding-independent way and parts of the parameter selection and performance analysis can be conducted at this intermediate stage. This goal has also been discussed by <xref ref-type="bibr" rid="B68">Sawaya et al. (2022)</xref>.</p>
</list-item>
</list>
</p>
<p>In practice, many optimization problems are not purely discrete but involve real-valued parameters and variables. Thus, the encoding of real-valued problems to discrete optimization problems (discretization) as an intermediate step is discussed in <xref ref-type="sec" rid="s7-4">Section 7.4</xref>.</p>
<p>The focus of this review is on optimization problems which can be formulated as diagonal Hamiltonians written as sums and products of Pauli-z-matrices. This subset of Hamiltonians is usually not applicable to quantum systems or quantum simulations. For an introduction to these more general Hamiltonians, we refer to the reviews of <xref ref-type="bibr" rid="B29">Georgescu et al. (2014)</xref> for physics problems and <xref ref-type="bibr" rid="B52">McArdle et al. (2020)</xref>; <xref ref-type="bibr" rid="B8">Cao et al. (2019)</xref> for quantum chemistry simulations.</p>
<p>After introducing the notation used throughout the text in <xref ref-type="sec" rid="s2">Section 2</xref>, we present a list of encodings in <xref ref-type="sec" rid="s3">Section 3</xref>. <xref ref-type="sec" rid="s4">Section 4</xref> reviews the Parity architecture and <xref ref-type="sec" rid="s5">Section 5</xref> discusses encoding constraints. <xref ref-type="sec" rid="s6">Section 6</xref> functions as a manual on how to bring optimization problems into a form that can be solved with a quantum computer. <xref ref-type="sec" rid="s7">Section 7</xref> contains a library of optimization problems which are classified into several categories and <xref ref-type="sec" rid="s8">Section 8</xref> lists the building blocks used in the formulation of these (and many other) problems. <xref ref-type="sec" rid="s9">Section 9</xref> offers conclusions.</p>
</sec>
<sec id="s2">
<title>2 Definitions and notation</title>
<p>A discrete set of real numbers is a countable subset <inline-formula id="inf1">
<mml:math id="m2">
<mml:mi>U</mml:mi>
<mml:mo>&#x2282;</mml:mo>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:math>
</inline-formula> without an accumulation point. Discrete sets are denoted by uppercase Latin letters, except the letter <italic>G</italic>, which we reserve for graphs. A discrete variable is a variable ranging over a discrete set <italic>R</italic> and will be represented by lowercase Latin letters, mostly <italic>v</italic> or <italic>w</italic>. Elements of <italic>R</italic> are denoted by lowercase Greek letters.</p>
<p>If a discrete variable has range <inline-formula id="inf2">
<mml:math id="m3">
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:mn>0,1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> we call it <italic>binary</italic> or <italic>boolean</italic>. Binary variables will be denoted by the letter <italic>x</italic>. Similarly, a variable with range <inline-formula id="inf3">
<mml:math id="m4">
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1,1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> will be called a spin variable and the letter <italic>s</italic> will be reserved for these. There is an invertible mapping from a binary variable <italic>x</italic> to a spin variable <italic>s</italic>:<disp-formula id="e2">
<mml:math id="m5">
<mml:mi>x</mml:mi>
<mml:mo>&#x21a6;</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>:</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>2</mml:mn>
<mml:mi>x</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(2)</label>
</disp-formula>For a variable <italic>v</italic> with range <italic>R</italic> we follow <xref ref-type="bibr" rid="B10">Chancellor (2019)</xref> and <xref ref-type="bibr" rid="B68">Sawaya et al. (2022)</xref> and define the <italic>value indicator function</italic> to be<disp-formula id="e3">
<mml:math id="m6">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mtable class="cases">
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>1</mml:mn>
<mml:mspace width="2em"/>
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.28em"/>
<mml:mi>v</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>&#x3b1;</mml:mi>
<mml:mspace width="1em"/>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>0</mml:mn>
<mml:mspace width="2em"/>
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.28em"/>
<mml:mi>v</mml:mi>
<mml:mo>&#x2260;</mml:mo>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mspace width="1em"/>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(3)</label>
</disp-formula>where <italic>&#x3b1;</italic> &#x2208; <italic>R</italic>.</p>
<p>We also consider optimization problems for continuous variables. A variable <italic>v</italic> will be called <italic>continuous</italic>, if its range is given by <inline-formula id="inf4">
<mml:math id="m7">
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula> for some <inline-formula id="inf5">
<mml:math id="m8">
<mml:mi>d</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="double-struck">Z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x3e;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula>.</p>
<p>An optimization problem <italic>O</italic> is a triple (<italic>V</italic>, <italic>f</italic>, <italic>C</italic>), where.<list list-type="simple">
<list-item>
<p>1. <inline-formula id="inf6">
<mml:math id="m9">
<mml:mi>V</mml:mi>
<mml:mo>:</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula> is a finite set of variables.</p>
</list-item>
<list-item>
<p>2. <italic>f</italic> :&#x3d; <italic>f</italic>(<italic>v</italic>
<sub>0</sub>, &#x2026;, <italic>v</italic>
<sub>
<italic>N</italic>&#x2212;1</sub>) is a real-valued function, called objective or cost function.</p>
</list-item>
<list-item>
<p>3. <inline-formula id="inf7">
<mml:math id="m10">
<mml:mi>C</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>C</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>l</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula> is a finite set of constraints <italic>C</italic>
<sub>
<italic>i</italic>
</sub>. A constraint <italic>C</italic> is either an equation</p>
</list-item>
</list>
<disp-formula id="e4">
<mml:math id="m11">
<mml:mi>c</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>k</mml:mi>
</mml:math>
<label>(4)</label>
</disp-formula>for some <inline-formula id="inf8">
<mml:math id="m12">
<mml:mi>k</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:math>
</inline-formula> and a real-valued function <italic>c</italic>(<italic>v</italic>
<sub>0</sub>, &#x2026;, <italic>v</italic>
<sub>
<italic>N</italic>&#x2212;1</sub>), or it is an inequality<disp-formula id="e5">
<mml:math id="m13">
<mml:mi>c</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2264;</mml:mo>
<mml:mi>k</mml:mi>
<mml:mo>.</mml:mo>
</mml:math>
<label>(5)</label>
</disp-formula>
</p>
<p>The goal for an optimization problem <italic>O</italic> &#x3d; (<italic>V</italic>, <italic>f</italic>, <italic>C</italic>) is to find an extreme value <italic>y</italic>
<sub>
<italic>ex</italic>
</sub> of <italic>f</italic>, such that all of the constraints are satisfied at <italic>y</italic>
<sub>
<italic>ex</italic>
</sub>.</p>
<p>Discrete optimization problems can often be stated in terms of graphs or hypergraphs (<xref ref-type="bibr" rid="B5">Berge, 1987</xref>). A <italic>graph</italic> is a pair (<italic>V</italic>, <italic>E</italic>), where <italic>V</italic> is a finite set of <italic>vertices</italic> or <italic>nodes</italic> and <inline-formula id="inf9">
<mml:math id="m14">
<mml:mi>E</mml:mi>
<mml:mo>&#x2282;</mml:mo>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mspace width="0.17em"/>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mspace width="0.17em"/>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2260;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>V</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> is the set of edges. An element <inline-formula id="inf10">
<mml:math id="m15">
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>E</mml:mi>
</mml:math>
</inline-formula> is called an <italic>edge</italic> between vertex <italic>v</italic>
<sub>
<italic>i</italic>
</sub> and vertex <italic>v</italic>
<sub>
<italic>j</italic>
</sub>. Note that a graph defined like this can neither have loops, i.e., edges beginning and ending at the same vertex, nor can there be multiple edges between the same pair of vertices. Given a graph <italic>G</italic> &#x3d; (<italic>V</italic>, <italic>E</italic>), its <italic>adjacency matrix</italic> is the symmetric binary &#x7c;<italic>V</italic>&#x7c;&#xd7;&#x7c;<italic>V</italic>&#x7c; matrix <italic>A</italic> with entries<disp-formula id="e6">
<mml:math id="m16">
<mml:msub>
<mml:mrow>
<mml:mi>A</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mtable class="cases">
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
<mml:mspace width="0.17em"/>
<mml:mspace width="1em"/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>if</mml:mtext>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>E</mml:mi>
<mml:mo>,</mml:mo>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mspace width="0.17em"/>
<mml:mspace width="1em"/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>else</mml:mtext>
<mml:mo>.</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(6)</label>
</disp-formula>
</p>
<p>A hypergraph is a generalization of a graph in which we allow edges to be adjacent to more than two vertices. That is, a <italic>hypergraph</italic> is a pair <italic>H</italic> &#x3d; (<italic>V</italic>, <italic>E</italic>), where <italic>V</italic> is a finite set of vertices and<disp-formula id="e7">
<mml:math id="m17">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>E</mml:mi>
<mml:mo>&#x2286;</mml:mo>
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x22c3;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>V</mml:mi>
<mml:mo stretchy="false">&#x7c;</mml:mo>
</mml:mrow>
</mml:munderover>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">{</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mo stretchy="false">}</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:mfenced>
<mml:mspace width="0.17em"/>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mspace width="0.17em"/>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>V</mml:mi>
<mml:mspace width="0.17em"/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mi mathvariant="normal">a</mml:mi>
<mml:mi mathvariant="normal">n</mml:mi>
<mml:mi mathvariant="normal">d</mml:mi>
<mml:mspace width="0.17em"/>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2260;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x2113;</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mspace width="0.17em"/>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right"/>
<mml:mtd columnalign="left">
<mml:mfenced open="" close="}">
<mml:mrow>
<mml:mo>&#x2200;</mml:mo>
<mml:mspace width="0.17em"/>
<mml:mi>k</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>&#x2113;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x22ef;</mml:mo>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(7)</label>
</disp-formula>is the set of hyperedges.</p>
<p>We reserve the word <italic>qubit</italic> for physical qubits. To go from an encoding-independent Hamiltonian to a quantum program, binary or spin variables become Pauli-z-matrices which act on the corresponding qubits.</p>
</sec>
<sec id="s3">
<title>3 Encodings library</title>
<p>For many problems, the cost function and the problem constraints can be represented in terms of two fundamental building blocks: the value of the integer variable <italic>v</italic> and the value indicator <inline-formula id="inf11">
<mml:math id="m18">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> defined in Eq. <xref ref-type="disp-formula" rid="e3">3</xref>. When expressed in terms of these building blocks, Hamiltonians are more compact, and recurring terms can be identified across many different problems. Moreover, quantum operators are not present at this stage: an encoding-independent Hamiltonian is just a cost function in terms of discrete variables, which eases access to quantum optimization to a wider audience. Encoding variables and the choice of quantum algorithms can come later.</p>
<p>Representation of the building blocks in terms of Ising operators depends on the chosen encoding. An encoding is a function that associates eigenvectors of the <italic>&#x3c3;</italic>
<sub>
<italic>z</italic>
</sub> operator with specific values of a discrete variable <italic>v</italic>:<disp-formula id="e8">
<mml:math id="m19">
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo stretchy="false">&#x232a;</mml:mo>
<mml:mo>&#x2192;</mml:mo>
<mml:mi>v</mml:mi>
<mml:mo>,</mml:mo>
<mml:mspace width="1em"/>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#xb1;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
</mml:math>
<label>(8)</label>
</disp-formula>where the spin variables <italic>s</italic>
<sub>
<italic>i</italic>
</sub> are the eigenvalues of <inline-formula id="inf12">
<mml:math id="m20">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> operators. The encodings are also usually defined in terms of binary variables <italic>x</italic>
<sub>
<italic>i</italic>
</sub> which are related to Ising variables according to Eq. <xref ref-type="disp-formula" rid="e2">2</xref>.</p>
<p>A summary of the encodings is presented in <xref ref-type="fig" rid="F1">Figure 1</xref>. Some encodings are <italic>dense</italic>, in the sense that every quantum state &#x7c;<italic>s</italic>
<sub>0</sub>, <italic>&#x2026;</italic>, <italic>s</italic>
<sub>
<italic>N</italic>&#x2212;1</sub>&#x27e9; encodes some value of the variable <italic>v</italic>. Other encodings are <italic>sparse</italic> because only a subset of the possible quantum states are valid states. The valid subset is generated by adding a core term<xref ref-type="fn" rid="fn2">
<sup>1</sup>
</xref>, i.e., a penalty term for constraints that need to be enforced in order to decode the variable uniquely in the Hamiltonian for every sparsely encoded variable. In general, dense encodings require fewer qubits, but sparse encodings have simpler expressions for the value indicator <inline-formula id="inf13">
<mml:math id="m21">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula>, and are therefore favorable for avoiding higher-order interactions. This is because <inline-formula id="inf14">
<mml:math id="m22">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> needs to check a smaller number of qubit states to know whether the variable <italic>v</italic> has value <italic>&#x3b1;</italic> or not, whereas dense encodings require the state of every qubit in the register (<xref ref-type="bibr" rid="B67">Sawaya et al., 2020</xref>; <xref ref-type="bibr" rid="B68">2022</xref>).</p>
<fig id="F1" position="float">
<label>FIGURE 1</label>
<caption>
<p>Summary of popular encodings of discrete variables in terms of binary <italic>x</italic>
<sub>
<italic>i</italic>
</sub> or Ising <italic>s</italic>
<sub>
<italic>i</italic>
</sub> variables. Each encoding has a particular representation of the value of the variable <italic>v</italic> and the value indicator <inline-formula id="inf15">
<mml:math id="m23">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula>. We also include a visualization example for each encoding, where the red circles represent excited qubits and <italic>&#x23;v</italic> is the range of variable <italic>v</italic> for the given number of qubits. If every quantum state in the register represents a valid value of <italic>v</italic>, the encoding is called <italic>dense</italic>. On the contrary, <italic>sparse encodings</italic> must include a core term in the Hamiltonian in order to represent a value of <italic>v</italic>. Sparse encodings have simpler representations of the value indicators than dense encodings, but the core term implementation demands extra interaction terms between the qubits. The cost of a Hamiltonian in terms of the number of qubits and interaction terms strongly depends on the chosen encoding and should be evaluated for every specific problem.</p>
</caption>
<graphic xlink:href="frqst-02-1229471-g001.tif"/>
</fig>
<sec id="s3-1">
<title>3.1 Binary encoding</title>
<p>Binary encoding uses the binary representation for encoding integer variables. Given an integer variable <inline-formula id="inf16">
<mml:math id="m24">
<mml:mi>v</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, we can use <italic>D</italic> binary variables <italic>x</italic>
<sub>
<italic>i</italic>
</sub> &#x2208; {0, 1} to represent <italic>v</italic>:<disp-formula id="e9">
<mml:math id="m25">
<mml:mi>v</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msup>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msup>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(9)</label>
</disp-formula>
</p>
<p>The value indicator <inline-formula id="inf17">
<mml:math id="m26">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> can be written using the generic expression<disp-formula id="e10">
<mml:math id="m27">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x2260;</mml:mo>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mfrac>
<mml:mrow>
<mml:mi>v</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:mfrac>
<mml:mo>,</mml:mo>
</mml:math>
<label>(10)</label>
</disp-formula>which is valid for every encoding. The expression for <inline-formula id="inf18">
<mml:math id="m28">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> in terms of boolean variables <italic>x</italic>
<sub>
<italic>i</italic>
</sub> can be written using that the value of <italic>&#x3b1;</italic> is codified in the bitstring (<italic>x</italic>
<sub>
<italic>&#x3b1;</italic>,0</sub>
<italic>&#x2026;</italic>, <italic>x</italic>
<sub>
<italic>&#x3b1;</italic>,<italic>D</italic>&#x2212;1</sub>). The value indicator <inline-formula id="inf19">
<mml:math id="m29">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> checks if the <italic>D</italic> binary variables <italic>x</italic>
<sub>
<italic>i</italic>
</sub> are equal to <italic>x</italic>
<sub>
<italic>&#x3b1;</italic>,<italic>i</italic>
</sub> to know if the variable <italic>v</italic> has the value <italic>&#x3b1;</italic> or not. We note that<disp-formula id="e11">
<mml:math id="m30">
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mtable class="cases">
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>1</mml:mn>
<mml:mspace width="2em"/>
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.28em"/>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mspace width="1em"/>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>0</mml:mn>
<mml:mspace width="2em"/>
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.28em"/>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2260;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mspace width="1em"/>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(11)</label>
</disp-formula>and so we write<disp-formula id="e12">
<mml:math id="m31">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right"/>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>,</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(12)</label>
</disp-formula>where<disp-formula id="e13">
<mml:math id="m32">
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>2</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:math>
<label>(13)</label>
</disp-formula>are the corresponding Ising variables. Thus, the maximum order of the interaction terms in <inline-formula id="inf20">
<mml:math id="m33">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> scales linearly with <italic>D</italic> and there are <inline-formula id="inf21">
<mml:math id="m34">
<mml:mfenced open="(" close=")">
<mml:mfrac linethickness="0.0pt">
<mml:mrow>
<mml:mi>D</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:mfrac>
</mml:mfenced>
</mml:math>
</inline-formula> terms of order <italic>k</italic>. The total number of terms is <inline-formula id="inf22">
<mml:math id="m35">
<mml:msub>
<mml:mrow>
<mml:mo movablelimits="false" form="prefix">&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mfrac linethickness="0.0pt">
<mml:mrow>
<mml:mi>D</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:mfrac>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula> and the number of interaction terms needed for a value indicator in binary encoding scales linearly with the maximum value of the variable <italic>N</italic> &#x3d; 2<sup>
<italic>D</italic>
</sup>.</p>
<p>If <italic>v</italic> &#x2208; {1, <italic>&#x2026;</italic>, <italic>K</italic>} with <inline-formula id="inf23">
<mml:math id="m36">
<mml:msup>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3c;</mml:mo>
<mml:mi>K</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mspace width="0.28em"/>
<mml:mi>D</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="double-struck">N</mml:mi>
</mml:math>
</inline-formula>, then we require <italic>D</italic> &#x2b; 1 binary variables to represent <italic>v</italic> and we will have 2<sup>
<italic>D</italic>&#x2b;1</sup> &#x2212; <italic>K</italic> invalid quantum states that do not represent any value of the variable <italic>v</italic>. The set of invalid states is<disp-formula id="e14">
<mml:math id="m37">
<mml:mi>R</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi mathvariant="bold">x</mml:mi>
<mml:mo stretchy="false">&#x232a;</mml:mo>
<mml:mfenced open="|" close="">
<mml:mrow>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msup>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msup>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>&#x3e;</mml:mo>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
<mml:mo>.</mml:mo>
</mml:math>
<label>(14)</label>
</disp-formula>for rejecting quantum states in <italic>R</italic>, we can force <italic>v</italic> &#x2264; <italic>K</italic>, which can be accomplished by adding a core term <italic>H</italic>
<sub>core</sub> in the Hamiltonian<disp-formula id="e15">
<mml:math id="m38">
<mml:msub>
<mml:mrow>
<mml:mi>H</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>core</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>K</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
</mml:math>
<label>(15)</label>
</disp-formula>or imposing the sum constraint<disp-formula id="e16">
<mml:math id="m39">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>core</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>K</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:math>
<label>(16)</label>
</disp-formula>
</p>
<p>The core term penalizes any state that represents an invalid value for variable <italic>v</italic>. Because core terms impose an additional energy scale, the performance can reduce when <inline-formula id="inf24">
<mml:math id="m40">
<mml:mi>K</mml:mi>
<mml:mo>&#x2260;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mspace width="0.28em"/>
<mml:mi>D</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="double-struck">N</mml:mi>
</mml:math>
</inline-formula>. In some cases, such as the Knapsack problem, penalties for invalid states can be included in the cost function, so there is no need to add a core term or constraints (<xref ref-type="bibr" rid="B71">Tamura et al., 2021</xref>) (<xref ref-type="sec" rid="s8-2-3">Section 8.2.3</xref>).</p>
<p>When encoding variables that can also take on negative values, e.g., <italic>v</italic> &#x2208; {&#x2212; <italic>K</italic>, &#x2212; <italic>K</italic> &#x2b; 1, &#x2026;, <italic>K</italic>&#x2032; &#x2212; 1, <italic>K</italic>&#x2032;}, in classical computing one often uses an extra bit that encodes the sign of the value. However, this might not be the best option because one spin flip could then change the value substantially and we do not assume full fault tolerance. For binary encoding there is a more suitable treatment of negative values: we can simply shift the values<disp-formula id="e17">
<mml:math id="m41">
<mml:mi>v</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msup>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msup>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>K</mml:mi>
<mml:mo>,</mml:mo>
</mml:math>
<label>(17)</label>
</disp-formula>where 2<sup>
<italic>D</italic>&#x2212;1</sup> &#x3c; <italic>K</italic> &#x2b; <italic>K</italic>&#x2032; &#x2264; 2<sup>
<italic>D</italic>
</sup>. The expression for the value indicator functions stays the same, only the encoding of the value <italic>&#x3b1;</italic> has to be adjusted. An additional advantage over using the sign bit is that ranges that are not symmetrical around zero (<italic>K</italic> &#x2260; <italic>K</italic>&#x2032;) can be encoded more efficiently. The same approach of shifting the variable by &#x2212;<italic>K</italic> can also be used for the other encodings.</p>
</sec>
<sec id="s3-2">
<title>3.2 Gray encoding</title>
<p>In binary representation, a single spin flip can lead to a sharp change in the value of <italic>v</italic>, for example, &#x7c;1000&#x27e9; codifies <italic>v</italic> &#x3d; 9 while &#x7c;0000&#x27e9; codifies <italic>v</italic> &#x3d; 1. To avoid this, Gray encoding reorders the binary representation in a way that two consecutive values of <italic>v</italic> always differ in a single spin flip. If we line up the potential values <italic>v</italic> &#x2208; [1, 2<sup>
<italic>D</italic>
</sup>] of an integer variable in a vertical sequence, this encoding in <italic>D</italic> boolean variables can be described as follows: on the <italic>i</italic>th boolean variable (which is the <italic>i</italic>th column from the right) the sequence starts with 2<sup>
<italic>i</italic>&#x2212;1</sup> zeros and continues with an alternating sequence of 2<sup>
<italic>i</italic>
</sup> 1s and 2<sup>
<italic>i</italic>
</sup> 0s. As an example, consider<disp-formula id="equ1">
<mml:math id="m42">
<mml:mtable class="align-star" columnalign="left">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mn>1</mml:mn>
<mml:mo>:</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mspace width="1em"/>
<mml:mn>0000</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mn>2</mml:mn>
<mml:mo>:</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mspace width="1em"/>
<mml:mn>0001</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mn>3</mml:mn>
<mml:mo>:</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mspace width="1em"/>
<mml:mn>0011</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mn>4</mml:mn>
<mml:mo>:</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mspace width="1em"/>
<mml:mn>0010</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mn>5</mml:mn>
<mml:mo>:</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mspace width="1em"/>
<mml:mn>0110</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mn>6</mml:mn>
<mml:mo>:</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mspace width="1em"/>
<mml:mn>0111</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mo>&#x2026;</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
</disp-formula>where <italic>D</italic> &#x3d; 4. On the left-hand side of each row of boolean variables, we have the value <italic>v</italic>. If we, for example, track the right-most boolean variable, we indeed find that it starts with 2<sup>1&#x2013;1</sup> &#x3d; 1 zero for the first value, 2<sup>1</sup> ones for the second and third values, 2<sup>1</sup> zeros for the third and fourth values, and so on.</p>
<p>The value indicator function and the core term remain unchanged except that the representation of, for example, <italic>&#x3b1;</italic> in the analog of Eq. <xref ref-type="disp-formula" rid="e12">12</xref> also has to be in Gray encoding.</p>
<p>An advantage of this encoding with regard to quantum algorithms is that single spin flips do not cause large changes in the cost function and thus smaller coefficients may be chosen (see discussion in <xref ref-type="sec" rid="s8">Section 8</xref>). The advantage of using Gray over one-hot encoding was recently demonstrated for quantum simulations of a deuteron (<xref ref-type="bibr" rid="B15">Di Matteo et al., 2021</xref>).</p>
</sec>
<sec id="s3-3">
<title>3.3 One-hot encoding</title>
<p>One-hot encoding is a sparse encoding that uses <italic>N</italic> binary variables <italic>x</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> to encode an <italic>N</italic>-valued variable <italic>v</italic>. The encoding is defined by its variable indicator:<disp-formula id="e18">
<mml:math id="m43">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
</mml:math>
<label>(18)</label>
</disp-formula>which means that <italic>v</italic> &#x3d; <italic>&#x3b1;</italic> if <italic>x</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> &#x3d; 1. The value of <italic>v</italic> is given by<disp-formula id="e19">
<mml:math id="m44">
<mml:mi>v</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mi>&#x3b1;</mml:mi>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>.</mml:mo>
</mml:math>
<label>(19)</label>
</disp-formula>
</p>
<p>The physically meaningful quantum states are those with a single qubit in state 1 and so the dynamics must be restricted to the subspace defined by<disp-formula id="e20">
<mml:math id="m45">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>core</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(20)</label>
</disp-formula>
</p>
<p>One option to impose this sum constraint is to encode it as an energy penalization with a core term in the Hamiltonian:<disp-formula id="e21">
<mml:math id="m46">
<mml:msub>
<mml:mrow>
<mml:mi>H</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>core</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>,</mml:mo>
</mml:math>
<label>(21)</label>
</disp-formula>which has minimum energy if only one <italic>x</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> is different from zero.</p>
</sec>
<sec id="s3-4">
<title>3.4 Domain-wall encoding</title>
<p>This encoding uses the position of a domain wall in an Ising chain to codify values of a variable <italic>v</italic> (<xref ref-type="bibr" rid="B10">Chancellor, 2019</xref>; <xref ref-type="bibr" rid="B6">Berwald et al., 2023</xref>). If the endpoints of an <italic>N</italic> &#x2b; 1 spin chain are fixed in opposite states, there must be at least one domain wall in the chain. Since the energy of a ferromagnetic Ising chain depends only on the number of domain walls it has and not on where they are located, an <italic>N</italic> &#x2b; 1 spin chain with fixed opposite endpoints has <italic>N</italic> possible ground states, depending on the position of the single domain wall.</p>
<p>The codification of a variable <italic>v</italic> &#x3d; 1, <italic>&#x2026;</italic>, <italic>N</italic> using domain wall encoding requires the core Hamiltonian <xref ref-type="bibr" rid="B10">Chancellor (2019)</xref>:<disp-formula id="e22">
<mml:math id="m47">
<mml:msub>
<mml:mrow>
<mml:mi>H</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>core</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>.</mml:mo>
</mml:math>
<label>(22)</label>
</disp-formula>Since the fixed endpoints of the chain do not need a spin representation (<italic>s</italic>
<sub>0</sub> &#x3d; &#x2212;1 and <italic>s</italic>
<sub>
<italic>N</italic>
</sub> &#x3d; 1), <italic>N</italic> &#x2212; 1 Ising variables <inline-formula id="inf25">
<mml:math id="m48">
<mml:msubsup>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">{</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mo stretchy="false">}</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> are sufficient for encoding a variable of <italic>N</italic> values. The minimum energy of <italic>H</italic>
<sub>core</sub> is 2 &#x2212; <italic>N</italic>, so the core term can be alternatively encoded as a sum constraint:<disp-formula id="e23">
<mml:math id="m49">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>core</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>2</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>N</mml:mi>
<mml:mo>.</mml:mo>
</mml:math>
<label>(23)</label>
</disp-formula>
</p>
<p>The variable indicator corroborates if there is a domain wall in the position <italic>&#x3b1;</italic>:<disp-formula id="e24">
<mml:math id="m50">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>,</mml:mo>
</mml:math>
<label>(24)</label>
</disp-formula>where <italic>s</italic>
<sub>0</sub> &#x2261; &#x2212; 1 and <italic>s</italic>
<sub>
<italic>N</italic>
</sub> &#x2261; 1, and the variable <italic>v</italic> can be written as<disp-formula id="e25">
<mml:math id="m51">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>v</mml:mi>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mi>&#x3b1;</mml:mi>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right"/>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>.</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(25)</label>
</disp-formula>
</p>
<p>Quantum annealing experiments using domain wall encoding have shown significant improvements in performance compared to one-hot encoding (<xref ref-type="bibr" rid="B12">Chen et al., 2021</xref>). This is partly because the required search space is smaller but also because domain-wall encoding generates a smoother energy landscape: in one-hot encoding, the minimum Hamming distance between two valid states is two, whereas in domain-wall, this distance is one. This implies that every valid quantum state in one-hot is a local minimum, surrounded by energy barriers generated by the core energy of Eq. <xref ref-type="disp-formula" rid="e21">21</xref>. As a consequence, the dynamics in domain-wall encoded problems freeze later in the annealing process because only one spin-flip is required to pass from one state to the other (<xref ref-type="bibr" rid="B6">Berwald et al., 2023</xref>).</p>
</sec>
<sec id="s3-5">
<title>3.5 Unary encoding</title>
<p>In unary encodings, a numerical value is represented by the number of repetitions of a symbol. In the context of quantum optimization, we can use the number of qubits in excited states to represent a discrete variable (<xref ref-type="bibr" rid="B66">Rosenberg et al., 2015</xref>; <xref ref-type="bibr" rid="B71">Tamura et al., 2021</xref>)<xref ref-type="fn" rid="fn3">
<sup>2</sup>
</xref>. In terms of binary variables <italic>x</italic>
<sub>
<italic>i</italic>
</sub>, we get:<disp-formula id="e26">
<mml:math id="m52">
<mml:mi>v</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
</mml:math>
<label>(26)</label>
</disp-formula>so <italic>N</italic> &#x2212; 1 binary variables <italic>x</italic>
<sub>
<italic>i</italic>
</sub> are needed for encoding an <italic>N</italic>-value variable. Unary encoding does not require a core term because every quantum state is a valid state. However, this encoding is not unique in the sense that each value of <italic>v</italic> has multiple representations.</p>
<p>A drawback of unary encoding (and every dense encoding) is that it requires information from all binary variables to determine the value of <italic>v</italic>. The value indicator <inline-formula id="inf26">
<mml:math id="m53">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> is<disp-formula id="e27">
<mml:math id="m54">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x2260;</mml:mo>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mfrac>
<mml:mrow>
<mml:mi>v</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:mfrac>
<mml:mo>,</mml:mo>
</mml:math>
<label>(27)</label>
</disp-formula>which involves 2<sup>
<italic>N</italic>
</sup> interaction terms. This exponential scaling in the number of terms is unfavorable, so unary encoding may be only convenient for variables that do not require value indicators <inline-formula id="inf27">
<mml:math id="m55">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> in the problem formulation, but only the variable value <italic>v</italic>. An example of this type of variable can be found in the clustering problem, as explained in <xref ref-type="sec" rid="s6">Section 6</xref>.</p>
<p>A performance comparison for the Knapsack problem using digital annealers showed that unary encoding can outperform binary and one-hot encoding and requires smaller energy scales (<xref ref-type="bibr" rid="B71">Tamura et al., 2021</xref>). The reasons for the high performance of unary encoding are still under investigation, but redundancy is believed to play an important role because it facilitates the annealer to find the ground state. As for domain-wall encoding (<xref ref-type="bibr" rid="B6">Berwald et al., 2023</xref>), the minimum Hamming distance between two valid states (i.e., the number of spin flips needed to pass from one valid state to another) could also explain the better performance of the unary encoding. Redundancy has also been pointed out as a potential problem with unary encodings since not all possible values have the same degeneracy and therefore results may be biased towards the most degenerate values (<xref ref-type="bibr" rid="B66">Rosenberg et al., 2015</xref>).</p>
</sec>
<sec id="s3-6">
<title>3.6 Block encodings</title>
<p>It is also possible to combine different approaches to obtain a balance between sparse and dense encodings (<xref ref-type="bibr" rid="B67">Sawaya et al., 2020</xref>). Block encodings are based on <italic>B</italic> blocks, each consisting of <italic>g</italic> binary variables. Similar to one-hot encoding, the valid states for block encodings are those states where only a single block contains non-zero binary variables. The binary variables in block <italic>b</italic>, <inline-formula id="inf28">
<mml:math id="m56">
<mml:msubsup>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">{</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mo stretchy="false">}</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>g</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> define a block value <italic>w</italic>
<sub>
<italic>b</italic>
</sub>, using a dense encoding such as binary, Gray, or unary. For example, if <italic>w</italic>
<sub>
<italic>b</italic>
</sub> is encoded using binary, we have<disp-formula id="e28">
<mml:math id="m57">
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>g</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msup>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msup>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(28)</label>
</disp-formula>The discrete variable <italic>v</italic> is defined by the active block <italic>b</italic> and its corresponding block value <italic>w</italic>
<sub>
<italic>b</italic>
</sub>,<disp-formula id="e29">
<mml:math id="m58">
<mml:mi>v</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>B</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mi>v</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>b</mml:mi>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
</mml:math>
<label>(29)</label>
</disp-formula>where <inline-formula id="inf29">
<mml:math id="m59">
<mml:mi>v</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>b</mml:mi>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> is the discrete value associated with the quantum state with active block <italic>b</italic> and block value <italic>&#x3b1;</italic>, and <inline-formula id="inf30">
<mml:math id="m60">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> is a value indicator that only needs to check the value of binary variables in block <italic>b</italic>. For each block, there are 2<sup>
<italic>g</italic>&#x2212;1</sup> possible values (assuming Gray or binary encoding for the block), because the all-zero state is not allowed (otherwise block <italic>b</italic> is not active). If the block value <italic>w</italic>
<sub>
<italic>b</italic>
</sub> is encoded using unary, then <italic>g</italic> values are possible. The expression of <inline-formula id="inf31">
<mml:math id="m61">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> depends on the encoding and is presented in the respective encoding section.</p>
<p>The value indicator for the variable <italic>v</italic> is the corresponding block value indicator. Suppose the discrete value <italic>v</italic>
<sub>0</sub> is encoded in the block <italic>b</italic> with a block variable <italic>w</italic>
<sub>
<italic>b</italic>
</sub> &#x3d; <italic>&#x3b1;</italic>:<disp-formula id="e30">
<mml:math id="m62">
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>v</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>b</mml:mi>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>.</mml:mo>
</mml:math>
<label>(30)</label>
</disp-formula>then the value indicator <inline-formula id="inf32">
<mml:math id="m63">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> is<disp-formula id="e31">
<mml:math id="m64">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(31)</label>
</disp-formula>
</p>
<p>A core term is necessary so that only qubits in a single block can be in the excited state. Defining <italic>t</italic>
<sub>
<italic>b</italic>
</sub> &#x3d; <italic>&#x2211;</italic>
<sub>
<italic>i</italic>
</sub>
<italic>x</italic>
<sub>
<italic>i</italic>,<italic>b</italic>
</sub>, the core terms results in<disp-formula id="e32">
<mml:math id="m65">
<mml:msub>
<mml:mrow>
<mml:mi>H</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>core</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
<mml:mo>&#x2260;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
</mml:math>
<label>(32)</label>
</disp-formula>or, as a sum constraint,<disp-formula id="e33">
<mml:math id="m66">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>core</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
<mml:mo>&#x2260;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(33)</label>
</disp-formula>
</p>
<p>The minimum value of <italic>H</italic>
<sub>core</sub> is zero. If the two blocks, <italic>b</italic> and <italic>b</italic>&#x2032;, have binary variables with values one, then <italic>t</italic>
<sub>
<italic>b</italic>
</sub>
<italic>t</italic>
<sub>
<italic>b</italic>&#x2032;</sub> &#x2260; 0 and the corresponding eigenstate of <italic>H</italic>
<sub>core</sub> is no longer the ground state.</p>
</sec>
</sec>
<sec id="s4">
<title>4 Parity architecture</title>
<p>The strong hardware limitations of noisy intermediate-scale quantum (NISQ) (<xref ref-type="bibr" rid="B63">Preskill, 2018</xref>) devices have made sparse encodings (especially one-hot) the standard approach to problem formulation. This is mainly because the basic building blocks (value and value indicator) are of linear or quadratic order in the spin variables in these encodings. The low connectivity of qubit platforms requires Hamiltonians in the QUBO formulation and high-order interactions are expensive when translated to QUBO <xref ref-type="bibr" rid="B41">Kochenberger et al. (2014)</xref>. However, different choices of encodings can significantly improve the performance of quantum algorithms (<xref ref-type="bibr" rid="B10">Chancellor, 2019</xref>; <xref ref-type="bibr" rid="B67">Sawaya et al., 2020</xref>; <xref ref-type="bibr" rid="B12">Chen et al., 2021</xref>; <xref ref-type="bibr" rid="B15">Di Matteo et al., 2021</xref>; <xref ref-type="bibr" rid="B71">Tamura et al., 2021</xref>), by reducing the search space or generating a smoother energy landscape.</p>
<p>One way this difference between encodings manifests itself is in the number of spin flips of physical qubits needed to change a variable into another valid value (<xref ref-type="bibr" rid="B6">Berwald et al., 2023</xref>). If this number is larger than one, there are local minima separated by invalid states penalized with a high cost which can impede the performance of the optimization. On the other hand, such an energy-landscape might offer some protection against errors (<xref ref-type="bibr" rid="B60">Pastawski and Preskill, 2016</xref>; <xref ref-type="bibr" rid="B26">Fellner et al., 2022</xref>). Furthermore, other fundamental aspects of the algorithms, such as circuit depth and energy scales can be greatly improved outside QUBO (<xref ref-type="bibr" rid="B20">Ender et al., 2022</xref>; <xref ref-type="bibr" rid="B18">Drieb-Sch&#xf6;n et al., 2023</xref>; <xref ref-type="bibr" rid="B25">Fellner et al., 2023</xref>; <xref ref-type="bibr" rid="B56">Messinger et al., 2023</xref>), prompting us to look for alternative formulations. The Parity Architecture is a paradigm for solving quantum optimization problems (<xref ref-type="bibr" rid="B45">Lechner et al., 2015</xref>; <xref ref-type="bibr" rid="B21">Ender et al., 2023</xref>) that does not rely on the QUBO formulation, allowing a wide number of options for formulating Hamiltonians. The architecture is based on the Parity transformation, which remaps Hamiltonians onto a 2D grid requiring only local connectivity of the qubits. The absence of long-range interactions enables high parallelizability of quantum algorithms and eliminates the need for costly and time-consuming SWAP gates, which helps to overcome two of the main obstacles of quantum computing: limited coherence time and the poor connectivity of qubits within a quantum register.</p>
<p>The Parity transformation creates a single Parity qubit for each interaction term in the (original) logical Hamiltonian:<disp-formula id="e34">
<mml:math id="m67">
<mml:msub>
<mml:mrow>
<mml:mi>J</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x22ef;</mml:mo>
<mml:mo>&#x2192;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>J</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mspace width="0.17em"/>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
</mml:math>
<label>(34)</label>
</disp-formula>where the interaction strength <italic>J</italic>
<sub>
<italic>i</italic>,<italic>j</italic>,&#x2026;</sub> is now the local field of the Parity qubit <inline-formula id="inf33">
<mml:math id="m68">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mspace width="0.17em"/>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula>. This facilitates addressing high-order interactions and frees the problem formulation from the QUBO approach. The equivalence between the original logical problem and the Parity-transformed problem is ensured by adding three- and four-body constraints and placing them on a 2D grid such that only neighboring qubits are involved in the constraints. The mapping of a logical problem into the regular grid of a Parity chip can be realized by the Parity compiler (<xref ref-type="bibr" rid="B21">Ender et al., 2023</xref>). Although the Parity compilation of the problem may require a larger number of physical qubits, the locality of interactions on the grid allows for higher parallelizability of quantum algorithms. This allows constant depth algorithms (<xref ref-type="bibr" rid="B46">Lechner, 2020</xref>; <xref ref-type="bibr" rid="B73">Unger et al., 2022</xref>) to be implemented with a smaller number of gates (<xref ref-type="bibr" rid="B25">Fellner et al., 2023</xref>).</p>
<p>The following toy example, summarized in <xref ref-type="fig" rid="F2">Figure 2</xref>, shows how a Parity-transformed Hamiltonian can be solved using a smaller number of qubits when the original Hamiltonian has high-order interactions. Given the logical Hamiltonian<disp-formula id="e35">
<mml:math id="m69">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>H</mml:mi>
<mml:mo>&#x3d;</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x2b;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>4</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right"/>
<mml:mtd columnalign="left">
<mml:mo>&#x2b;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>5</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x2b;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x2b;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>4</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>5</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(35)</label>
</disp-formula>the corresponding QUBO formulation requires seven qubits, including two ancillas for decomposing the three-body interactions, and the total number of two-body interactions is 14. The embedding of the QUBO problem on quantum hardware may require additional qubits and interactions depending on the chosen architecture. Instead, the Parity-transformed Hamiltonian only consists of six Parity qubits with local fields and two four-body interactions between close neighbors.</p>
<fig id="F2" position="float">
<label>FIGURE 2</label>
<caption>
<p>Example toy problem <italic>H</italic> involving high-order interactions that shows how the Parity architecture straightforwardly handles Hamiltonians beyond the QUBO formulation. The problem is represented by the hypergraph at the top of the figure. When decomposed into QUBO form, it requires 7 qubits and 14 two-body interactions, plus additional qubit overhead depending on the embedding. In contrast, the Parity compiler can remap this problem into a 2D grid that requires six qubits with local fields and four-body interactions, represented by the blue squares. No additional embedding is necessary if the hardware is designed for the Parity Architecture.</p>
</caption>
<graphic xlink:href="frqst-02-1229471-g002.tif"/>
</fig>
<p>It is not yet clear what the best Hamiltonian representation is for an optimization problem. The answer will probably depend strongly on the particular use case and will take into account not only the number of qubits needed but also the smoothness of the energy landscape, which has a direct impact on the performance of quantum algorithms (<xref ref-type="bibr" rid="B40">King et al., 2019</xref>).</p>
</sec>
<sec id="s5">
<title>5 Encoding constraints</title>
<p>In this section, we review how to implement the hard constraints associated with the problem, assuming that the encodings of the variables have already been chosen. Hard constraints <italic>c</italic>(<italic>v</italic>
<sub>1</sub>, <italic>&#x2026;</italic>, <italic>v</italic>
<sub>
<italic>N</italic>
</sub>) &#x3d; <italic>K</italic> often appear in optimization problems, limiting the search space and making problems even more difficult to solve. We consider polynomial constraints of the form<disp-formula id="e36">
<mml:math id="m70">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>c</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x2211;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right"/>
<mml:mtd columnalign="left">
<mml:mo>&#x2b;</mml:mo>
<mml:mo>&#x2211;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mo>&#x2211;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(36)</label>
</disp-formula>which remain polynomial after replacing the discrete variables <italic>v</italic>
<sub>
<italic>i</italic>
</sub> with any encoding. The coefficients <italic>g</italic>
<sub>
<italic>i</italic>
</sub>, <italic>g</italic>
<sub>
<italic>i</italic>,<italic>j</italic>
</sub>, &#x2026; depend on the problem and its constraints. Even if the original problem is unconstrained, the use of sparse encodings such as one-hot or domain wall imposes hard constraints on the quantum variables.</p>
<p>In general, constraints can be implemented dynamically (<xref ref-type="bibr" rid="B36">Hen and Sarandy, 2016</xref>; <xref ref-type="bibr" rid="B37">Hen and Spedalieri, 2016</xref>) (exploring only quantum states that satisfy the constraints) or as extra terms <italic>H</italic>
<sub>
<italic>c</italic>
</sub> in the Hamiltonian, such that eigenvectors of <italic>H</italic> are also eigenvectors of <italic>H</italic>
<sub>
<italic>c</italic>
</sub> and the ground states of <italic>H</italic>
<sub>
<italic>c</italic>
</sub> correspond to elements in the domain of <italic>f</italic> that satisfy the constraint. These can be incorporated as a penalty term <italic>H</italic>
<sub>
<italic>c</italic>
</sub> into the Hamiltonian that penalizes any state outside the desired subspace:<disp-formula id="e37">
<mml:math id="m71">
<mml:msub>
<mml:mrow>
<mml:mi>H</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi mathvariant="normal">c</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>A</mml:mi>
<mml:msup>
<mml:mrow>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mi>c</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>,</mml:mo>
</mml:math>
<label>(37)</label>
</disp-formula>or<disp-formula id="e38">
<mml:math id="m72">
<mml:msub>
<mml:mrow>
<mml:mi>H</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi mathvariant="normal">c</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>A</mml:mi>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mi>c</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>,</mml:mo>
</mml:math>
<label>(38)</label>
</disp-formula>in the special case that <italic>c</italic>(<italic>x</italic>
<sub>1</sub>, <italic>&#x2026;</italic>, <italic>x</italic>
<sub>
<italic>N</italic>
</sub>) &#x2265; <italic>K</italic> is satisfied. The constant <italic>A</italic> must be large enough to ensure that the ground state of the total Hamiltonian satisfies the constraint, but the implementation of large energy scales lowers the efficiency of quantum algorithms (<xref ref-type="bibr" rid="B44">Lanthaler and Lechner, 2021</xref>) and additionally imposes a technical challenge. Moreover, extra terms in the Hamiltonian imply additional overhead of computational resources, especially for squared terms such as in Eq. <xref ref-type="disp-formula" rid="e37">37</xref>. The determination of the optimal energy scale is an important open problem. For some of the problems in the library, we provide an estimation of the energy scales (<italic>cf.</italic> also <xref ref-type="sec" rid="s8-4-2">Section 8.4.2</xref>).</p>
<p>Quantum algorithms for finding the ground state of Hamiltonians, such as QAOA or quantum annealing, require driver terms <italic>U</italic>
<sub>drive</sub> &#x3d; exp(&#x2212;<italic>itH</italic>
<sub>drive</sub>) that spread the initial quantum state to the entire Hilbert space. Dynamical implementation of constraints employs a driver term that only explores the subspace of the Hilbert space that satisfies the constraints. Given an encoded constraint in terms of Ising operators <inline-formula id="inf34">
<mml:math id="m73">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula>:<disp-formula id="e39">
<mml:math id="m74">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>c</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x2211;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right"/>
<mml:mtd columnalign="left">
<mml:mo>&#x2b;</mml:mo>
<mml:mo>&#x2211;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x2b;</mml:mo>
<mml:mo>&#x22ef;</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>K</mml:mi>
<mml:mo>,</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(39)</label>
</disp-formula>a driver Hamiltonian <italic>H</italic>
<sub>drive</sub> that commutes with <inline-formula id="inf35">
<mml:math id="m75">
<mml:mi>c</mml:mi>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> will be restricted to the valid subspace provided the initial quantum state satisfies the constraint:<disp-formula id="e40">
<mml:math id="m76">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>c</mml:mi>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c8;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo stretchy="false">&#x232a;</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:mi>K</mml:mi>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c8;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo stretchy="false">&#x232a;</mml:mo>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:msub>
<mml:mrow>
<mml:mi>U</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>drive</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mspace width="0.28em"/>
<mml:mi>c</mml:mi>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c8;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo stretchy="false">&#x232a;</mml:mo>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>U</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>drive</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mspace width="0.28em"/>
<mml:mi>K</mml:mi>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c8;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo stretchy="false">&#x232a;</mml:mo>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>c</mml:mi>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>U</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>drive</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c8;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo stretchy="false">&#x232a;</mml:mo>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:mi>K</mml:mi>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>U</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>drive</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c8;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo stretchy="false">&#x232a;</mml:mo>
</mml:mrow>
</mml:mfenced>
<mml:mo>.</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(40)</label>
</disp-formula>
</p>
<p>In general, the construction of constraint-preserving drivers depends on the problem (<xref ref-type="bibr" rid="B36">Hen and Sarandy, 2016</xref>; <xref ref-type="bibr" rid="B37">Hen and Spedalieri, 2016</xref>; <xref ref-type="bibr" rid="B35">Hadfield et al., 2017</xref>; <xref ref-type="bibr" rid="B10">Chancellor, 2019</xref>; <xref ref-type="bibr" rid="B4">B&#xe4;rtschi and Eidenbenz, 2020</xref>; <xref ref-type="bibr" rid="B75">Wang et al., 2020</xref>; <xref ref-type="bibr" rid="B27">Fuchs et al., 2021</xref>; <xref ref-type="bibr" rid="B3">Bak&#xf3; et al., 2022</xref>). Approximate driver terms have been proposed that admit some degree of leakage and may be easier to construct (<xref ref-type="bibr" rid="B68">Sawaya et al., 2022</xref>). Within the Parity Architecture, each term of a polynomial constraint is a single Parity qubit (<xref ref-type="bibr" rid="B45">Lechner et al., 2015</xref>; <xref ref-type="bibr" rid="B21">Ender et al., 2023</xref>). This implies that for the Parity Architecture the polynomial constraints are simply the conservation of magnetization between the qubits involved:<disp-formula id="e41">
<mml:math id="m77">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x2b;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x2b;</mml:mo>
<mml:mo>&#x22ef;</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>K</mml:mi>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right"/>
<mml:mtd columnalign="left">
<mml:mo>&#x2192;</mml:mo>
<mml:mstyle>
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi mathvariant="bold">u</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi mathvariant="bold">u</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi mathvariant="bold">u</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>K</mml:mi>
<mml:mo>,</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(41)</label>
</disp-formula>where the Parity qubit <inline-formula id="inf36">
<mml:math id="m78">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi mathvariant="bold">u</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> represents the logical qubits product <inline-formula id="inf37">
<mml:math id="m79">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x2026;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> and we can sum over all these products that appear in the constraint <italic>c</italic>. A driver Hamiltonian based on exchange (or flip-flop) terms <inline-formula id="inf38">
<mml:math id="m80">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2b;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi mathvariant="bold">u</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi mathvariant="bold">w</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>h</mml:mi>
<mml:mo>.</mml:mo>
<mml:mi>c</mml:mi>
</mml:math>
</inline-formula>., summed over all pairs of products <bold>u</bold>, <bold>w</bold> &#x2208; <italic>c</italic>, preserves the total magnetization and explores the complete subspace where the constraint is satisfied (<xref ref-type="bibr" rid="B18">Drieb-Sch&#xf6;n et al., 2023</xref>). The decision tree for encoding constraints is presented in <xref ref-type="fig" rid="F3">Figure 3</xref>.</p>
<fig id="F3" position="float">
<label>FIGURE 3</label>
<caption>
<p>
<bold>(A)</bold> Decision tree to encode constraints, which can be implemented as energy penalizations in the problem Hamiltonian or dynamically by selecting a driver Hamiltonian that preserves the desired condition. For energy penalties (left figure), the driver term needs to explore the entire Hilbert space. In contrast, the dynamic implementation of the constraints (right figure) reduces the search space to the subspace satisfying the hard constraint, thus improving the performance of the algorithms. <bold>(B)</bold> Constrained logical problem (left) and its Parity representation where each term of the polynomial constraint is represented by a single Parity qubit (green qubits), so the polynomial constraints define a subspace in which the total magnetization of the involved qubits is preserved and which can be explored with an exchange driver <italic>&#x3c3;</italic>
<sub>&#x2b;</sub>
<italic>&#x3c3;</italic>
<sub>&#x2212;</sub> &#x2b; <italic>h</italic>.<italic>c</italic>. that preserves the total magnetization. Figure originally published in Ref. <xref ref-type="bibr" rid="B18">Drieb-Sch&#xf6;n et al. (2023)</xref>.</p>
</caption>
<graphic xlink:href="frqst-02-1229471-g003.tif"/>
</fig>
</sec>
<sec id="s6">
<title>6 Use case example</title>
<p>In this section, we present an example of the complete procedure to go from the encoding-independent formulation to the spin Hamiltonian that has to be implemented in the quantum computer, using an instance of the Clustering problem (<xref ref-type="sec" rid="s7-1-1">Section 7.1.1</xref>).</p>
<p>Every problem in this library includes a <italic>Problem description</italic>, indicating the required inputs for defining a problem instance. In the case of the clustering problem, a problem instance is defined from the number of clusters <italic>K</italic> we want to create, <italic>N</italic> objects with weights <italic>w</italic>
<sub>
<italic>i</italic>
</sub>, and distances <italic>d</italic>
<sub>
<italic>i</italic>,<italic>j</italic>
</sub> between the objects. Two different types of discrete variables are required, variables <italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x3d; 1, <italic>&#x2026;</italic>, <italic>K</italic> (<italic>i</italic> &#x3d; 1, <italic>&#x2026;</italic>, <italic>N</italic>) indicate to which of the <italic>K</italic> possible clusters the node <italic>i</italic> is assigned, and variables <italic>y</italic>
<sub>
<italic>j</italic>
</sub> &#x3d; 1, <italic>&#x2026;</italic>, <italic>W</italic>
<sub>max</sub> track the weight in cluster <italic>j</italic>.</p>
<p>The cost function of the problem only depends on <inline-formula id="inf39">
<mml:math id="m81">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula>, the value indicators of variables <italic>v</italic>
<sub>
<italic>i</italic>
</sub>. In this case, <inline-formula id="inf40">
<mml:math id="m82">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> indicates whether the node associated with the discrete variable <italic>v</italic>
<sub>
<italic>i</italic>
</sub> belongs to the cluster <italic>k</italic> or not. If two nodes <italic>i</italic>, <italic>j</italic> belong to the same cluster <italic>k</italic>, then the cost function increases by <italic>d</italic>
<sub>
<italic>i</italic>,<italic>j</italic>
</sub>, giving the total cost function:<disp-formula id="e42">
<mml:math id="m83">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(42)</label>
</disp-formula>We can choose any encoding for the variables <italic>v</italic>
<sub>
<italic>i</italic>
</sub>. For example, if we decide to use binary or Gray encoding, a variable <italic>v</italic>
<sub>
<italic>i</italic>
</sub> requires <italic>D</italic> &#x3d; log<sub>2</sub>(<italic>K</italic>) qubits <inline-formula id="inf41">
<mml:math id="m84">
<mml:msubsup>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">{</mml:mo>
<mml:mrow>
<mml:msubsup>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
<mml:mo stretchy="false">}</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mrow>
<mml:mi>u</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula>(we assume <italic>K</italic> &#x3d; 2<sup>
<italic>D</italic>
</sup> for simplicity, but the resource estimate will not change significantly if this is not the case). From Eq. <xref ref-type="disp-formula" rid="e12">12</xref> we see that <inline-formula id="inf42">
<mml:math id="m85">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> is a polynomial of order <italic>D</italic> in variables <inline-formula id="inf43">
<mml:math id="m86">
<mml:msubsup>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> with <inline-formula id="inf44">
<mml:math id="m87">
<mml:mfenced open="(" close=")">
<mml:mfrac linethickness="0.0pt">
<mml:mrow>
<mml:mi>D</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:mfrac>
</mml:mfenced>
</mml:math>
</inline-formula> terms of order <italic>j</italic> and 2<sup>
<italic>D</italic>
</sup> &#x3d; <italic>K</italic> terms in total, so the product <inline-formula id="inf45">
<mml:math id="m88">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> in the cost function will have 2<sup>
<italic>D</italic>
</sup> &#xd7; 2<sup>
<italic>D</italic>
</sup> &#x3d; 2<sup>2<italic>D</italic>
</sup> &#x3d; <italic>K</italic>
<sup>2</sup> terms, with orders between zero and 2<italic>D</italic>. This product is summed over all the <inline-formula id="inf46">
<mml:math id="m89">
<mml:mfrac>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:math>
</inline-formula> pairs <italic>i</italic>, <italic>j</italic>, so we can say that <inline-formula id="inf47">
<mml:math id="m90">
<mml:mi mathvariant="script">O</mml:mi>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:msup>
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> terms are required for the cost function. High-order interactions may be prohibitive for some hardware platforms, but if multiqubit gates are available, binary encoding offers an important reduction in the number of qubits.</p>
<p>Alternatively, we can choose a sparse encoding for the variables <italic>v</italic>
<sub>
<italic>i</italic>
</sub>. Using one-hot encoding, we need <italic>K</italic> qubits per node, so <italic>NK</italic> qubits are required for the cost function. The product <inline-formula id="inf48">
<mml:math id="m91">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> is just a two-qubit interaction <inline-formula id="inf49">
<mml:math id="m92">
<mml:msubsup>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula>, so the cost function requires <inline-formula id="inf50">
<mml:math id="m93">
<mml:mi mathvariant="script">O</mml:mi>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>K</mml:mi>
<mml:msup>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> terms. The <italic>K</italic> qubits associated with a variable <italic>v</italic>
<sub>
<italic>i</italic>
</sub> must satisfy the core constraint:<disp-formula id="e43">
<mml:math id="m94">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>u</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(43)</label>
</disp-formula>if this constraint is implemented as an energy penalization <inline-formula id="inf51">
<mml:math id="m95">
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula>, then <inline-formula id="inf52">
<mml:math id="m96">
<mml:mi mathvariant="script">O</mml:mi>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> terms are added to the spin Hamiltonian for each variable, so <inline-formula id="inf53">
<mml:math id="m97">
<mml:mi mathvariant="script">O</mml:mi>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:msup>
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> terms in total are associated with the constraint. The advantage of sparse encodings is that low-order interactions are needed for the value indicator functions (in this case, the maximum order is two).</p>
<p>Besides the core constraints associated with the encodings, the clustering problem includes <italic>K</italic> additional constraints (one per each cluster). The total weight of nodes in any cluster cannot exceed a problem instance specific maximal value <italic>W</italic>
<sub>max</sub>:<disp-formula id="e44">
<mml:math id="m98">
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x2264;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>W</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>max</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mspace width="1em"/>
<mml:mo>&#x2200;</mml:mo>
<mml:mspace width="0.17em"/>
<mml:mi>k</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mrow>
<mml:mo stretchy="false">{</mml:mo>
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>K</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">}</mml:mo>
</mml:mrow>
<mml:mo>.</mml:mo>
</mml:math>
<label>(44)</label>
</disp-formula>For the <italic>k</italic>th cluster, this constraint can be expressed in terms of auxiliary variables <italic>y</italic>
<sub>
<italic>k</italic>
</sub>:<disp-formula id="e45">
<mml:math id="m99">
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(45)</label>
</disp-formula>Variables <italic>y</italic>
<sub>
<italic>k</italic>
</sub> are discrete variables in the range 0, <italic>&#x2026;</italic>, <italic>W</italic>
<sub>max</sub>. Because the value indicators of <italic>y</italic>
<sub>
<italic>k</italic>
</sub> are not necessary for the constraints, we can use a dense encoding such as binary without dealing with the high-order interactions associated with value indicators of dense encodings. The variables <italic>y</italic>
<sub>
<italic>k</italic>
</sub> require <italic>K</italic>&#x2009;log<sub>2</sub>(<italic>W</italic>
<sub>max</sub>) qubits if we use binary encoding, or <italic>KW</italic>
<sub>max</sub> if we use one-hot. These constraints can also be implemented as energy penalizations in the Hamiltonian or can be encoded in the driver term.</p>
<p>The complete procedure for obtaining the spin Hamiltonian is outlined in <xref ref-type="fig" rid="F4">Figure 4</xref>. We emphasize that the optimal encodings and constraint implementations depend on the details of the hardware, such as native gates, connectivity, and the number of qubits. Moreover, the efficiency of quantum algorithms is also related to the smoothness of the energy landscape, and some encodings can provide better results even though they require more qubits (see, for example, <xref ref-type="bibr" rid="B71">Tamura et al., 2021</xref>).</p>
<fig id="F4" position="float">
<label>FIGURE 4</label>
<caption>
<p>Example decision tree for the clustering problem. The entire process is presented in four different blocks and the decisions taken are highlighted in green. The formulation of a problem instance requires the discrete variables <italic>v</italic>
<sub>
<italic>i</italic>
</sub> and <italic>y</italic>
<sub>
<italic>k</italic>
</sub> to be encoded in terms of qubit operators. In this example, the <italic>v</italic>
<sub>
<italic>i</italic>
</sub> variables are encoded using the one-hot encoding while for the <italic>y</italic>
<sub>
<italic>k</italic>
</sub> variables we use the binary encoding. The Hamiltonian is obtained by substituting in the encoding-independent expressions of Eqs <xref ref-type="disp-formula" rid="e48">48</xref>, <xref ref-type="disp-formula" rid="e50">50</xref> the discrete variables <italic>v</italic>
<sub>
<italic>i</italic>
</sub>, <italic>y</italic>
<sub>
<italic>k</italic>
</sub> and the value indicators <inline-formula id="inf54">
<mml:math id="m100">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> according to the chosen encoding. Core terms associated with sparse encodings (one-hot in this case) and the problem constraints can be added to the Hamiltonian as energy penalizations or implemented dynamically in the driver term of the quantum algorithm as sum constraints.</p>
</caption>
<graphic xlink:href="frqst-02-1229471-g004.tif"/>
</fig>
</sec>
<sec id="s7">
<title>7 Problem library</title>
<p>The problems included in the library are classified into four categories: subsets, partitions, permutations, and continuous variables. These categories are defined by the role of the discrete variable and are intended to organize the library and make it easier to find problems but also to serve as a basis for the formulation of similar use cases. An additional category in <xref ref-type="sec" rid="s7-5">Section 7.5</xref> contains problems that do not fit into the previous categories but may also be important use cases for quantum algorithms. In <xref ref-type="sec" rid="s8">Section 8</xref> we include a summary of recurrent encoding-independent building blocks that are used throughout the library and could be useful in formulating new problems.</p>
<sec id="s7-1">
<title>7.1 Partitioning problems</title>
<p>The goal of partitioning problems is to look for partitions of a set <italic>U</italic>, minimizing a cost function <italic>f</italic>. A partition <italic>P</italic> of <italic>U</italic> is a set <inline-formula id="inf55">
<mml:math id="m101">
<mml:mi>P</mml:mi>
<mml:mo>:</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>U</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula> of subsets <italic>U</italic>
<sub>
<italic>k</italic>
</sub> &#x2282; <italic>U</italic>, such that <inline-formula id="inf56">
<mml:math id="m102">
<mml:mi>U</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mo>&#x22c3;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msub>
<mml:mrow>
<mml:mi>U</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula> and <italic>U</italic>
<sub>
<italic>k</italic>
</sub> &#x2229; <italic>U</italic>
<sub>
<italic>k</italic>&#x2032;</sub> &#x3d; 0 if <italic>k</italic> &#x2260; <italic>k</italic>&#x2032;. Partitioning problems require a discrete variable <italic>v</italic>
<sub>
<italic>i</italic>
</sub> for each element <italic>u</italic>
<sub>
<italic>i</italic>
</sub> &#x2208; <italic>U</italic>. The value of <italic>v</italic>
<sub>
<italic>i</italic>
</sub> indicates to which subset the element belongs, so <italic>v</italic>
<sub>
<italic>i</italic>
</sub> can take <italic>K</italic> different values. Values assigned to the subsets are arbitrary, therefore the value of <italic>v</italic>
<sub>
<italic>i</italic>
</sub> is usually not important in these cases, but only the value indicator <inline-formula id="inf57">
<mml:math id="m103">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> is needed, so sparse encodings may be convenient for these variables.</p>
<sec id="s7-1-1">
<title>7.1.1 Clustering problem</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> Let <inline-formula id="inf58">
<mml:math id="m104">
<mml:mi>U</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> be a set of <italic>N</italic> elements, characterized by weights <italic>w</italic>
<sub>
<italic>i</italic>
</sub> &#x2208; {1, &#x2026;, <italic>w</italic>
<sub>max</sub>} and distances <italic>d</italic>
<sub>
<italic>i</italic>,<italic>j</italic>
</sub> between them. The clustering problem looks for a partition of the set <italic>U</italic> into <italic>K</italic> non-empty subsets <italic>U</italic>
<sub>
<italic>k</italic>
</sub> that minimizes the distance between vertices in each subset. Partitions are subject to a weight restriction: for every subset <italic>U</italic>
<sub>
<italic>k</italic>
</sub>, the sum of the weights of the vertices in the subset must not exceed a given maximum weight <italic>W</italic>
<sub>max</sub>.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> We can define a variable <italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x3d; 1, <italic>&#x2026;</italic>, <italic>K</italic> for each element in <italic>U</italic>. We also require an auxiliary variable <italic>y</italic>
<sub>
<italic>j</italic>
</sub> &#x3d; 0, 1, <italic>&#x2026;</italic>, <italic>W</italic>
<sub>max</sub> per subset <italic>U</italic>
<sub>
<italic>k</italic>
</sub>, that indicates the total weight of the elements in <italic>U</italic>
<sub>
<italic>k</italic>
</sub>:</p>
</list-item>
</list>
<disp-formula id="e46">
<mml:math id="m105">
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>:</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>U</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>.</mml:mo>
</mml:math>
<label>(46)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>c. <italic>Constraints</italic> The weight restriction is an inequality constraint:</p>
</list-item>
</list>
<disp-formula id="e47">
<mml:math id="m106">
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2264;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>W</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>max</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
</mml:math>
<label>(47)</label>
</disp-formula>which can be expressed as:<disp-formula id="e48">
<mml:math id="m107">
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(48)</label>
</disp-formula>if the encoding for the auxiliary variables makes it necessary (e.g., a binary encoding and <italic>W</italic>
<sub>max</sub> not a power of 2), this constraint must be shifted as is described in <xref ref-type="sec" rid="s8-2-3">Section 8.2.3</xref>.<list list-type="simple">
<list-item>
<p>d. <italic>Cost function</italic> The sum of the distances of the elements of a subset is:</p>
</list-item>
</list>
<disp-formula id="e49">
<mml:math id="m108">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>:</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>U</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
</mml:math>
<label>(49)</label>
</disp-formula>and the cost function results:<disp-formula id="e50">
<mml:math id="m109">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>.</mml:mo>
</mml:math>
<label>(50)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>e. <italic>References</italic> Studied by <xref ref-type="bibr" rid="B24">Feld et al. (2019)</xref> as part of the Capacitated Vehicle Routing problem.</p>
</list-item>
</list>
</p>
</sec>
<sec id="s7-1-2">
<title>7.1.2 Number partitioning</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> Given a set <italic>U</italic> of <italic>N</italic> real numbers <italic>u</italic>
<sub>
<italic>i</italic>
</sub>, we can look for a partition of size <italic>K</italic> such that the sum of the numbers in each subset is as homogeneous as possible.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> The problem requires <italic>N</italic> variables <italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x2208; [1, <italic>K</italic>], one per element <italic>u</italic>
<sub>
<italic>i</italic>
</sub>. The value of <italic>v</italic>
<sub>
<italic>i</italic>
</sub> indicates to which subset <italic>u</italic>
<sub>
<italic>i</italic>
</sub> belongs.</p>
</list-item>
<list-item>
<p>c. <italic>Cost function</italic> The partial sums can be represented using the value indicators associated with the variables <italic>v</italic>
<sub>
<italic>j</italic>
</sub>:</p>
</list-item>
</list>
<disp-formula id="e51">
<mml:math id="m110">
<mml:msub>
<mml:mrow>
<mml:mi>p</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>U</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(51)</label>
</disp-formula>there are three common approaches for finding the optimal partition: maximizing the minimum partial sum, minimizing the largest partial sum, or minimizing the difference between the maximum and the minimum partitions. The latter option can be formulated as<disp-formula id="e52">
<mml:math id="m111">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>p</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>p</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(52)</label>
</disp-formula>
</p>
<p>In order to minimize the maximum partial sum (maximizing the minimum partial sum is done analogously) we can introduce an auxiliary variable <italic>l</italic> that can take values 1, &#x2026;, <italic>&#x2211;</italic>
<sub>
<italic>i</italic>
</sub>
<italic>u</italic>
<sub>
<italic>i</italic>
</sub> &#x2261; <italic>l</italic>
<sub>max</sub>. Depending on the problem instance the range of <italic>l</italic> can be restricted further. The first term in the cost function<disp-formula id="e53">
<mml:math id="m112">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>max</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mi mathvariant="normal">&#x398;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>l</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>p</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>l</mml:mi>
</mml:math>
<label>(53)</label>
</disp-formula>then enforces that <italic>l</italic> is as least as large as the maximum <italic>p</italic>
<sub>
<italic>i</italic>
</sub> (<xref ref-type="sec" rid="s8-1-3">Section 8.1.3</xref>) and the second term minimizes <italic>l</italic>. The theta step function can be expressed in terms of the value indicator functions according to the building block Eq. <xref ref-type="disp-formula" rid="e144">144</xref> by either introducing auxiliary variables or expressing the value indicators directly according to the discussion in <xref ref-type="sec" rid="s8-4-1">Section 8.4.1</xref>.<list list-type="simple">
<list-item>
<p>d. <italic>Special cases</italic> For <italic>K</italic> &#x3d; 2, the cost function that minimizes the difference between the partial sums is</p>
</list-item>
</list>
<disp-formula id="e54">
<mml:math id="m113">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>f</mml:mi>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>p</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>p</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right"/>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>.</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(54)</label>
</disp-formula>The only two possible outcomes for <inline-formula id="inf59">
<mml:math id="m114">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> are &#xb1;1, so these factors can be trivially encoded using spin variables <italic>s</italic>
<sub>
<italic>i</italic>
</sub> &#x3d; &#xb1;1, leading to<disp-formula id="e55">
<mml:math id="m115">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>.</mml:mo>
</mml:math>
<label>(55)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>e. <italic>References</italic> The Hamiltonian formulation for <italic>K</italic> &#x3d; 2 can be found in <xref ref-type="bibr" rid="B49">Lucas (2014)</xref>.</p>
</list-item>
</list>
</p>
</sec>
<sec id="s7-1-3">
<title>7.1.3 Graph coloring</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> The nodes of the graph <italic>G</italic> &#x3d; (<italic>V</italic>, <italic>E</italic>) are divided into <italic>K</italic> different subsets, each one representing a different color. We can look for a partition in which two adjacent nodes are painted with different colors and which minimizes the number of colors used.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> We define a variable <italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x3d; 1&#x2026;<italic>K</italic> for each node <italic>i</italic> &#x3d; 1, &#x2026;, <italic>N</italic> in the graph.</p>
</list-item>
<list-item>
<p>c. <italic>Constraints</italic> We must penalize solutions for which two adjacent nodes are painted with the same color. The cost function of the graph partitioning problem presented in Eq. <xref ref-type="disp-formula" rid="e61">61</xref> can be used for the constraint of graph coloring. In that case, <inline-formula id="inf60">
<mml:math id="m116">
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>&#x3b4;</mml:mi>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:mfenced>
<mml:msub>
<mml:mrow>
<mml:mi>A</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula> was used to count the number of adjacent nodes belonging to different subsets, now we can use <italic>&#x3b4;</italic>(<italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x2212; <italic>v</italic>
<sub>
<italic>j</italic>
</sub>)<italic>A</italic>
<sub>
<italic>i</italic>,<italic>j</italic>
</sub> to indicate if nodes <italic>i</italic> and <italic>j</italic> are painted with the same color. Therefore the constraint is (see building block <xref ref-type="sec" rid="s8-2-1">Section 8.2.1</xref>)</p>
</list-item>
</list>
<disp-formula id="e56">
<mml:math id="m117">
<mml:mi>c</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mi>&#x3b4;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:msub>
<mml:mrow>
<mml:mi>A</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(56)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>d. <italic>Cost function</italic> The decision problem (&#x201c;Is there a coloring that uses <italic>K</italic> colors?&#x201d;) can be answered by implementing the constraint as a Hamiltonian <italic>H</italic> &#x3d; <italic>c</italic> (note that <italic>c</italic> &#x2265; 0). The existence of a solution with zero energy implies that a coloring with <italic>K</italic> colors exists.</p>
</list-item>
</list>
</p>
<p>Alternatively we can look for the coloring that uses the minimum number of colors. To check if a color <italic>&#x3b1;</italic> is used, we can use the following term (see building block <xref ref-type="sec" rid="s8-2-2">Section 8.2.2</xref>):<disp-formula id="e57">
<mml:math id="m118">
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
<mml:mo>,</mml:mo>
</mml:math>
<label>(57)</label>
</disp-formula>which is one if and only if color <italic>&#x3b1;</italic> is not used in the coloring, and 0 if at least one node is painted with color <italic>&#x3b1;</italic>. The number of colors used in the coloring is the cost function of the problem:<disp-formula id="e58">
<mml:math id="m119">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>.</mml:mo>
</mml:math>
<label>(58)</label>
</disp-formula>
</p>
<p>This objective function can be very expensive to implement since <italic>u</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> includes products of <inline-formula id="inf61">
<mml:math id="m120">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> of order <italic>N</italic>, so a good estimation of the minimum number <italic>K</italic>
<sub>min</sub> would be useful to avoid using an unnecessarily large <italic>K</italic>.<list list-type="simple">
<list-item>
<p>e. <italic>References</italic> The one-hot encoded version of this problem can be found in <xref ref-type="bibr" rid="B49">Lucas (2014)</xref>.</p>
</list-item>
</list>
</p>
</sec>
<sec id="s7-1-4">
<title>7.1.4 Graph partitioning</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> Graph partitioning divides the nodes of a graph <italic>G</italic> &#x3d; (<italic>V</italic>, <italic>E</italic>) into <italic>K</italic> different subsets, so that the number of edges connecting nodes in different subsets (cut edges) is minimized or maximized.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> We can use one discrete variable <italic>v</italic>
<sub>
<italic>k</italic>
</sub> &#x3d; 1, <italic>&#x2026;</italic>, <italic>K</italic> per node in the graph, which indicates to which partition the node belongs.</p>
</list-item>
<list-item>
<p>c. <italic>Cost function</italic> An edge connecting two nodes <italic>i</italic> and <italic>j</italic> is cut when <italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x2260; <italic>v</italic>
<sub>
<italic>j</italic>
</sub>. It is convenient to use the symbol (see building block <xref ref-type="sec" rid="s8-1-4">Section 8.1.4</xref>):</p>
</list-item>
</list>
<disp-formula id="e59">
<mml:math id="m121">
<mml:mi>&#x3b4;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mtable class="cases">
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>1</mml:mn>
<mml:mspace width="0.28em"/>
<mml:mspace width="0.28em"/>
<mml:mspace width="0.28em"/>
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.17em"/>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mspace width="1em"/>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>0</mml:mn>
<mml:mspace width="0.28em"/>
<mml:mspace width="0.28em"/>
<mml:mspace width="0.28em"/>
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.17em"/>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2260;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mspace width="1em"/>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
<mml:mo>,</mml:mo>
</mml:math>
<label>(59)</label>
</disp-formula>which is equal to 1 when nodes <italic>i</italic> and <italic>j</italic> belong to the same partition (<italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x3d; <italic>v</italic>
<sub>
<italic>j</italic>
</sub>) and zero when not (<italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x2260; <italic>v</italic>
<sub>
<italic>j</italic>
</sub>). In this way, the term:<disp-formula id="e60">
<mml:math id="m122">
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>&#x3b4;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
<mml:msub>
<mml:mrow>
<mml:mi>A</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
<label>(60)</label>
</disp-formula>is equal to 1 if there is a cut edge connecting nodes <italic>i</italic> and <italic>j</italic>, being <italic>A</italic>
<sub>
<italic>i</italic>,<italic>j</italic>
</sub> the adjacency matrix of the graph. The cost function for minimizing the number of cut edges is obtained by summing over all the nodes:<disp-formula id="e61">
<mml:math id="m123">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>&#x3b4;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
<mml:msub>
<mml:mrow>
<mml:mi>A</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
</mml:math>
<label>(61)</label>
</disp-formula>or alternatively &#x2212;<italic>f</italic> to maximize the number of cut edges.<list list-type="simple">
<list-item>
<p>d. <italic>Constraints</italic> A common constraint imposes that partitions have a specific size. The element counting building block <xref ref-type="sec" rid="s8-1-1">Section 8.1.1</xref> is defined as</p>
</list-item>
</list>
<disp-formula id="e62">
<mml:math id="m124">
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>V</mml:mi>
<mml:mo stretchy="false">&#x7c;</mml:mo>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(62)</label>
</disp-formula>If we want the partition <italic>&#x3b1;</italic> to have <italic>L</italic> elements, then<disp-formula id="e63">
<mml:math id="m125">
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>L</mml:mi>
</mml:math>
<label>(63)</label>
</disp-formula>must hold. If we want the two partitions, <italic>&#x3b1;</italic> and <italic>&#x3b2;</italic>, to have the same size, then the constraint is<disp-formula id="e64">
<mml:math id="m126">
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b2;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
</mml:math>
<label>(64)</label>
</disp-formula>and all the partitions will have the same size, imposing<disp-formula id="e65">
<mml:math id="m127">
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:math>
<label>(65)</label>
</disp-formula>which is only possible if &#x7c;<italic>V</italic>&#x7c;/<italic>K</italic> is a natural number.<list list-type="simple">
<list-item>
<p>e. <italic>References</italic> The Hamiltonian for <italic>K</italic> &#x3d; 2 can be found in <xref ref-type="bibr" rid="B49">Lucas (2014)</xref>.</p>
</list-item>
<list-item>
<p>f. <italic>Hypergraph partitioning</italic> The problem formulation can be extended to hypergraphs. A hyperedge is cut when it contains vertices from at least two different subsets. Given a hyperedge <italic>e</italic> of <italic>G</italic>, the function</p>
</list-item>
</list>
<disp-formula id="e66">
<mml:math id="m128">
<mml:mi mathvariant="normal">c</mml:mi>
<mml:mi mathvariant="normal">u</mml:mi>
<mml:mi mathvariant="normal">t</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>e</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>e</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mi>&#x3b4;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(66)</label>
</disp-formula>is only equal to 1 if all the vertices included in <italic>e</italic> belong to the same partition, and zero in any other case. The product over the vertices <italic>i</italic>, <italic>j</italic> of the edge <italic>e</italic> only needs to involve pairs such that every vertex appears at least once. The optimization objective of minimizing the cut hyperedges is implemented by the sum of penalties<disp-formula id="e67">
<mml:math id="m129">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>f</mml:mi>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mi mathvariant="normal">c</mml:mi>
<mml:mi mathvariant="normal">u</mml:mi>
<mml:mi mathvariant="normal">t</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>e</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right"/>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>e</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
<mml:mo>.</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(67)</label>
</disp-formula>This objective function penalizes all possible cuts in the same way, regardless of the number of vertices cut or the number of partitions to which an edge belongs.</p>
</sec>
<sec id="s7-1-5">
<title>7.1.5 Clique cover</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> Given a graph <italic>G</italic> &#x3d; (<italic>V</italic>, <italic>E</italic>), we seek the minimum number of colors <italic>K</italic> for coloring all vertices such that the subsets <italic>W</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> of vertices with the color <italic>&#x3b1;</italic> together with the edge set <italic>E</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> restricted to edges between vertices in <italic>W</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> form complete graphs. A subproblem is to decide if there is a clique cover using <italic>K</italic> colors.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> For each vertex <italic>i</italic> &#x3d; 1, <italic>&#x2026;</italic>, <italic>N</italic> we define variables <italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x3d; 1, <italic>&#x2026;</italic>, <italic>K</italic> indicating the color that vertex is assigned to. If the number of colors is not given, one has to start with an initial guess or a minimal value for <italic>K</italic>.</p>
</list-item>
<list-item>
<p>c. <italic>Constraints</italic> In this problem, <italic>G</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> &#x3d; (<italic>W</italic>
<sub>
<italic>&#x3b1;</italic>
</sub>, <italic>E</italic>
<sub>
<italic>&#x3b1;</italic>
</sub>) has to be a complete graph, so the maximum number of edges in <italic>E</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> must be present. Using the element counting building block, we can calculate the number of vertices with color <italic>&#x3b1;</italic> (see bulding block <xref ref-type="sec" rid="s8-1-1">Section 8.1.1</xref>):</p>
</list-item>
</list>
<disp-formula id="e68">
<mml:math id="m130">
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(68)</label>
</disp-formula>if <italic>G</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> is a complete graph, then the number of edges in <italic>E</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> is <italic>t</italic>
<sub>
<italic>&#x3b1;</italic>
</sub>(<italic>t</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> &#x2212; 1)/2 and thus the constraint reads<disp-formula id="e69">
<mml:math id="m131">
<mml:mi>c</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(69)</label>
</disp-formula>
</p>
<p>Note that we do not have to square the term as it can never be negative.<list list-type="simple">
<list-item>
<p>d. <italic>Cost function</italic> The decision problem (&#x201c;Is there a clique cover using <italic>K</italic> colors?&#x201d;) can be answered using the constraint <italic>c</italic> as the Hamiltonian of the problem. For finding the minimum number of colors <italic>K</italic>
<sub>min</sub> for which a clique cover exists (the <italic>clique cover number</italic>), we can add a cost function for minimizing <italic>K</italic>. As in the graph coloring problem, we can minimize the number of colors using</p>
</list-item>
</list>
<disp-formula id="e70">
<mml:math id="m132">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>,</mml:mo>
</mml:math>
<label>(70)</label>
</disp-formula>where<disp-formula id="e71">
<mml:math id="m133">
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(71)</label>
</disp-formula>indicates if the color <italic>&#x3b1;</italic> is used or not (see building block <xref ref-type="sec" rid="s8-2-2">Section 8.2.2</xref>).<list list-type="simple">
<list-item>
<p>e. <italic>References</italic> The one-hot encoded Hamiltonian of the decision problem can be found in <xref ref-type="bibr" rid="B49">Lucas (2014)</xref>.</p>
</list-item>
</list>
</p>
</sec>
</sec>
<sec id="s7-2">
<title>7.2 Constrained subset problems</title>
<p>Given a set <italic>U</italic>, we look for a non-empty subset <italic>U</italic>
<sub>0</sub> &#x2286; <italic>U</italic> that minimizes a cost function <italic>f</italic> while satisfying a set of constraints <italic>c</italic>
<sub>
<italic>i</italic>
</sub>. In general, these problems require a binary variable <italic>x</italic>
<sub>
<italic>i</italic>
</sub> per element in <italic>U</italic> which indicates if the element <italic>i</italic> is included or not in the subset <italic>U</italic>
<sub>0</sub>. Although binary variables are trivially encoded in single qubits, non-binary auxiliary variables may be necessary to formulate constraints, so the encoding-independent formulation of these problems is still useful.</p>
<sec id="s7-2-1">
<title>7.2.1 Cliques</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> A clique on a given graph <italic>G</italic> &#x3d; (<italic>V</italic>, <italic>E</italic>) is a subset of vertices <italic>W</italic> &#x2286; <italic>V</italic> such that <italic>W</italic> and the subset <italic>E</italic>
<sub>
<italic>W</italic>
</sub> of edges between vertices in <italic>W</italic> is a complete graph, i.e., the maximal possible number of edges in <italic>E</italic>
<sub>
<italic>W</italic>
</sub> is present. The goal is to find a clique with cardinality <italic>K</italic>. Additionally, one could ask what the largest clique of the graph is.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> We can define &#x7c;<italic>V</italic>&#x7c; binary variables <italic>x</italic>
<sub>
<italic>i</italic>
</sub> that indicate whether vertex <italic>i</italic> is in the clique or not.</p>
</list-item>
<list-item>
<p>c. <italic>Constraints</italic> This problem has two constraints, namely, that the cardinality of the clique is <italic>K</italic> and that the clique indeed has the maximum number of edges. The former is enforced by</p>
</list-item>
</list>
<disp-formula id="e72">
<mml:math id="m134">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>V</mml:mi>
<mml:mo stretchy="false">&#x7c;</mml:mo>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>K</mml:mi>
</mml:math>
<label>(72)</label>
</disp-formula>and the latter by<disp-formula id="e73">
<mml:math id="m135">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mi>K</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>K</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>.</mml:mo>
</mml:math>
<label>(73)</label>
</disp-formula>If constraints are implemented as energy penalization, one has to ensure that the first constraint is not violated to decrease the penalty for the second constraint. Using the cost/gain analysis (<xref ref-type="sec" rid="s8-4-2">Section 8.4.2</xref>) of a single spin flip this is prevented as long as <italic>a</italic>
<sub>1</sub>&#x2a86;<italic>a</italic>
<sub>2</sub>&#x394;, where &#x394; is the maximal degree of <italic>G</italic> and <italic>a</italic>
<sub>1,2</sub> are the energy scales of the first and second constraints.<list list-type="simple">
<list-item>
<p>d. <italic>Cost function</italic> The decision problem (&#x201c;Is there a clique of size <italic>K</italic>?&#x201d;) can be solved using the constraints as the Hamiltonian of the problem. If we want to find the largest clique of the graph <italic>G</italic>, we must encode <italic>K</italic> as a discrete variable, <italic>K</italic> &#x3d; 1, <italic>&#x2026;</italic>, <italic>K</italic>
<sub>max</sub>, where <italic>K</italic>
<sub>max</sub> &#x3d; &#x394; is the maximum degree of <italic>G</italic> and the largest possible size of a clique. The cost function for this case is simply the value of <italic>K</italic>:</p>
</list-item>
</list>
<disp-formula id="e74">
<mml:math id="m136">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>K</mml:mi>
</mml:math>
<label>(74)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>e. <italic>Resources</italic> Implementing constraints as energy penalizations, the total cost function for the decision problem (fixed <italic>K</italic>),</p>
</list-item>
</list>
<disp-formula id="e75">
<mml:math id="m137">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mi>K</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>K</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>,</mml:mo>
</mml:math>
<label>(75)</label>
</disp-formula>has interaction terms with maximum order of two and the number of terms scales with &#x7c;<italic>E</italic>&#x7c; &#x2b; &#x7c;<italic>V</italic>&#x7c;<sup>2</sup>. If <italic>K</italic> is encoded as a discrete variable, the resources depend on the chosen encoding.<list list-type="simple">
<list-item>
<p>f. <italic>References</italic> This Hamiltonian was formulated in <xref ref-type="bibr" rid="B49">Lucas (2014)</xref> using one-hot encoding.</p>
</list-item>
</list>
</p>
</sec>
<sec id="s7-2-2">
<title>7.2.2 Maximal independent set</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> Given a hypergraph <italic>G</italic> &#x3d; (<italic>V</italic>, <italic>E</italic>) we look for a subset of vertices <italic>S</italic> &#x2282; <italic>V</italic> such that there are no edges in <italic>E</italic> connecting any two vertices of <italic>S</italic>. Finding the largest possible <italic>S</italic> is an NP-hard problem.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> We use a binary variable <italic>x</italic>
<sub>
<italic>i</italic>
</sub> for each vertex in <italic>V</italic>.</p>
</list-item>
<list-item>
<p>c. <italic>Cost function</italic> For maximizing the number of vertices in <italic>S</italic>, the cost function is</p>
</list-item>
</list>
<disp-formula id="e76">
<mml:math id="m138">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>V</mml:mi>
<mml:mo stretchy="false">&#x7c;</mml:mo>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>.</mml:mo>
</mml:math>
<label>(76)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>d. <italic>Constraints</italic> Given two elements in <italic>S</italic>, there must not be any edge of hyperedge in <italic>E</italic> connecting them. The constraint</p>
</list-item>
</list>
<disp-formula id="e77">
<mml:math id="m139">
<mml:mi>c</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>V</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>A</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
<label>(77)</label>
</disp-formula>counts the number of adjacent vertices in <italic>S</italic>, with <italic>A</italic> as the adjacency matrix. By setting <italic>c</italic> &#x3d; 0, the vertices in <italic>S</italic> form an independent set.<list list-type="simple">
<list-item>
<p>e. <italic>References &#x2009;</italic> See <xref ref-type="bibr" rid="B49">Lucas (2014)</xref> and <xref ref-type="bibr" rid="B13">Choi (2010)</xref> for graphs.</p>
</list-item>
</list>
</p>
</sec>
<sec id="s7-2-3">
<title>7.2.3 Set packing</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> Given a set <italic>U</italic> and a family <inline-formula id="inf62">
<mml:math id="m140">
<mml:mi>S</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">{</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>V</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mo stretchy="false">}</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> of subsets <italic>V</italic>
<sub>
<italic>i</italic>
</sub> of <italic>U</italic>, we want to find set packings, i.e., subsets of <italic>S</italic> such that all subsets are pairwise disjoint, <italic>V</italic>
<sub>
<italic>i</italic>
</sub> &#x2229; <italic>V</italic>
<sub>
<italic>j</italic>
</sub> &#x3d; &#x2205;. Finding the maximum packing (the maximum number of subsets <italic>V</italic>
<sub>
<italic>i</italic>
</sub>) is the NP-hard optimization problem called set packing.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> We define <italic>N</italic> binary variables <italic>x</italic>
<sub>
<italic>i</italic>
</sub> that indicate whether subset <italic>V</italic>
<sub>
<italic>i</italic>
</sub> belongs to the packing.</p>
</list-item>
<list-item>
<p>c. <italic>Cost function</italic> Maximizing the number of subsets in the packing is achieved with the element counting building block</p>
</list-item>
</list>
<disp-formula id="e78">
<mml:math id="m141">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>.</mml:mo>
</mml:math>
<label>(78)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>d. <italic>Constraints</italic> In order to ensure that any two subsets of the packings are disjoint we can impose a cost on overlapping sets with</p>
</list-item>
</list>
<disp-formula id="e79">
<mml:math id="m142">
<mml:mi>c</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>:</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>V</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2229;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>V</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2260;</mml:mo>
<mml:mi>&#x2205;</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(79)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>e. <italic>Resources</italic> The total cost function <italic>H</italic> &#x3d; <italic>H</italic>
<sub>
<italic>A</italic>
</sub> &#x2b; <italic>H</italic>
<sub>
<italic>B</italic>
</sub> has interaction terms with maximum order of two (so it is a QUBO problem) and the number of terms scales up to <italic>N</italic>
<sup>2</sup>.</p>
</list-item>
<list-item>
<p>f. <italic>References</italic> This problem can be found in <xref ref-type="bibr" rid="B49">Lucas (2014)</xref>.</p>
</list-item>
</list>
</p>
</sec>
<sec id="s7-2-4">
<title>7.2.4 Vertex cover</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> Given a hypergraph <italic>G</italic> &#x3d; (<italic>V</italic>, <italic>E</italic>) we want to find the smallest subset <italic>C</italic> &#x2286; <italic>V</italic> such that all edges contain at least one vertex in <italic>C</italic>.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> We define &#x7c;<italic>V</italic>&#x7c; binary variables <italic>x</italic>
<sub>
<italic>i</italic>
</sub> that indicate whether vertex <italic>i</italic> belongs to the cover <italic>C</italic>.</p>
</list-item>
<list-item>
<p>c. <italic>Cost function</italic> Minimizing the number of vertices in <italic>C</italic> is achieved with the element counting building block</p>
</list-item>
</list>
<disp-formula id="e80">
<mml:math id="m143">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>V</mml:mi>
<mml:mo stretchy="false">&#x7c;</mml:mo>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>.</mml:mo>
</mml:math>
<label>(80)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>d. <italic>Constraints</italic> With</p>
</list-item>
</list>
<disp-formula id="e81">
<mml:math id="m144">
<mml:mi>c</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mspace width="0.17em"/>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:math>
<label>(81)</label>
</disp-formula>one can penalize all edges that do not contain vertices belonging to <italic>C</italic>. Encoding the constraint as an energy penalization, the Hamiltonian results in<disp-formula id="e82">
<mml:math id="m145">
<mml:mi>H</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>A</mml:mi>
<mml:mi>f</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>B</mml:mi>
<mml:mi>c</mml:mi>
<mml:mo>.</mml:mo>
</mml:math>
<label>(82)</label>
</disp-formula>by setting <italic>B</italic> &#x3e; <italic>A</italic> we can avoid the constraint being traded off against the minimization of <italic>C</italic>.<list list-type="simple">
<list-item>
<p>e. <italic>Resources</italic> The maximum order of the interaction terms is the maximum rank of the hyperedges <italic>k</italic> and the number of terms scales with &#x7c;<italic>E</italic>&#x7c;2<sup>
<italic>k</italic>
</sup> &#x2b; &#x7c;<italic>V</italic>&#x7c;.</p>
</list-item>
<list-item>
<p>f. <italic>References</italic> The special case that only considers graphs can be found in <xref ref-type="bibr" rid="B49">Lucas (2014)</xref>.</p>
</list-item>
</list>
</p>
</sec>
<sec id="s7-2-5">
<title>7.2.5 Minimal maximal matching</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> Given a hypergraph <italic>G</italic> &#x3d; (<italic>V</italic>, <italic>E</italic>) with edges of maximal rank <italic>k</italic> we want to find a minimal (i.e., fewest edges) matching <italic>C</italic> &#x2286; <italic>E</italic> which is maximal in the sense that all edges with vertices that are not incident to edges in <italic>C</italic> have to be included in the matching.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> We define &#x7c;<italic>E</italic>&#x7c; binary variables <italic>x</italic>
<sub>
<italic>i</italic>
</sub> that indicate whether an edge belongs to the matching <italic>C</italic>.</p>
</list-item>
<list-item>
<p>c. <italic>Cost function</italic> Minimizing the number of edges in the matching is simply done by the cost function</p>
</list-item>
</list>
<disp-formula id="e83">
<mml:math id="m146">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>A</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>A</mml:mi>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>E</mml:mi>
<mml:mo stretchy="false">&#x7c;</mml:mo>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>.</mml:mo>
</mml:math>
<label>(83)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>d. <italic>Constraints</italic> We have to enforce that <italic>C</italic> is indeed a matching, i.e., that no two edges which share a vertex belong to <italic>C</italic>. Using an energy penalty, this is achieved by:</p>
</list-item>
</list>
<disp-formula id="e84">
<mml:math id="m147">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>B</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>B</mml:mi>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>V</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>&#x2202;</mml:mi>
<mml:mi>v</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
</mml:math>
<label>(84)</label>
</disp-formula>where <italic>&#x2202;v</italic> is the set of edges connected to vertex <italic>v</italic>. Additionally, the matching should be maximal. For each vertex <italic>u</italic>, we define a variable <italic>y</italic>
<sub>
<italic>u</italic>
</sub> &#x3d; <italic>&#x2211;</italic>
<sub>
<italic>i</italic>&#x2208;<italic>&#x2202;u</italic>
</sub>
<italic>x</italic>
<sub>
<italic>i</italic>
</sub> which is only zero if the vertex does not belong to an edge of <italic>C</italic>. If the first constraint is satisfied, this variable can only be 0 or 1. In this case, the constraint can be enforced by<disp-formula id="e85">
<mml:math id="m148">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>C</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>C</mml:mi>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(85)</label>
</disp-formula>However, one has to make sure that the constraint implemented by <italic>f</italic>
<sub>
<italic>B</italic>
</sub> is not violated in favor of <italic>f</italic>
<sub>
<italic>C</italic>
</sub> which could happen if for some <italic>v</italic>, <italic>y</italic>
<sub>
<italic>v</italic>
</sub> &#x3e; 1 and for <italic>m</italic> neighboring vertices <italic>y</italic>
<sub>
<italic>u</italic>
</sub> &#x3d; 0. Then the contributions from <italic>v</italic> are given by<disp-formula id="e86">
<mml:math id="m149">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>B</mml:mi>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:mfrac>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>C</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mi>m</mml:mi>
</mml:math>
<label>(86)</label>
</disp-formula>and since <italic>m</italic> &#x2b; <italic>y</italic>
<sub>
<italic>v</italic>
</sub> is bounded by the maximum degree &#x394; of <italic>G</italic> times the maximum rank of the hyperedges <italic>k</italic>, we need to set <italic>B</italic> &#x3e; (&#x394;<italic>k</italic> &#x2212; 2)<italic>C</italic> to ensure that the ground state of <italic>f</italic>
<sub>
<italic>B</italic>
</sub> &#x2b; <italic>f</italic>
<sub>
<italic>C</italic>
</sub> does not violate the first constraint. Finally, one has to prevent <italic>f</italic>
<sub>
<italic>C</italic>
</sub> being violated in favor of <italic>f</italic>
<sub>
<italic>A</italic>
</sub> which entails <italic>C</italic> &#x3e; <italic>A</italic>.<list list-type="simple">
<list-item>
<p>e. <italic>Resources</italic> The maximum order of the interaction terms is <italic>k</italic> and the number of terms scales roughly with (&#x7c;<italic>V</italic>&#x7c; &#x2b; &#x7c;<italic>E</italic>&#x7c;2<sup>
<italic>k</italic>
</sup>)&#x394;(&#x394; &#x2212; 1).</p>
</list-item>
<list-item>
<p>f. <italic>References</italic> This problem can be found in <xref ref-type="bibr" rid="B49">Lucas (2014)</xref>.</p>
</list-item>
</list>
</p>
</sec>
<sec id="s7-2-6">
<title>7.2.6 Set cover</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> Given a set <inline-formula id="inf63">
<mml:math id="m150">
<mml:mi>U</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">{</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mo stretchy="false">}</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> and <italic>N</italic> subsets <italic>V</italic>
<sub>
<italic>i</italic>
</sub> &#x2286; <italic>U</italic>, we look for the minimum number of <italic>V</italic>
<sub>
<italic>i</italic>
</sub> such that <italic>U</italic> &#x3d; &#x22c3;<italic>V</italic>
<sub>
<italic>i</italic>
</sub>.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> We define a binary variable <italic>x</italic>
<sub>
<italic>i</italic>
</sub> &#x3d; 0, 1 for each subset <italic>V</italic>
<sub>
<italic>i</italic>
</sub> that indicates if the subset <italic>V</italic>
<sub>
<italic>i</italic>
</sub> is selected or not. We also define auxiliary variables <italic>y</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> &#x3d; 1, 2, <italic>&#x2026;</italic>, <italic>N</italic> that indicate how many active subsets (<italic>V</italic>
<sub>
<italic>i</italic>
</sub> such that <italic>x</italic>
<sub>
<italic>i</italic>
</sub> &#x3d; 1) contain the element <italic>u</italic>
<sub>
<italic>&#x3b1;</italic>
</sub>.</p>
</list-item>
<list-item>
<p>c. <italic>Cost function</italic> The cost function is simply</p>
</list-item>
</list>
<disp-formula id="e87">
<mml:math id="m151">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
</mml:math>
<label>(87)</label>
</disp-formula>which counts the number of selected subsets <italic>V</italic>
<sub>
<italic>i</italic>
</sub>.<list list-type="simple">
<list-item>
<p>d. <italic>Constraints</italic> The constraint <inline-formula id="inf64">
<mml:math id="m152">
<mml:mi>U</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mo>&#x22c3;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>:</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>V</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula> can be expressed as</p>
</list-item>
</list>
<disp-formula id="e88">
<mml:math id="m153">
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3e;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mspace width="0.28em"/>
<mml:mo>&#x2200;</mml:mo>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>n</mml:mi>
<mml:mo>,</mml:mo>
</mml:math>
<label>(88)</label>
</disp-formula>which implies that every element <italic>u</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> &#x2208; <italic>U</italic> is included at least once. These inequalities are satisfied if <italic>y</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> are restricted to the valid values (<italic>y</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> &#x3d; 1, 2, <italic>&#x2026;</italic>, <italic>N</italic>, <italic>y</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> &#x2260; 0) (<xref ref-type="sec" rid="s8-2-3">Section 8.2.3</xref>). The values of <italic>y</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> should be consistent with those of <italic>x</italic>
<sub>
<italic>i</italic>
</sub>, so the constraint is<disp-formula id="e89">
<mml:math id="m154">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>:</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>V</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(89)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>e. <italic>Special case: exact cover</italic> If we want each element of <italic>U</italic> to appear once and only once on the cover, then <italic>y</italic>
<sub>
<italic>&#x3b1;</italic>
</sub> &#x3d; 1, for all <italic>&#x3b1;</italic> and the constraint of the problem reduces to</p>
</list-item>
</list>
<disp-formula id="e90">
<mml:math id="m155">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>:</mml:mo>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>V</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(90)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>f. <italic>References</italic> The one-hot encoded Hamiltonian can be found in <xref ref-type="bibr" rid="B49">Lucas (2014)</xref>.</p>
</list-item>
</list>
</p>
</sec>
<sec id="s7-2-7">
<title>7.2.7 Knapsack</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> A set <italic>U</italic> contains <italic>N</italic> objects, each of them with a value <italic>d</italic>
<sub>
<italic>i</italic>
</sub> and a weight <italic>w</italic>
<sub>
<italic>i</italic>
</sub>. We look for a subset of <italic>U</italic> with the maximum value <italic>&#x2211;d</italic>
<sub>
<italic>i</italic>
</sub> such that the total weight of the selected objects does not exceed the upper limit <italic>W</italic>.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> We define a binary variable <italic>x</italic>
<sub>
<italic>i</italic>
</sub> &#x3d; 0, 1 for each element in <italic>U</italic> that indicates if the element <italic>i</italic> is selected or not. We also define an auxiliary variable <italic>y</italic> that indicates the total weight of the selected objects:</p>
</list-item>
</list>
<disp-formula id="e91">
<mml:math id="m156">
<mml:mi>y</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>:</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>.</mml:mo>
</mml:math>
<label>(91)</label>
</disp-formula>if the weights are natural numbers <inline-formula id="inf65">
<mml:math id="m157">
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="double-struck">N</mml:mi>
</mml:math>
</inline-formula> then <italic>y</italic> is also natural, and the encoding of this auxiliary variable is greatly simplified.<list list-type="simple">
<list-item>
<p>c. <italic>Cost function</italic> The cost function is given by</p>
</list-item>
</list>
<disp-formula id="e92">
<mml:math id="m158">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
</mml:math>
<label>(92)</label>
</disp-formula>which counts the value of the selected elements.<list list-type="simple">
<list-item>
<p>d. <italic>Constraints</italic> The constraint <italic>y</italic> &#x3c; <italic>W</italic> is implemented by forcing <italic>y</italic> to take one of the possible values <italic>y</italic> &#x3d; 1, &#x2026;<italic>W</italic> &#x2212; 1 (see <xref ref-type="sec" rid="s8-2-3">Section 8.2.3</xref>). The value of <italic>y</italic> must be consistent with the selected items from <italic>U</italic>:</p>
</list-item>
</list>
<disp-formula id="e93">
<mml:math id="m159">
<mml:mi>c</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(93)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>e. <italic>References</italic> The one-hot encoded Hamiltonian can be found in <xref ref-type="bibr" rid="B49">Lucas (2014)</xref>.</p>
</list-item>
</list>
</p>
</sec>
</sec>
<sec id="s7-3">
<title>7.3 Permutation problems</title>
<p>In permutation problems, we need to find a permutation of <italic>N</italic> elements that minimizes a cost function while satisfying a given set of constraints. In general, we will use a discrete variable <italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x2208; [1, <italic>N</italic>] that indicates the position of the element <italic>i</italic> in the permutation.</p>
<sec id="s7-3-1">
<title>7.3.1 Hamiltonian cycles</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> For a graph <italic>G</italic> &#x3d; (<italic>V</italic>, <italic>E</italic>), we ask if a Hamiltonian cycle, i.e., a closed path that connects all nodes in the graph through the existing edges without visiting the same node twice, exists.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> We define a variable <italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x3d; 1, <italic>&#x2026;</italic>, &#x7c;<italic>V</italic>&#x7c; for each node in the graph, that indicates the position of the node in the permutation.</p>
</list-item>
<list-item>
<p>c. <italic>Cost function</italic> For this problem, there is no cost function, so every permutation that satisfies the constraints is a solution to the problem.</p>
</list-item>
<list-item>
<p>d. <italic>Constraints</italic> This problem requires two constraints. The first constraint is inherent to all permutation problems and imposes the &#x7c;<italic>V</italic>&#x7c; variables {<italic>v</italic>
<sub>
<italic>i</italic>
</sub>} to be a permutation of [1, <italic>&#x2026;</italic>, &#x7c;<italic>V</italic>&#x7c;]. This is equivalent to requiring <italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x2260; <italic>v</italic>
<sub>
<italic>j</italic>
</sub> if <italic>i</italic> &#x2260; <italic>j</italic>, which can be encoded with the following constraint (<xref ref-type="sec" rid="s8-2-1">Section 8.2.1</xref>):</p>
</list-item>
</list>
<disp-formula id="e94">
<mml:math id="m160">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x2260;</mml:mo>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(94)</label>
</disp-formula>
</p>
<p>The second constraint ensures that the path only goes through the edges of the graph. Let <italic>A</italic> be the adjacency matrix of the graph, such that <italic>A</italic>
<sub>
<italic>i</italic>,<italic>j</italic>
</sub> &#x3d; 1 if there is an edge connecting nodes <italic>i</italic> and <italic>j</italic> and zero otherwise. To penalize invalid solutions, we use the constraint<disp-formula id="e95">
<mml:math id="m161">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mi>V</mml:mi>
<mml:mo stretchy="false">&#x7c;</mml:mo>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>A</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x2b;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
</mml:math>
<label>(95)</label>
</disp-formula>which counts how many adjacent nodes in the solution are not connected by an edge in the graph. <italic>&#x3b1;</italic> &#x3d; &#x7c;<italic>V</italic>&#x7c; &#x2b; 1 represents <italic>&#x3b1;</italic> &#x3d; 1 since we are looking for a closed path.<list list-type="simple">
<list-item>
<p>e. <italic>References</italic> The one-hot encoded Hamiltonian can be found in <xref ref-type="bibr" rid="B49">Lucas (2014)</xref>.</p>
</list-item>
</list>
</p>
</sec>
<sec id="s7-3-2">
<title>7.3.2 Traveling salesperson problem (TSP)</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> The TSP is a trivial extension of the Hamiltonian cycles problem. In this case, the nodes represent cities and the edges are the possible roads connecting the cities, although in general it is assumed that all cities are connected (the graph is complete). For each edge connecting cities <italic>i</italic> and <italic>j</italic> there is a cost <italic>w</italic>
<sub>
<italic>i</italic>,<italic>j</italic>
</sub>. The solution of the TSP is the Hamiltonian cycle that minimizes the total cost <italic>&#x2211;w</italic>
<sub>
<italic>i</italic>,<italic>j</italic>
</sub>.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> We define a variable <italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x3d; 1, <italic>&#x2026;</italic>, &#x7c;<italic>V</italic>&#x7c; for each node in the graph, indicating the position of the node in the permutation.</p>
</list-item>
<list-item>
<p>c. <italic>Cost function</italic> If the traveler goes from city <italic>i</italic> at position <italic>&#x3b1;</italic> to city <italic>j</italic> in the next step, then</p>
</list-item>
</list>
<disp-formula id="e96">
<mml:math id="m162">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
</mml:math>
<label>(96)</label>
</disp-formula>otherwise, that expression would be zero. Therefore the total cost of the travel is codified in the function:<disp-formula id="e97">
<mml:math id="m163">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x2b;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
<mml:mo>.</mml:mo>
</mml:math>
<label>(97)</label>
</disp-formula>as for Hamiltonian cycles, <italic>&#x3b1;</italic> &#x3d; &#x7c;<italic>V</italic>&#x7c; &#x2b; 1 represents <italic>&#x3b1;</italic> &#x3d; 1 since we are looking for a closed path.<list list-type="simple">
<list-item>
<p>d. <italic>Constraints</italic> The constraints are the same as those used in the Hamiltonian cycles problem (see paragraph 7.3.1). If the graph is complete (all the cities are connected) then constraint <italic>c</italic>
<sub>2</sub> is not necessary.</p>
</list-item>
<list-item>
<p>e. <italic>References</italic> The one-hot encoded Hamiltonian can be found in <xref ref-type="bibr" rid="B49">Lucas (2014)</xref>.</p>
</list-item>
</list>
</p>
</sec>
<sec id="s7-3-3">
<title>7.3.3 Machine scheduling</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> Machine scheduling problems seek the best way to distribute a number of jobs over a finite number of machines. These problems explore permutations of the job list, where the position of a job in the permutation indicates on which machine and at what time the job is executed. Many variants of the problem exist, including formulations in terms of spin Hamiltonians (<xref ref-type="bibr" rid="B74">Venturelli et al., 2015</xref>; <xref ref-type="bibr" rid="B42">Kurowski et al., 2020</xref>; <xref ref-type="bibr" rid="B1">Amaro et al., 2022</xref>). Here we consider the problem of <italic>M</italic> machines and <italic>N</italic> jobs, where all jobs take the same amount of time to complete, so the time can be divided into time slots of equal duration <italic>t</italic>. It is possible to include jobs of duration <italic>nt</italic> <inline-formula id="inf66">
<mml:math id="m164">
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="double-struck">N</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> by using appropriate constraints that force some jobs to run in consecutive time slots on the same machine. In this way, problems with jobs of different duration can be solved by choosing a sufficiently short time <italic>t</italic>.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> We define variables <italic>v</italic>
<sub>
<italic>m</italic>,<italic>t</italic>
</sub> &#x3d; 0, &#x2026;<italic>N</italic>, where the subindex <italic>m</italic> &#x3d; 1, &#x2026;<italic>M</italic> indicates the machine and <italic>t</italic> &#x3d; 1, &#x2026;<italic>T</italic> the time slot. When <italic>v</italic>
<sub>
<italic>m</italic>,<italic>t</italic>
</sub> &#x3d; 0, the machine <italic>m</italic> is unoccupied in time slot <italic>t</italic>, and if <italic>v</italic>
<sub>
<italic>m</italic>,<italic>t</italic>
</sub> &#x3d; <italic>j</italic> &#x2260; 0 then the job <italic>j</italic> is done in the machine <italic>m</italic>, in the time slot <italic>t</italic>.</p>
</list-item>
<list-item>
<p>c. <italic>Constraints</italic> There are many possible constraints depending on the use case we want to run. As in every permutation problem, we require that no pair of variables have the same value, <italic>v</italic>
<sub>
<italic>m</italic>,<italic>t</italic>
</sub> &#x2260; <italic>v</italic>
<sub>
<italic>m</italic>&#x2032;,<italic>t</italic>&#x2032;</sub>, otherwise, some jobs would be performed twice. We also require each job to be complete so there must be exactly one <italic>v</italic>
<sub>
<italic>m</italic>,<italic>t</italic>
</sub> &#x3d; <italic>j</italic> for each job <italic>j</italic>. This constraint is explained in <xref ref-type="sec" rid="s8-2-1">Section 8.2.1</xref> and holds for every job <italic>j</italic> &#x2260; 0:</p>
</list-item>
</list>
<disp-formula id="e98">
<mml:math id="m165">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>&#x2260;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msup>
<mml:mrow>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(98)</label>
</disp-formula>Note that if job <italic>j</italic> is not assigned (i.e., there are no <italic>m</italic>, <italic>t</italic> such that <italic>v</italic>
<sub>
<italic>m</italic>,<italic>t</italic>
</sub> &#x3d; <italic>j</italic>) then <italic>c</italic>
<sub>1</sub> &#x3e; 0. Also, if there is more than one variable <italic>v</italic>
<sub>
<italic>m</italic>,<italic>t</italic>
</sub> &#x3d; <italic>j</italic>, then again <italic>c</italic>
<sub>1</sub> &#x3e; 0. The constraint will be satisfied (<italic>c</italic>
<sub>1</sub> &#x3d; 0) if and only if every job is assigned to a single time slot on a single machine.</p>
<p>Suppose job <italic>k</italic> can only be started if another job, <italic>j</italic>, has been done previously. This constraint can be implemented as<disp-formula id="e99">
<mml:math id="m166">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:mo>,</mml:mo>
<mml:mi>k</mml:mi>
<mml:mo>&#x3e;</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>m</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>&#x2265;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>m</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
</mml:math>
<label>(99)</label>
</disp-formula>which precludes any solution in which job <italic>j</italic> is done after job <italic>k</italic>. Alternatively, it can be codified as<disp-formula id="e100">
<mml:math id="m167">
<mml:msubsup>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:mo>,</mml:mo>
<mml:mi>k</mml:mi>
<mml:mo>&#x3e;</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>m</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>m</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(100)</label>
</disp-formula>
</p>
<p>These constraints can be used to encode problems that consider jobs with different operations <italic>O</italic>
<sub>1</sub>, &#x2026;<italic>O</italic>
<sub>
<italic>q</italic>
</sub> that must be performed in sequential order. Note that constraints <inline-formula id="inf67">
<mml:math id="m168">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> allow the use of different machines for different operations. If we want job <italic>k</italic> to be done immediately after work <italic>j</italic>, we can substitute <italic>t</italic>&#x2032; by <italic>t</italic> &#x2b; 1 in <inline-formula id="inf68">
<mml:math id="m169">
<mml:msubsup>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula>.</p>
<p>If we want two jobs <italic>j</italic>
<sub>1</sub> and <italic>j</italic>
<sub>2</sub> to run on the same machine in consecutive time slots, the constraint can be encoded as<disp-formula id="e101">
<mml:math id="m170">
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
</mml:math>
<label>(101)</label>
</disp-formula>or as a reward term in the Hamiltonian,<disp-formula id="e102">
<mml:math id="m171">
<mml:msubsup>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>3</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
</mml:math>
<label>(102)</label>
</disp-formula>that reduces the energy of any solution in which job <italic>j</italic>
<sub>2</sub> is performed immediately after job <italic>j</italic>
<sub>1</sub> on the same machine <italic>m</italic>. This constraint allows the encoding of problems with different job durations since <italic>j</italic>
<sub>1</sub> and <italic>j</italic>
<sub>2</sub> can be considered part of the same job of duration 2<italic>t</italic>.<list list-type="simple">
<list-item>
<p>d. <italic>Cost function</italic> Different objective functions can be chosen for this problem, such as minimizing machine idle time or early and late deliveries. A common option is to minimize the makespan, i.e., the time slot of the last scheduled job. To do this, we first introduce an auxiliary function <inline-formula id="inf69">
<mml:math id="m172">
<mml:mi>&#x3c4;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> that indicates the time slots in which a job has been scheduled:</p>
</list-item>
</list>
<disp-formula id="e103">
<mml:math id="m173">
<mml:mi>&#x3c4;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mtable class="cases">
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mi>t</mml:mi>
<mml:mspace width="0.22em"/>
<mml:mspace width="0.22em"/>
<mml:mspace width="0.22em"/>
<mml:mspace width="1em"/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.28em"/>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2260;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>0</mml:mn>
<mml:mspace width="0.22em"/>
<mml:mspace width="0.22em"/>
<mml:mspace width="0.22em"/>
<mml:mspace width="1em"/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.28em"/>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(103)</label>
</disp-formula>These functions can be generated from <italic>v</italic>
<sub>
<italic>m</italic>,<italic>t</italic>
</sub>:<disp-formula id="e104">
<mml:math id="m174">
<mml:mi>&#x3c4;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
<mml:mo>.</mml:mo>
</mml:math>
<label>(104)</label>
</disp-formula>Note that the maximum value of <italic>&#x3c4;</italic> corresponds to the makespan of the problem, which is to be minimized. To do this, we introduce the extra variable <italic>&#x3c4;</italic>
<sub>max</sub> and penalize configurations where <italic>&#x3c4;</italic>
<sub>max</sub> &#x3c; <italic>&#x3c4;</italic>(<italic>v</italic>
<sub>
<italic>m</italic>,<italic>t</italic>
</sub>) for all <italic>m</italic>, <italic>t</italic>:<disp-formula id="e105">
<mml:math id="m175">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>max</mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mi mathvariant="normal">&#x398;</mml:mi>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>max</mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>,</mml:mo>
</mml:math>
<label>(105)</label>
</disp-formula>with<disp-formula id="e106">
<mml:math id="m176">
<mml:mi mathvariant="normal">&#x398;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mtable class="cases">
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>1</mml:mn>
<mml:mspace width="2em"/>
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.28em"/>
<mml:mi>x</mml:mi>
<mml:mo>&#x2265;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mspace width="1em"/>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>0</mml:mn>
<mml:mspace width="2em"/>
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.28em"/>
<mml:mi>x</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
<mml:mspace width="1em"/>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(106)</label>
</disp-formula>For details on how &#x398;(<italic>x</italic>) can be expressed see <xref ref-type="sec" rid="s8-1-2">Section 8.1.2</xref>. By minimizing <inline-formula id="inf70">
<mml:math id="m177">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>max</mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula>, we ensure that <italic>&#x3c4;</italic>
<sub>max</sub> &#x2265; <italic>&#x3c4;</italic>(<italic>v</italic>
<sub>
<italic>m</italic>,<italic>t</italic>
</sub>). Then, the cost function is used to simply minimize <italic>&#x3c4;</italic>
<sub>max</sub>, the latest time a job can be scheduled, via<disp-formula id="e107">
<mml:math id="m178">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>max</mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>.</mml:mo>
</mml:math>
<label>(107)</label>
</disp-formula>
</p>
<p>An alternative cost function for this problem is<disp-formula id="e108">
<mml:math id="m179">
<mml:msup>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mi>&#x3c4;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>,</mml:mo>
</mml:math>
<label>(108)</label>
</disp-formula>which forces all jobs to be scheduled as early as possible.<list list-type="simple">
<list-item>
<p>e. <italic>References</italic> Quantum formulations of this and related problems can be found in Refs. <xref ref-type="bibr" rid="B74">Venturelli et al. (2015)</xref>; <xref ref-type="bibr" rid="B42">Kurowski et al. (2020)</xref>; <xref ref-type="bibr" rid="B1">Amaro et al. (2022)</xref> and <xref ref-type="bibr" rid="B9">Carugno et al. (2022)</xref>.</p>
</list-item>
</list>
</p>
</sec>
<sec id="s7-3-4">
<title>7.3.4 Nurse scheduling problem</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> In this problem we have <italic>N</italic> nurses and <italic>D</italic> working shifts. Nurses must be scheduled with minimal workload following hard and soft constraints, such as minimum workload <italic>n</italic>
<sub>min,<italic>t</italic>
</sub> of nurses <italic>i</italic> (where nurse <italic>i</italic> contributes workload <italic>p</italic>
<sub>
<italic>i</italic>
</sub>) in a given shift <italic>t</italic>, and balancing the number of shifts to be as equal as possible. Furthermore, no nurse should have to work on more than <italic>d</italic>
<sub>max</sub> consecutive days.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> We define <italic>ND</italic> binary variables <italic>v</italic>
<sub>
<italic>i</italic>,<italic>t</italic>
</sub> indicating whether nurse <italic>i</italic> is scheduled for shift <italic>t</italic>.</p>
</list-item>
<list-item>
<p>c. <italic>Cost function</italic> The cost function, whose minimum corresponds to the minimal number of overall shifts, is given by</p>
</list-item>
</list>
<disp-formula id="e109">
<mml:math id="m180">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>t</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
<label>(109)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>d. <italic>Constraints</italic> Balancing of the shifts is expressed by the constraint</p>
</list-item>
</list>
<disp-formula id="e110">
<mml:math id="m181">
<mml:mi>c</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>,</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(110)</label>
</disp-formula>In order to get a minimal workload per shift we introduce the auxiliary variables <italic>y</italic>
<sub>
<italic>t</italic>
</sub> which we bind to the values<disp-formula id="e111">
<mml:math id="m182">
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>p</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
<label>(111)</label>
</disp-formula>with the penalty terms<disp-formula id="e112">
<mml:math id="m183">
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>p</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(112)</label>
</disp-formula>Now the constraint takes the form<disp-formula id="e113">
<mml:math id="m184">
<mml:mi>c</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>t</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>min</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(113)</label>
</disp-formula>Note that we can also combine the cost function for minimizing the number of shifts and this constraint by using the cost function<disp-formula id="e114">
<mml:math id="m185">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>t</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>D</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>p</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>min</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(114)</label>
</disp-formula>Finally, the constraint that a nurse <italic>i</italic> should work in maximally <italic>d</italic>
<sub>max</sub> consecutive shifts reads<disp-formula id="e115">
<mml:math id="m186">
<mml:mi>c</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3e;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mtext>max</mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(115)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>e. <italic>References</italic> This problem can be found in <xref ref-type="bibr" rid="B38">Ikeda et al. (2019)</xref>.</p>
</list-item>
</list>
</p>
</sec>
</sec>
<sec id="s7-4">
<title>7.4 Real variables problems</title>
<p>Some problems are defined by a set of real variables <inline-formula id="inf71">
<mml:math id="m187">
<mml:mrow>
<mml:mo stretchy="false">{</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="double-struck">R</mml:mi>
<mml:mo>,</mml:mo>
<mml:mspace width="1em"/>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>d</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">}</mml:mo>
</mml:mrow>
<mml:mo>,</mml:mo>
</mml:math>
</inline-formula> and a cost function <italic>f</italic>(<italic>v</italic>
<sub>
<italic>i</italic>
</sub>) that has to be minimized. We again want to express these problems as Hamiltonians whose ground state represents an optimal solution. This involves three steps. First, encode the continuous variables into discrete ones. Second, choose an encoding of these discrete variables to spin variables exactly as before, and third, a decoding step is necessary that maps the solution to our discrete problem back to the continuous domain. In the following, we investigate two possible methods one could use for the first step.<list list-type="simple">
<list-item>
<p>a. <italic>Standard discretization</italic> Given a vector <inline-formula id="inf72">
<mml:math id="m188">
<mml:mi>v</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula> one could simply discretize it by partitioning the axis into intervals with the length of the aspired precision <italic>q</italic>, i.e., the components of <italic>v</italic> &#x3d; (<italic>v</italic>
<sub>
<italic>i</italic>
</sub>), <italic>i</italic> &#x3d; 1, &#x2026;, <italic>d</italic> are mapped to <inline-formula id="inf73">
<mml:math id="m189">
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2192;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mo>&#x303;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="double-struck">N</mml:mi>
</mml:math>
</inline-formula> such that <inline-formula id="inf74">
<mml:math id="m190">
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mo>&#x303;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
<mml:mi>q</mml:mi>
<mml:mo>&#x2264;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3c;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mo>&#x303;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mi>q</mml:mi>
</mml:math>
</inline-formula>.</p>
</list-item>
</list>
</p>
<p>Depending on the problem it might also be useful to have different resolutions for different axes or a non-uniform discretization, e.g., logarithmic scaling of the interval length.</p>
<p>For the discrete variables <inline-formula id="inf75">
<mml:math id="m191">
<mml:msub>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mo>&#x303;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula> one can use the encodings in <xref ref-type="sec" rid="s3">Section 3</xref>. In the final step after an intermediate solution,<inline-formula id="inf76">
<mml:math id="m192">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mo>&#x303;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2a;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula>, is found, one has to map it back to <inline-formula id="inf77">
<mml:math id="m193">
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula> by uniformly sampling the components of <italic>v</italic>&#x2a; from the hypercuboids corresponding to <inline-formula id="inf78">
<mml:math id="m194">
<mml:msup>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mo>&#x303;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2a;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula>. Any intermediate solution that is valid for the discrete encoding can also be decoded and thus there are no core terms in the cost function besides those from the discrete encoding.<list list-type="simple">
<list-item>
<p>b. <italic>Random subspace coding</italic> A further possibility to encode a vector <inline-formula id="inf79">
<mml:math id="m195">
<mml:mi>v</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula> into discrete variables is random subspace coding (<xref ref-type="bibr" rid="B64">Rachkovskii et al., 2005</xref>). One starts by randomly choosing a set of coordinates <inline-formula id="inf80">
<mml:math id="m196">
<mml:msub>
<mml:mrow>
<mml:mi>D</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>:</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:mn>1,2</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2282;</mml:mo>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:mn>1,2</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>d</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. For each <italic>i</italic> &#x2208; <italic>D</italic>
<sub>
<italic>n</italic>
</sub>, a Dirichlet process is used to pick an interval [<italic>a</italic>
<sub>
<italic>i</italic>
</sub>, <italic>b</italic>
<sub>
<italic>i</italic>
</sub>] in the <italic>i</italic>-coordinate direction in <inline-formula id="inf81">
<mml:math id="m197">
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula> (<xref ref-type="bibr" rid="B14">Devroye et al., 1993</xref>). We denote</p>
</list-item>
</list>
<disp-formula id="e116">
<mml:math id="m198">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c0;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>:</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
</mml:msup>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x2192;</mml:mo>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>x</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x21a6;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c0;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>:</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(116)</label>
</disp-formula>for the projection to the <italic>i</italic>th coordinate. A <italic>hyperrectangle</italic> <inline-formula id="inf82">
<mml:math id="m199">
<mml:mi>R</mml:mi>
<mml:mo>&#x2282;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula> is defined as<disp-formula id="e117">
<mml:math id="m200">
<mml:mi>R</mml:mi>
<mml:mo>:</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mspace width="0.17em"/>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mspace width="0.17em"/>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c0;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2208;</mml:mo>
<mml:mfenced open="[" close="]">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>,</mml:mo>
<mml:mspace width="0.17em"/>
<mml:mo>&#x2200;</mml:mo>
<mml:mspace width="0.17em"/>
<mml:mi>i</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>D</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>.</mml:mo>
</mml:math>
<label>(117)</label>
</disp-formula>
</p>
<p>For the fixed set of chosen coordinates <italic>D</italic>
<sub>
<italic>n</italic>
</sub>, the Dirichlet processes are run <italic>m</italic> times to get <italic>m</italic> hyperrectangles <inline-formula id="inf83">
<mml:math id="m201">
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. For <italic>k</italic> &#x3d; 1, <italic>&#x2026;</italic>, <italic>m</italic>, we define binary projection maps as<disp-formula id="e118">
<mml:math id="m202">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:msub>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>:</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
</mml:msup>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x2192;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi mathvariant="double-struck">Z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>x</mml:mi>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x21a6;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>:</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mtable class="cases">
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
<mml:mspace width="0.17em"/>
<mml:mspace width="1em"/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>if</mml:mtext>
<mml:mspace width="0.17em"/>
<mml:mi>x</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mspace width="0.17em"/>
<mml:mspace width="1em"/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>else</mml:mtext>
<mml:mo>.</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(118)</label>
</disp-formula>then <italic>Random subspace coding</italic> is defined as a map<disp-formula id="e119">
<mml:math id="m203">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>z</mml:mi>
<mml:mo>:</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
</mml:msup>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x2192;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi mathvariant="double-struck">Z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>x</mml:mi>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x21a6;</mml:mo>
<mml:mi>z</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>:</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
<mml:mo>.</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(119)</label>
</disp-formula>
</p>
<p>Depending on the set of hyperrectangles <inline-formula id="inf84">
<mml:math id="m204">
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, random subspace coding can be a sparse encoding. Let <inline-formula id="inf85">
<mml:math id="m205">
<mml:mi>M</mml:mi>
<mml:mo>:</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>m</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula> and <italic>K</italic> &#x2282; <italic>M</italic>. We define sets<disp-formula id="e120">
<mml:math id="m206">
<mml:mi>U</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>:</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:munder>
<mml:mrow>
<mml:mo>&#x22c2;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:munder>
<mml:msub>
<mml:mrow>
<mml:mi>R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:munder>
<mml:mrow>
<mml:mo>&#x22c3;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>M</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:munder>
<mml:msub>
<mml:mrow>
<mml:mi>R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2260;</mml:mo>
<mml:mi>&#x2205;</mml:mi>
<mml:mo>.</mml:mo>
</mml:math>
<label>(120)</label>
</disp-formula>For <inline-formula id="inf86">
<mml:math id="m207">
<mml:mi>z</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi mathvariant="double-struck">Z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula>, let <inline-formula id="inf87">
<mml:math id="m208">
<mml:mi>K</mml:mi>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:mi>k</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>m</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mspace width="0.17em"/>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mspace width="0.17em"/>
<mml:msub>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>. The binary vector <italic>z</italic> is in the image of the random subspace encoding if and only if<disp-formula id="e121">
<mml:math id="m209">
<mml:mi>U</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>K</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2260;</mml:mo>
<mml:mi>&#x2205;</mml:mi>
</mml:math>
<label>(121)</label>
</disp-formula>holds. From here one can simply use the discrete encodings discussed in <xref ref-type="sec" rid="s3">Section 3</xref> to map the components <italic>z</italic>
<sub>
<italic>i</italic>
</sub>(<italic>x</italic>) of <italic>z</italic>(<italic>x</italic>) to spin variables. Due to the potential sparse encoding, a core term has to be added to the cost function. Let <inline-formula id="inf88">
<mml:math id="m210">
<mml:mi>N</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:mi>L</mml:mi>
<mml:mo>&#x2282;</mml:mo>
<mml:mi>M</mml:mi>
<mml:mspace width="0.17em"/>
<mml:mo stretchy="false">&#x7c;</mml:mo>
<mml:mspace width="0.17em"/>
<mml:mi>U</mml:mi>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>L</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>&#x2205;</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:math>
</inline-formula>, then the core term reads<disp-formula id="e122">
<mml:math id="m211">
<mml:mi>c</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>L</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x2113;</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>L</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x2113;</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>p</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>M</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>L</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>p</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msubsup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(122)</label>
</disp-formula>
</p>
<p>Despite this drawback, random subspace coding might be preferable due to its simplicity and high resolution with relatively few hyperrectangles compared to the hypercubes of the standard discretization.</p>
<sec id="s7-4-1">
<title>7.4.1 Financial crash problem</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> We calculate the financial equilibrium of market values <italic>v</italic>
<sub>
<italic>i</italic>
</sub>, <italic>i</italic> &#x3d; 1, &#x2026;, <italic>n</italic> of <italic>n</italic> institutions according to a simple model following <xref ref-type="bibr" rid="B19">Elliott et al. (2014)</xref> and <xref ref-type="bibr" rid="B59">Or&#xfa;s et al. (2019)</xref>. In this model, the prices of <italic>m</italic> assets are labeled by <italic>p</italic>
<sub>
<italic>k</italic>
</sub>, <italic>k</italic> &#x3d; 1, &#x2026;, <italic>m</italic>. Furthermore we define the ownership matrix <italic>D</italic>, where <italic>D</italic>
<sub>
<italic>ij</italic>
</sub> denotes the percentage of asset <italic>j</italic> owned by <italic>i</italic>; the cross-holdings <italic>C</italic>, where <italic>C</italic>
<sub>
<italic>ij</italic>
</sub> denotes the percentage of institution <italic>j</italic> owned by <italic>i</italic> (except for self-holdings); and the self-ownership matrix <inline-formula id="inf89">
<mml:math id="m212">
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>C</mml:mi>
</mml:mrow>
<mml:mo>&#x303;</mml:mo>
</mml:mover>
</mml:mrow>
</mml:math>
</inline-formula>. The model postulates that without crashes the equity values <italic>V</italic> (such that <inline-formula id="inf90">
<mml:math id="m213">
<mml:mi>v</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>C</mml:mi>
</mml:mrow>
<mml:mo>&#x303;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mi>V</mml:mi>
</mml:math>
</inline-formula>) in equilibrium satisfy</p>
</list-item>
</list>
<disp-formula id="e123">
<mml:math id="m214">
<mml:mi>V</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>D</mml:mi>
<mml:mi>p</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>C</mml:mi>
<mml:mi>V</mml:mi>
<mml:mo>&#x2192;</mml:mo>
<mml:mi>v</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>C</mml:mi>
</mml:mrow>
<mml:mo>&#x303;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>C</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mi>D</mml:mi>
<mml:mi>p</mml:mi>
<mml:mo>.</mml:mo>
</mml:math>
<label>(123)</label>
</disp-formula>
</p>
<p>Crashes are then modeled as abrupt changes in the prices of assets held by an institution, i.e., via<disp-formula id="e124">
<mml:math id="m215">
<mml:mi>v</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>C</mml:mi>
</mml:mrow>
<mml:mo>&#x303;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>C</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>D</mml:mi>
<mml:mi>p</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>b</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>v</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>p</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
<mml:mo>,</mml:mo>
</mml:math>
<label>(124)</label>
</disp-formula>where <inline-formula id="inf91">
<mml:math id="m216">
<mml:msub>
<mml:mrow>
<mml:mi>b</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>v</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>p</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3b2;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>p</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mi mathvariant="normal">&#x398;</mml:mi>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> results in the problem being highly non-linear.<list list-type="simple">
<list-item>
<p>b. <italic>Variables</italic> It is useful to shift the market values and we find a variable <inline-formula id="inf92">
<mml:math id="m217">
<mml:mi>v</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msup>
</mml:math>
</inline-formula>. Since the crash functions <italic>b</italic>
<sub>
<italic>i</italic>
</sub>(<italic>v</italic>, <italic>p</italic>) explicitly depend on the components of <italic>v</italic>&#x2032; it is not convenient to use the random subspace coding (or only for the components individually) and so we use the standard discretization, i.e., each component of <italic>v</italic>&#x2032; takes discrete values 0, &#x2026;, <italic>K</italic> such that with desired resolution <italic>r</italic>, a cut-off value <italic>rK</italic> is reached.</p>
</list-item>
<list-item>
<p>c. <italic>Cost function</italic> In order to enforce that the system is in financial equilibrium we simply square Eq. <xref ref-type="disp-formula" rid="e124">124</xref>
</p>
</list-item>
</list>
<disp-formula id="e125">
<mml:math id="m218">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2212;</mml:mo>
<mml:mrow>
<mml:mover accent="true">
<mml:mrow>
<mml:mi>C</mml:mi>
</mml:mrow>
<mml:mo>&#x303;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>C</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>D</mml:mi>
<mml:mi>p</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>b</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>v</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>p</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>,</mml:mo>
</mml:math>
<label>(125)</label>
</disp-formula>where for the theta functions in <italic>b</italic>(<italic>v</italic>, <italic>p</italic>) we use<disp-formula id="e126">
<mml:math id="m219">
<mml:mi mathvariant="normal">&#x398;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msubsup>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x2265;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msubsup>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
</mml:math>
<label>(126)</label>
</disp-formula>as suggested in <xref ref-type="sec" rid="s8-1-2">Section 8.1.2</xref>.</p>
</sec>
<sec id="s7-4-2">
<title>7.4.2 Continuous black box optimization</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> Given a function <inline-formula id="inf93">
<mml:math id="m220">
<mml:mi>f</mml:mi>
<mml:mo>:</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">[</mml:mo>
<mml:mrow>
<mml:mn>0,1</mml:mn>
</mml:mrow>
<mml:mo stretchy="false">]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mrow>
<mml:mi>d</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2192;</mml:mo>
<mml:mi mathvariant="double-struck">R</mml:mi>
</mml:math>
</inline-formula>, which can be evaluated at individual points a finite number of times but where no closed form is available, we want to find the global minimum. In classical optimization, the general strategy is to use machine learning to learn an analytical acquisition function <italic>g</italic>(<italic>x</italic>) in closed form from some sample evaluations, optimize it to generate the next point on which to evaluate <italic>f</italic>, and repeat as long as resources are available.</p>
</list-item>
<list-item>
<p>b. <italic>Variables</italic> The number and range of variables depends on the continuous to discrete encoding. In the case of the standard discretization, we have <italic>d</italic> variables <italic>v</italic>
<sub>
<italic>a</italic>
</sub> taking values in {0, &#x2026;, &#x2308;1/<italic>q</italic>&#x2309;}, where <italic>q</italic> is the precision.</p>
</list-item>
</list>
</p>
<p>With the random subspace encoding, we have &#x394; variables <italic>v</italic>
<sub>
<italic>a</italic>
</sub> taking values in {0, &#x2026;, <italic>d</italic>
<sub>
<italic>s</italic>
</sub>}, where &#x394; is the maximal overlap of the rectangles and <italic>d</italic>
<sub>
<italic>s</italic>
</sub> is the number of rectangles.<list list-type="simple">
<list-item>
<p>c. <italic>Cost function</italic> Similar to the classical strategy, we first fit/learn an acquisition function with an ansatz. Such an ansatz could take the form</p>
</list-item>
</list>
<disp-formula id="e127">
<mml:math id="m221">
<mml:mi>y</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>v</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>w</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>r</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi mathvariant="normal">&#x394;</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2026;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
</mml:math>
<label>(127)</label>
</disp-formula>where <italic>k</italic> is the highest order of the ansatz and the variables <italic>v</italic>
<sub>
<italic>i</italic>
</sub> depend on the continuous to discrete encoding. In terms of the indicator functions, they are expressed as<disp-formula id="e128">
<mml:math id="m222">
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mi>&#x3b1;</mml:mi>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(128)</label>
</disp-formula>alternatively, one could write the ansatz as a function of the indicator functions alone instead of the variables<disp-formula id="e129">
<mml:math id="m223">
<mml:msup>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>v</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>w</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>r</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi mathvariant="normal">&#x394;</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x2026;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msubsup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(129)</label>
</disp-formula>While the number of terms is roughly the same as before, this has the advantage that the energy scales in the cost function can be much lower. A downside is that one has to consider that usually for an optimization to be better than random sampling one needs the assumption that the function <italic>f</italic> is well-behaved in some way (e.g., analytic). The formulation of the ansatz in Eq. <xref ref-type="disp-formula" rid="e129">129</xref> might not take advantage of this assumption in the same way as the first.</p>
<p>Let <inline-formula id="inf94">
<mml:math id="m224">
<mml:msup>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2a;</mml:mo>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2261;</mml:mo>
<mml:mrow>
<mml:mo stretchy="false">{</mml:mo>
<mml:mrow>
<mml:msubsup>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2a;</mml:mo>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
<mml:mo stretchy="false">}</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> denote the fitted parameters of the ansatz. Then the cost function is simply <italic>y</italic>(<italic>v</italic>, <italic>w</italic>&#x2a;) or <italic>y</italic>&#x2032;(<italic>v</italic>, <italic>w</italic>&#x2a;).<list list-type="simple">
<list-item>
<p>d. <italic>Constraints</italic> In this problem, the only constraints that can appear are core terms. For the standard discretization, no such term is necessary and for the random subspace coding, we add Eq. <xref ref-type="disp-formula" rid="e122">122</xref>.</p>
</list-item>
<list-item>
<p>e. <italic>References</italic> This problem can be found in <xref ref-type="bibr" rid="B39">Izawa et al. (2022)</xref>.</p>
</list-item>
</list>
</p>
</sec>
</sec>
<sec id="s7-5">
<title>7.5 Other problems</title>
<p>In this final category, we include problems that do not fit into the previous classifications but constitute important use cases for quantum optimization.</p>
<sec id="s7-5-1">
<title>7.5.1 Syndrome decoding problem</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> For an [<italic>n</italic>, <italic>k</italic>] classical linear code (a code where <italic>k</italic> logical bits are encoded in <italic>n</italic> physical bits) the parity check matrix <italic>H</italic> indicates whether a state <italic>y</italic> of physical bits is a code word or has a non-vanishing error syndrome <italic>&#x3b7;</italic> &#x3d; <italic>yH</italic>
<sup>
<italic>T</italic>
</sup>. Given such a syndrome, we want to decode it, i.e., find the most likely error with that syndrome, which is equivalent to solving</p>
</list-item>
</list>
<disp-formula id="e130">
<mml:math id="m225">
<mml:munder>
<mml:mrow>
<mml:mi>argmin</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="{" close="}">
<mml:mrow>
<mml:mn>0,1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mi>e</mml:mi>
<mml:msup>
<mml:mrow>
<mml:mi>H</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>T</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>&#x3b7;</mml:mi>
</mml:mrow>
</mml:munder>
<mml:mi>w</mml:mi>
<mml:mi>t</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>e</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>,</mml:mo>
</mml:math>
<label>(130)</label>
</disp-formula>where <italic>wt</italic> denotes the Hamming weight and all arithmetic is mod 2.<list list-type="simple">
<list-item>
<p>b. <italic>Cost function</italic> There are two distinct ways to formulate the problem: check-based and generator-based. In the generator-based approach, we note that the generator matrix <italic>G</italic> of the code satisfies <italic>GH</italic>
<sup>
<italic>T</italic>
</sup> &#x3d; 0 and thus any logical word <italic>u</italic> yields a solution to <italic>eH</italic>
<sup>
<italic>T</italic>
</sup> &#x3d; <italic>&#x3b7;</italic> via <italic>e</italic> &#x3d; <italic>uG</italic> &#x2b; <italic>v</italic> where <italic>v</italic> is any state such that <italic>vH</italic>
<sup>
<italic>T</italic>
</sup> &#x3d; 0 can be found efficiently. Minimizing the weight of <italic>uG</italic> &#x2b; <italic>v</italic> leads to the cost function</p>
</list-item>
</list>
<disp-formula id="e131">
<mml:math id="m226">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>G</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>2</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>2</mml:mn>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>l</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
<mml:msub>
<mml:mrow>
<mml:mi>G</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mi>l</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>.</mml:mo>
</mml:math>
<label>(131)</label>
</disp-formula>note that the summation over <italic>l</italic> is mod 2 but the rest of the equation is over <inline-formula id="inf95">
<mml:math id="m227">
<mml:mi mathvariant="double-struck">N</mml:mi>
</mml:math>
</inline-formula>. We can rewrite this as<disp-formula id="e132">
<mml:math id="m228">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>G</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>2</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>l</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>G</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mi>l</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msubsup>
</mml:math>
<label>(132)</label>
</disp-formula>according to <xref ref-type="sec" rid="s8-3-1">Section 8.3.1</xref>.</p>
<p>In the check-based approach, we can directly minimize deviations from <italic>eH</italic>
<sup>
<italic>T</italic>
</sup> &#x3d; <italic>&#x3b7;</italic> with the cost function<disp-formula id="e133">
<mml:math id="m229">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>2</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3b7;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>l</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>H</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mi>l</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msubsup>
</mml:math>
<label>(133)</label>
</disp-formula>but we additionally have to penalize higher weight errors with the term<disp-formula id="e134">
<mml:math id="m230">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>e</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
</mml:math>
<label>(134)</label>
</disp-formula>so we have<disp-formula id="e135">
<mml:math id="m231">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>H</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2261;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>c</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
</mml:math>
<label>(135)</label>
</disp-formula>with positive parameters <italic>c</italic>
<sub>1</sub>/<italic>c</italic>
<sub>2</sub>.<list list-type="simple">
<list-item>
<p>c. <italic>Variables</italic> The variables in the check-based formulation are the <italic>n</italic> bits <italic>e</italic>
<sub>
<italic>i</italic>
</sub> of the error <italic>e</italic>. In the generator-based formulation, <italic>k</italic> bits <italic>u</italic>
<sub>
<italic>i</italic>
</sub> of the logical word <italic>u</italic> are defined. If we use the reformulation Eq. <xref ref-type="disp-formula" rid="e132">132</xref>, these are replaced by the <italic>k</italic> spin variables <italic>s</italic>
<sub>
<italic>l</italic>
</sub>. Note that the state <italic>v</italic> is assumed to be given by an efficient classical calculation.</p>
</list-item>
<list-item>
<p>d. <italic>Constraints</italic> There are no hard constraints, any logical word <italic>u</italic> and any physical state <italic>e</italic> are valid.</p>
</list-item>
<list-item>
<p>e. <italic>Resources</italic> A number of interesting tradeoffs can be found by analyzing the resources needed by both approaches. The check-based approach features a cost function with up to (<italic>n</italic> &#x2212; <italic>k</italic>) &#x2b; <italic>n</italic> terms (for a non-degenerate check matrix with <italic>n</italic> &#x2212; <italic>k</italic> rows, there are (<italic>n</italic> &#x2212; <italic>k</italic>) terms from <italic>f</italic>
<sub>1</sub> and <italic>n</italic> terms from <italic>f</italic>
<sub>2</sub>), whereas in <italic>f</italic>
<sub>
<italic>G</italic>
</sub>, there are at most <italic>n</italic> terms (the number of rows of <italic>G</italic>). The highest order of the variables that appear in these terms is for the generator-based formulation bounded by the number of rows of <italic>G</italic> which is <italic>k</italic>. In general, this order can be up to <italic>n</italic> (number of columns of <italic>H</italic>) for <italic>f</italic>
<sub>
<italic>H</italic>
</sub> but for an important class of linear codes (low-density parity check codes), the order would be bounded by the constant weight of the parity checks. This weight can be quite low but there is again a tradeoff because higher weights of the checks result in better encoding rates (i.e., for good low-density parity check codes, they increase the constant encoding rate <italic>n</italic>/<italic>k</italic> &#x223c; <italic>&#x3b1;</italic>).</p>
</list-item>
<list-item>
<p>f. <italic>References</italic> This problem was originally presented in <xref ref-type="bibr" rid="B43">Lai et al. (2022)</xref>.</p>
</list-item>
</list>
</p>
</sec>
<sec id="s7-5-2">
<title>7.5.2 <italic>k</italic>-SAT</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Description</italic> A <italic>k</italic>-SAT problem instance consists of a boolean formula</p>
</list-item>
</list>
<disp-formula id="e136">
<mml:math id="m232">
<mml:mi>f</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>&#x2227;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>m</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>m</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(136)</label>
</disp-formula>in the conjunctive normal form (CNF), that is, <italic>&#x3c3;</italic>
<sub>
<italic>i</italic>
</sub> are disjunction clauses over <italic>k</italic> literals <italic>l</italic>:<disp-formula id="e137">
<mml:math id="m233">
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2228;</mml:mo>
<mml:mo>&#x22ef;</mml:mo>
<mml:mo>&#x2228;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
</mml:math>
<label>(137)</label>
</disp-formula>where a literal <italic>l</italic>
<sub>
<italic>i</italic>,<italic>k</italic>
</sub> is a variable <italic>x</italic>
<sub>
<italic>i</italic>,<italic>k</italic>
</sub> or its negation <italic>&#xac;x</italic>
<sub>
<italic>i</italic>,<italic>k</italic>
</sub>. We want to find out if there exists an assignment of the variables that satisfies the formula.<list list-type="simple">
<list-item>
<p>b. <italic>Variables</italic> There are two strategies to express a <italic>k</italic>-SAT problem in a Hamiltonian formulation. First, one can use a Hamiltonian cost function based on violated clauses. In this case, the variables are the assignments <italic>x</italic> &#x2208; {0,1}<sup>
<italic>n</italic>
</sup>. For the second method, a graph is constructed from a <italic>k</italic>-SAT instance in CNF as follows. Each clause <italic>&#x3c3;</italic>
<sub>
<italic>j</italic>
</sub> will be a fully connected graph of <italic>k</italic> variables <inline-formula id="inf96">
<mml:math id="m234">
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula>. Connect two vertices from different clauses if they are negations of each other, i.e., <inline-formula id="inf97">
<mml:math id="m235">
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#xac;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>p</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula> and solve the maximum independent set (MIS) problem for this graph (<xref ref-type="bibr" rid="B13">Choi, 2010</xref>). If, and only if, this set has cardinality <italic>m</italic> is the SAT instance satisfiable. The variables in this formulation are the <italic>m</italic> &#xd7; <italic>k</italic> boolean variables <italic>x</italic>
<sub>
<italic>i</italic>
</sub> which are 1 if the vertex is part of the independent set and 0 otherwise.</p>
</list-item>
<list-item>
<p>c. <italic>Cost function</italic> A clause-violation-based cost function for a problem in CNF can be written as</p>
</list-item>
</list>
<disp-formula id="e138">
<mml:math id="m236">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>C</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(138)</label>
</disp-formula>with (<xref ref-type="sec" rid="s8-3-2">Section 8.3.2</xref>)<disp-formula id="e139">
<mml:math id="m237">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2228;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>&#x2228;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right"/>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>.</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(139)</label>
</disp-formula>A cost function for the MIS problem can be constructed from a term encouraging a higher cardinality of the independent set:<disp-formula id="e140">
<mml:math id="m238">
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>B</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>b</mml:mi>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>.</mml:mo>
</mml:math>
<label>(140)</label>
</disp-formula>
<list list-type="simple">
<list-item>
<p>d. <italic>Constraints</italic> In the MIS formulation, one has to enforce that there are no connections between members of the maximally independent set:</p>
</list-item>
</list>
<disp-formula id="e141">
<mml:math id="m239">
<mml:mi>c</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>.</mml:mo>
</mml:math>
<label>(141)</label>
</disp-formula>If this constraint is implemented as an energy penalty <italic>f</italic>
<sub>
<italic>A</italic>
</sub> &#x3d; <italic>ac</italic>, it should have a higher priority. The minimal cost of a spin flip (<italic>cf.</italic> <xref ref-type="sec" rid="s8-4-2">Section 8.4.2</xref>) from <italic>f</italic>
<sub>
<italic>A</italic>
</sub> is <italic>a</italic>(<italic>m</italic> &#x2212; 1) and in <italic>f</italic>
<sub>
<italic>B</italic>
</sub>, a spin flip could result in a maximal gain of <italic>b</italic>. Thus, <italic>a</italic>/<italic>b</italic> &#x2273; 1/(<italic>m</italic> &#x2212; 1).<list list-type="simple">
<list-item>
<p>e. <italic>Resources</italic> The cost function <italic>f</italic>
<sub>
<italic>C</italic>
</sub> consists of up to <inline-formula id="inf98">
<mml:math id="m240">
<mml:mi mathvariant="script">O</mml:mi>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mi>m</mml:mi>
<mml:mi>k</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> terms with a maximal order of <italic>k</italic> in the spin variables. In the alternative approach, the order is only quadratic so it would naturally be in a QUBO formulation. However, the number of terms in <italic>f</italic>
<sub>MIS</sub> can be as high as <inline-formula id="inf99">
<mml:math id="m241">
<mml:mi mathvariant="script">O</mml:mi>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mi>m</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:msup>
<mml:mrow>
<mml:mi>k</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> and thus scales worse in the number of clauses.</p>
</list-item>
<list-item>
<p>f. <italic>References</italic> This problem can be found in <xref ref-type="bibr" rid="B13">Choi (2010)</xref> which specifically focuses on the 3-SAT implementation.</p>
</list-item>
</list>
</p>
</sec>
</sec>
</sec>
<sec id="s8">
<title>8 Summary of building blocks</title>
<p>Here we summarize the parts of the cost functions and techniques that are used as reoccurring building blocks for the problems in this library. Similar building blocks are also discussed by <xref ref-type="bibr" rid="B68">Sawaya et al. (2022)</xref>.</p>
<sec id="s8-1">
<title>8.1 Auxiliary functions</title>
<p>The simplest class of building blocks are auxiliary scalar functions of multiple variables that can be used directly in cost functions or constraints via penalties.</p>
<sec id="s8-1-1">
<title>8.1.1 Element counting</title>
<p>One of the most common building blocks is the function <italic>t</italic>
<sub>
<italic>a</italic>
</sub> that simply counts the number of variables <italic>v</italic>
<sub>
<italic>i</italic>
</sub> with a given value <italic>a</italic>. In terms of the value indicator functions, we have<disp-formula id="e142">
<mml:math id="m242">
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(142)</label>
</disp-formula>It might be useful to introduce <italic>t</italic>
<sub>
<italic>a</italic>
</sub> as additional variables. In that case, one has to bind it to its desired value with the constraints<disp-formula id="e143">
<mml:math id="m243">
<mml:mi>c</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(143)</label>
</disp-formula>
</p>
</sec>
<sec id="s8-1-2">
<title>8.1.2 Step function</title>
<p>Step functions &#x398;(<italic>v</italic> &#x2212; <italic>w</italic>) can be constructed as<disp-formula id="e144">
<mml:math id="m244">
<mml:mi mathvariant="normal">&#x398;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>v</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>w</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b2;</mml:mi>
<mml:mo>&#x2265;</mml:mo>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b2;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mtable class="cases">
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>1</mml:mn>
<mml:mspace width="0.17em"/>
<mml:mspace width="1em"/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>if</mml:mtext>
<mml:mspace width="0.17em"/>
<mml:mi>v</mml:mi>
<mml:mo>&#x2265;</mml:mo>
<mml:mi>w</mml:mi>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>0</mml:mn>
<mml:mspace width="0.17em"/>
<mml:mspace width="1em"/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>if</mml:mtext>
<mml:mspace width="0.17em"/>
<mml:mi>v</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:mi>w</mml:mi>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
<mml:mo>,</mml:mo>
</mml:math>
<label>(144)</label>
</disp-formula>with <italic>K</italic> being the maximum value that the <italic>v</italic>, <italic>w</italic> can take on. Step functions can be used to penalize configurations where <italic>v</italic> &#x2265; <italic>w</italic>.</p>
</sec>
<sec id="s8-1-3">
<title>8.1.3 Minimizing the maximum element of a set</title>
<p>Step functions are particularly useful for minimizing the maximum value of a set {<italic>v</italic>
<sub>
<italic>i</italic>
</sub>}. Given an auxiliary variable <italic>l</italic>, we can guarantee that <italic>l</italic> &#x2265; <italic>v</italic>
<sub>
<italic>i</italic>
</sub>, for all <italic>i</italic> with the penalization<disp-formula id="e145">
<mml:math id="m245">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mi mathvariant="normal">&#x398;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>l</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mtable class="cases">
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>1</mml:mn>
<mml:mspace width="0.17em"/>
<mml:mspace width="1em"/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>if</mml:mtext>
<mml:mspace width="0.28em"/>
<mml:mi>l</mml:mi>
<mml:mo>&#x2265;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mspace width="0.28em"/>
<mml:mo>&#x2200;</mml:mo>
<mml:mi>i</mml:mi>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>0</mml:mn>
<mml:mspace width="0.17em"/>
<mml:mspace width="1em"/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mtext>if</mml:mtext>
<mml:mspace width="0.28em"/>
<mml:mo>&#x2203;</mml:mo>
<mml:mspace width="0.28em"/>
<mml:mi>i</mml:mi>
<mml:mo>:</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3e;</mml:mo>
<mml:mi>l</mml:mi>
<mml:mo>,</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(145)</label>
</disp-formula>which increases the energy if <italic>l</italic> is smaller than any <italic>v</italic>
<sub>
<italic>i</italic>
</sub>. The maximum value of {<italic>v</italic>
<sub>
<italic>i</italic>
</sub>} can be minimized by adding to the cost function of the problem the value of <italic>l</italic>. In that case, we also have to multiply the term from Eq. <xref ref-type="disp-formula" rid="e145">145</xref> by the maximum value that <italic>l</italic> can take in order to avoid trading off the penalty.</p>
</sec>
<sec id="s8-1-4">
<title>8.1.4 Compare variables</title>
<p>Given two variables <italic>v</italic>, <italic>w</italic> &#x2208; [1, <italic>K</italic>], the following term indicates if <italic>v</italic> and <italic>w</italic> are equal:<disp-formula id="e146">
<mml:math id="m246">
<mml:mi>&#x3b4;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>v</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>w</mml:mi>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>w</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mtable class="cases">
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>1</mml:mn>
<mml:mspace width="0.28em"/>
<mml:mspace width="0.28em"/>
<mml:mspace width="0.28em"/>
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.17em"/>
<mml:mi>v</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>w</mml:mi>
<mml:mspace width="1em"/>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>0</mml:mn>
<mml:mspace width="0.28em"/>
<mml:mspace width="0.28em"/>
<mml:mspace width="0.28em"/>
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.17em"/>
<mml:mi>v</mml:mi>
<mml:mo>&#x2260;</mml:mo>
<mml:mi>w</mml:mi>
<mml:mo>.</mml:mo>
<mml:mspace width="1em"/>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(146)</label>
</disp-formula>If we want to check if <italic>v</italic> &#x3e; <italic>w</italic>, then we can use the step function Eq. <xref ref-type="disp-formula" rid="e144">144</xref>.</p>
</sec>
</sec>
<sec id="s8-2">
<title>8.2 Constraints</title>
<p>Here we present the special case of functions of variables where the groundstate fulfills useful constraints. These naturally serve as building blocks for enforcing constraints via penalties.</p>
<sec id="s8-2-1">
<title>8.2.1 All (connected) variables are different</title>
<p>If we have a set of variables <inline-formula id="inf100">
<mml:math id="m247">
<mml:msubsup>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">{</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:mrow>
<mml:mo stretchy="false">[</mml:mo>
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
<mml:mi>K</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo stretchy="false">}</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> and two variables <italic>v</italic>
<sub>
<italic>i</italic>
</sub>, <italic>v</italic>
<sub>
<italic>j</italic>
</sub> are connected when the entry <italic>A</italic>
<sub>
<italic>ij</italic>
</sub> of the adjacency matrix <italic>A</italic> is 1, the following term has a minimum when <italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x2260; <italic>v</italic>
<sub>
<italic>j</italic>
</sub> for all connected <italic>i</italic> &#x2260; <italic>j</italic>:<disp-formula id="e147">
<mml:math id="m248">
<mml:mtable class="aligned">
<mml:mtr>
<mml:mtd columnalign="right">
<mml:mi>c</mml:mi>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x2260;</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mi>&#x3b4;</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:msub>
<mml:mrow>
<mml:mi>A</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="right"/>
<mml:mtd columnalign="left">
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x2260;</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msub>
<mml:mrow>
<mml:mi>A</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(147)</label>
</disp-formula>
</p>
<p>The minimum value of <italic>c</italic> is zero, and it is only possible if and only if there is no connected pair <italic>i</italic>, <italic>j</italic> such that <italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x3d; <italic>v</italic>
<sub>
<italic>j</italic>
</sub>. For all-to-all connectivity, one can use this building block to enforce that all variables are different. If <italic>K</italic> &#x3d; <italic>N</italic>, the condition <italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x2260; <italic>v</italic>
<sub>
<italic>j</italic>
</sub> for all <italic>i</italic> &#x2260; <italic>j</italic> is then equivalent to asking that each of the <italic>K</italic> possible values is reached by a variable.</p>
</sec>
<sec id="s8-2-2">
<title>8.2.2 Value <italic>&#x3b1;</italic> is used</title>
<p>Given a set of <italic>N</italic> variables <italic>v</italic>
<sub>
<italic>i</italic>
</sub>, we want to know if at least one variable is taking the value <italic>&#x3b1;</italic>. This is done by the term<disp-formula id="e148">
<mml:math id="m249">
<mml:msub>
<mml:mrow>
<mml:mi>u</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mtable class="cases">
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>0</mml:mn>
<mml:mspace width="2em"/>
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.28em"/>
<mml:mo>&#x2203;</mml:mo>
<mml:mspace width="0.17em"/>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>&#x3b1;</mml:mi>
<mml:mspace width="1em"/>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>1</mml:mn>
<mml:mspace width="2em"/>
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.28em"/>
<mml:mo>&#x2204;</mml:mo>
<mml:mspace width="0.17em"/>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>.</mml:mo>
<mml:mspace width="1em"/>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(148)</label>
</disp-formula>
</p>
</sec>
<sec id="s8-2-3">
<title>8.2.3 Inequalities</title>
<p>
<list list-type="simple">
<list-item>
<p>a. <italic>Inequalities of a single variable</italic> If a discrete variable <italic>v</italic>
<sub>
<italic>i</italic>
</sub>, which can take values in 1, &#x2026;, <italic>K</italic>, is subject to an inequality <italic>v</italic>
<sub>
<italic>i</italic>
</sub> &#x2264; <italic>a</italic>&#x2032; one can enforce this with a energy penalization for all values that do not satisfy the inequality</p>
</list-item>
</list>
<disp-formula id="e149">
<mml:math id="m250">
<mml:mi>c</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>K</mml:mi>
<mml:mo>&#x3e;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mo>&#x3e;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>.</mml:mo>
</mml:math>
<label>(149)</label>
</disp-formula>it is also possible to have a weighted penalty, e.g.,<disp-formula id="e150">
<mml:math id="m251">
<mml:mi>c</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munder>
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>K</mml:mi>
<mml:mo>&#x2265;</mml:mo>
<mml:mi>a</mml:mi>
<mml:mo>&#x3e;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2032;</mml:mo>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:munder>
</mml:mstyle>
<mml:mi>a</mml:mi>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
</mml:math>
<label>(150)</label>
</disp-formula>which might be useful if the inequality is not a hard constraint and more severe violations should be penalized more. That option comes with the drawback of introducing in general higher energy scales in the system, especially if <italic>K</italic> is large, which might decrease the relative energy gap.<list list-type="simple">
<list-item>
<p>b. <italic>Inequality constraints</italic> If the problem is restricted by an inequality constraint:</p>
</list-item>
</list>
<disp-formula id="e151">
<mml:math id="m252">
<mml:mi>c</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3c;</mml:mo>
<mml:mi>K</mml:mi>
<mml:mo>,</mml:mo>
</mml:math>
<label>(151)</label>
</disp-formula>it is convenient to define an auxiliary variable <italic>y</italic> &#x3c; <italic>K</italic> and impose the constraint:<disp-formula id="e152">
<mml:math id="m253">
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>y</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>c</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
</mml:math>
<label>(152)</label>
</disp-formula>so <italic>c</italic> is bound to be equal to some value of <italic>y</italic>, and the only possible values for <italic>y</italic> are those that satisfy the inequality.</p>
<p>If the auxiliary variable <italic>y</italic> is expressed in binary or Gray encoding, then Eq. <xref ref-type="disp-formula" rid="e152">152</xref> must be modified when 2<sup>
<italic>n</italic>
</sup> &#x3c; <italic>K</italic> &#x3c; 2<sup>
<italic>n</italic>&#x2b;1</sup> for some <inline-formula id="inf101">
<mml:math id="m254">
<mml:mi>n</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="double-struck">N</mml:mi>
</mml:math>
</inline-formula>,<disp-formula id="e153">
<mml:math id="m255">
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>y</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>c</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2212;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
</mml:math>
<label>(153)</label>
</disp-formula>which ensures <italic>c</italic>(<italic>v</italic>
<sub>1</sub>, <italic>&#x2026;</italic>, <italic>v</italic>
<sub>
<italic>N</italic>
</sub>) &#x3c; <italic>K</italic> if <italic>y</italic> &#x3d; 0, <italic>&#x2026;</italic>, 2<sup>
<italic>n</italic>&#x2b;1</sup> &#x2212; 1.</p>
</sec>
<sec id="s8-2-4">
<title>8.2.4 Constraint preserving driver</title>
<p>As explained in <xref ref-type="sec" rid="s5">Section 5</xref>, the driver Hamiltonian must commute with the operator generating the constraints so that it reaches the entire valid search space. Arbitrary polynomial constraints <italic>c</italic> can for example, be handled by using the Parity mapping. It brings constraints to the form <inline-formula id="inf102">
<mml:math id="m256">
<mml:msub>
<mml:mrow>
<mml:mo movablelimits="false" form="prefix">&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi mathvariant="bold">u</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>g</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi mathvariant="bold">u</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi mathvariant="bold">u</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula>. Starting in a constraint-fulfilling state and employing constraint depended flip-flop terms constructed from <italic>&#x3c3;</italic>
<sub>&#x2b;</sub>, <italic>&#x3c3;</italic>
<sub>&#x2212;</sub> operators as driver terms on the mapped spins (<xref ref-type="bibr" rid="B18">Drieb-Sch&#xf6;n et al., 2023</xref>) automatically enforces the constraints.</p>
</sec>
</sec>
<sec id="s8-3">
<title>8.3 Problem specific representations</title>
<p>For selected problems that are widely applicable, we demonstrate useful techniques for mapping them to cost functions.</p>
<sec id="s8-3-1">
<title>8.3.1 Modulo 2 linear programming</title>
<p>For the set of linear equations<disp-formula id="e154">
<mml:math id="m257">
<mml:mi>x</mml:mi>
<mml:mi>A</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo>,</mml:mo>
</mml:math>
<label>(154)</label>
</disp-formula>where <inline-formula id="inf103">
<mml:math id="m258">
<mml:mi>A</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi mathvariant="double-struck">F</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>l</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
<mml:mi>y</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi mathvariant="double-struck">F</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> are given, we want to solve for <inline-formula id="inf104">
<mml:math id="m259">
<mml:mi>x</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi mathvariant="double-struck">F</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula>. The cost function<disp-formula id="e155">
<mml:math id="m260">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>2</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mn>2</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>A</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(155)</label>
</disp-formula>minimizes the Hamming distance between <italic>xA</italic> and <italic>y</italic> and thus the ground state represents a solution. If we consider the second factor for fixed <italic>i</italic>, we notice that it counts the number of 1s in <italic>x</italic> (mod 2) where <italic>A</italic>
<sub>
<italic>ji</italic>
</sub> does not vanish at the corresponding index. When acting with<disp-formula id="e156">
<mml:math id="m261">
<mml:msub>
<mml:mrow>
<mml:mi>H</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3c3;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>z</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>A</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msubsup>
</mml:math>
<label>(156)</label>
</disp-formula>on &#x7c;<italic>x</italic>&#x27e9; we find the same result and thus the cost function<disp-formula id="e157">
<mml:math id="m262">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>2</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>l</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msubsup>
<mml:mrow>
<mml:mi>s</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>A</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>j</mml:mi>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
</mml:math>
<label>(157)</label>
</disp-formula>with spin variables <italic>s</italic>
<sub>
<italic>j</italic>
</sub> has the solution to Eq. <xref ref-type="disp-formula" rid="e154">154</xref> as its ground state.</p>
</sec>
<sec id="s8-3-2">
<title>8.3.2 Representation of boolean functions</title>
<p>Given a boolean function <italic>f</italic>: {0,1}<sup>
<italic>n</italic>
</sup> &#x2192; {0, 1} we want to express it as a cost function in terms of the <italic>n</italic> boolean variables. This is hard in general (<xref ref-type="bibr" rid="B33">Hadfield, 2021</xref>), but for (combinations of) local boolean functions there are simple expressions. In particular, we have, e.g.,<disp-formula id="e158">
<mml:math id="m263">
<mml:mo>&#xac;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:math>
<label>(158)</label>
</disp-formula>
<disp-formula id="e159">
<mml:math id="m264">
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2227;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2227;</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>&#x2227;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
<label>(159)</label>
</disp-formula>
<disp-formula id="e160">
<mml:math id="m265">
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2228;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2228;</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>&#x2228;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:munderover accentunder="false" accent="true">
<mml:mrow>
<mml:mo>&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:munderover>
</mml:mstyle>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(160)</label>
</disp-formula>
<disp-formula id="e161">
<mml:math id="m266">
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2192;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
</mml:math>
<label>(161)</label>
</disp-formula>
<disp-formula id="e162">
<mml:math id="m267">
<mml:mi mathvariant="normal">X</mml:mi>
<mml:mi mathvariant="normal">O</mml:mi>
<mml:mi mathvariant="normal">R</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mo>&#x2261;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mspace width="0.28em"/>
<mml:mi>mod</mml:mi>
<mml:mn>2</mml:mn>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>2</mml:mn>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>.</mml:mo>
</mml:math>
<label>(162)</label>
</disp-formula>
</p>
<p>It is always possible to convert a <italic>k</italic>-SAT instance to 3-SAT and, more generally, any boolean formula to a 3-SAT in conjunctive normal form with the Tseytin transformation (<xref ref-type="bibr" rid="B72">Tseitin, 1983</xref>) with only a linear overhead in the size of the formula.</p>
<p>Note that for the purpose of encoding optimization problems, one might use different expressions that only need to coincide (up to a constant shift) with those shown here for the ground state/solution to the problem at hand. For example, if we are interested in a satisfying assignment for <italic>x</italic>
<sub>1</sub> &#x2227;&#x2026;&#x2227;<italic>x</italic>
<sub>
<italic>n</italic>
</sub> we might formulate the cost function in two different ways that both have <italic>x</italic>
<sub>1</sub> &#x3d; &#x2026; &#x3d; <italic>x</italic>
<sub>
<italic>n</italic>
</sub> &#x3d; 1 as their unique ground state; namely, <inline-formula id="inf105">
<mml:math id="m268">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mo movablelimits="false" form="prefix">&#x220f;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula> and <inline-formula id="inf106">
<mml:math id="m269">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mo movablelimits="false" form="prefix">&#x2211;</mml:mo>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula>. The two corresponding spin Hamiltonians will have vastly different properties, as the first one will have, when expressed in spin variables, 2<sup>
<italic>n</italic>
</sup> terms with up to <italic>n</italic>th order interactions, whereas the second one has <italic>n</italic> linear terms. Additionally, configurations that are closer to a fulfilling assignment, i.e., that have more of the <italic>x</italic>
<sub>
<italic>i</italic>
</sub> equal to one, have a lower cost in the second option which is not the case for the first option. Note that for <italic>x</italic>
<sub>1</sub> &#x2228;&#x2026;&#x2228;<italic>x</italic>
<sub>
<italic>n</italic>
</sub> there is no similar trick as we want to penalize exactly one configuration.</p>
</sec>
</sec>
<sec id="s8-4">
<title>8.4 Meta optimization</title>
<p>There are several options for choices that arise in the construction of cost functions. These include meta parameters such as coefficients of building blocks but also reoccurring methods and techniques in dealing with optimization problems.</p>
<sec id="s8-4-1">
<title>8.4.1 Auxiliary variables</title>
<p>It is often useful to combine information about a set of variables <italic>v</italic>
<sub>
<italic>i</italic>
</sub> into one auxiliary variable <italic>y</italic> that is then used in other parts of the cost function. Examples include the element counting building block or the maximal value of a set of variables where we showed a way to bind the value of an auxiliary variable to this function of the set of variables. If the function <italic>f</italic> can be expressed algebraically in terms of the variable values/indicator functions (as a finite polynomial), the natural way to do this is via adding the constraint term<disp-formula id="e163">
<mml:math id="m270">
<mml:mi>c</mml:mi>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mi>y</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>f</mml:mi>
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msup>
</mml:math>
<label>(163)</label>
</disp-formula>with an appropriate coefficient <italic>c</italic>. To avoid the downsides of introducing constraints, there is an alternative route that might be preferred in certain cases. This alternative consists of simply using the variable indicator <inline-formula id="inf107">
<mml:math id="m271">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>y</mml:mi>
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b2;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula> and expressing the variable indicator function in terms of spin/binary variables according to a chosen encoding (one does not even have to use the same encoding for <italic>y</italic> and the <italic>v</italic>
<sub>
<italic>i</italic>
</sub>). As an example, let us consider the auxiliary variable <italic>&#x3c4;</italic>
<sub>
<italic>m</italic>,<italic>t</italic>
</sub> in the machine scheduling problem 7.3.3 for which we need to express <inline-formula id="inf108">
<mml:math id="m272">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:math>
</inline-formula>. For simplicity, we can choose the one-hot encoding for <italic>v</italic>
<sub>
<italic>m</italic>,<italic>t</italic>
</sub> and <italic>&#x3c4;</italic>
<sub>
<italic>m</italic>,<italic>t</italic>
</sub>, leading to<disp-formula id="e164">
<mml:math id="m273">
<mml:msubsup>
<mml:mrow>
<mml:mi>&#x3b4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mfenced open="{" close="">
<mml:mrow>
<mml:mtable class="cases">
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mfenced open="(" close=")">
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:mfenced>
<mml:mspace width="1em"/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.17em"/>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>&#x2260;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="left">
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mspace width="1em"/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mi mathvariant="normal">i</mml:mi>
<mml:mi mathvariant="normal">f</mml:mi>
<mml:mspace width="0.17em"/>
<mml:mspace width="1em"/>
<mml:mi>t</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd columnalign="left">
<mml:mn>0</mml:mn>
<mml:mspace width="1em"/>
</mml:mtd>
<mml:mtd columnalign="left">
<mml:mi mathvariant="normal">e</mml:mi>
<mml:mi mathvariant="normal">l</mml:mi>
<mml:mi mathvariant="normal">s</mml:mi>
<mml:mi mathvariant="normal">e</mml:mi>
<mml:mo>,</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:math>
<label>(164)</label>
</disp-formula>where the <inline-formula id="inf109">
<mml:math id="m274">
<mml:msub>
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mi>v</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mi>&#x3b2;</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula> are the binary variables of the one-hot encoding of <italic>v</italic>
<sub>
<italic>m</italic>,<italic>t</italic>
</sub>.</p>
</sec>
<sec id="s8-4-2">
<title>8.4.2 Prioritization of cost function terms</title>
<p>If a cost function is constructed out of multiple terms,<disp-formula id="e165">
<mml:math id="m275">
<mml:mi>f</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:msub>
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
</mml:math>
<label>(165)</label>
</disp-formula>one often wants to prioritize one term over another, e.g., if the first term encodes a hard constraint. One strategy to ensure that <italic>f</italic>
<sub>1</sub> is not &#x201c;traded off&#x201d; against <italic>f</italic>
<sub>2</sub> is to evaluate the minimal cost &#x394;<sub>1</sub> in <italic>f</italic>
<sub>1</sub> and the maximal gain &#x394;<sub>2</sub> in <italic>f</italic>
<sub>2</sub> from flipping one spin. It can be more efficient to do this independently for both terms and assume a state close to an optimum. The coefficients can then be set according to <italic>c</italic>
<sub>1</sub>&#x394;<sub>1</sub> &#x2273; <italic>c</italic>
<sub>2</sub>&#x394;<sub>2</sub>. In general, this will depend on the encoding for two reasons. First, for some encodings, one has to add core terms to the cost function which have to be taken into account for the prioritization (they usually have the highest priority). Furthermore, in some encodings, a single spin flip can cause the value of a variable to change by more than one<xref ref-type="fn" rid="fn4">
<sup>3</sup>
</xref>. Nonetheless, it can be an efficient heuristic to compare the &#x201c;costs&#x201d; and &#x201c;gains&#x201d; introduced above for pairs of cost function terms already in the encoding independent formulation by evaluating them for single variable changes by one and thereby fixing their relative coefficients. Then one only has to fix the coefficient for the core term after the encoding is chosen.</p>
</sec>
<sec id="s8-4-3">
<title>8.4.3 Problem conversion</title>
<p>Many decision problems associated with discrete optimization problems are NP-complete: one can always map them to any other NP-complete problem with only the polynomial overhead of classical runtime in the system size. Therefore, a new problem without a cost function formulation could be classically mapped to another problem where such a formulation is at hand. However, since quantum algorithms are hoped to deliver at most a polynomial advantage in the run time for general NP-hard problems, it is advisable to carefully analyze the overhead. This hope is based mainly on heuristic arguments related to the usefulness of quantum tunneling (<xref ref-type="bibr" rid="B50">Mandra et al., 2016</xref>) or empiric scaling studies (<xref ref-type="bibr" rid="B32">Guerreschi and Matsuura, 2019</xref>; <xref ref-type="bibr" rid="B7">Boulebnane and Montanaro, 2022</xref>). It is possible that there are trade-offs (as for <italic>k</italic>-SAT in <xref ref-type="sec" rid="s7-5-2">Section 7.5.2</xref>), where in the original formulation the order of terms in the cost function is <italic>k</italic> while in the MIS formulation, we naturally have a QUBO problem where the number of terms scales worse in the number of clauses.</p>
</sec>
</sec>
</sec>
<sec id="s9">
<title>9 Conclusion and outlook</title>
<p>In this review, we have collected and elaborated on a wide variety of optimization problems that are formulated in terms of discrete variables. By selecting an appropriate qubit encoding for these variables, we can obtain a spin Hamiltonian suitable for quantum algorithms such as quantum annealing or QAOA. The choice of the qubits encoding leads to distinct Hamiltonians, influencing important factors such as the required number of qubits, the order of interactions, and the smoothness of the energy landscape. Consequently, the encoding decisions directly impact the performance of quantum algorithms.</p>
<p>The encoding-independent formulation (<xref ref-type="bibr" rid="B68">Sawaya et al., 2022</xref>) employed in this review offers a significant advantage by enabling the utilization of automated tools to explore diverse encodings, ultimately optimizing the problem formulation. This approach allows for a comprehensive examination and comparison of various encoding strategies, facilitating the identification of the most efficient configuration for a given optimization problem. In addition, the identification of recurring blocks facilitates the formulation of new optimization problems, also constituting a valuable automation tool. By leveraging these automatic tools, we can enhance the efficiency of quantum algorithms in solving optimization problems.</p>
<p>Finding the optimal spin Hamiltonian for a given quantum computer hardware platform is an important problem in itself. As pointed out by <xref ref-type="bibr" rid="B68">Sawaya et al. (2022)</xref>, optimal spin Hamiltonians are likely to vary across different hardware platforms, underscoring the need for a procedure capable of tailoring a problem to a specific platform. The hardware-agnostic approach made use of in this review represents a further step in that direction.</p>
</sec>
</body>
<back>
<sec id="s10">
<title>Author contributions</title>
<p>All authors listed have made a substantial, direct, and intellectual contribution to the work and approved it for publication.</p>
</sec>
<sec id="s11">
<title>Funding</title>
<p>Work was supported by the Austrian Science Fund (FWF) through a START grant under Project No. Y1067-N27, the SFB BeyondC Project No. F7108-N38, QuantERA II Programme under Grant Agreement No. 101017733, the Federal Ministry for Economic Affairs and Climate Action through project QuaST, and the Federal Ministry of Education and Research on the basis of a decision by the German Bundestag.</p>
</sec>
<ack>
<p>The authors thank Dr. Kaonan Micadei for fruitful discussions.</p>
</ack>
<sec sec-type="COI-statement" id="s12">
<title>Conflict of interest</title>
<p>Authors FD, MT, CE, and WL were employed by Parity Quantum Computing Germany GmbH. Authors JU, BM, and WL were employed by Parity Quantum Computing GmbH.</p>
<p>The author BM declared that they were an editorial board member of Frontiers, at the time of submission. This had no impact on the peer review process and the final decision.</p>
</sec>
<sec sec-type="disclaimer" id="s13">
<title>Publisher&#x2019;s note</title>
<p>All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.</p>
</sec>
<fn-group>
<fn id="fn2">
<label>1</label>
<p>This terminology is adapted from <xref ref-type="bibr" rid="B10">Chancellor (2019)</xref>.</p>
</fn>
<fn id="fn3">
<label>2</label>
<p>Note that <xref ref-type="bibr" rid="B65">Ramos-Calderer et al. (2021)</xref> and <xref ref-type="bibr" rid="B67">Sawaya et al. (2020)</xref> use the term &#x201c;unary&#x201d; for one-hot encoding.</p>
</fn>
<fn id="fn4">
<label>3</label>
<p>E.g., in the binary encoding a spin flip can cause a variable shift of up to <italic>K</italic>/2 if the variables take values 1, &#x2026;, <italic>K</italic>. This is the main motivation to use modifications like the Gray encoding.</p>
</fn>
</fn-group>
<ref-list>
<title>References</title>
<ref id="B1">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Amaro</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Rosenkranz</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Fitzpatrick</surname>
<given-names>N.</given-names>
</name>
<name>
<surname>Hirano</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Fiorentini</surname>
<given-names>M.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>A case study of variational quantum algorithms for a job shop scheduling problem</article-title>. <source>EPJ Quantum Technol.</source> <volume>9</volume>, <fpage>5</fpage>. <pub-id pub-id-type="doi">10.1140/epjqt/s40507-022-00123-4</pub-id>
</citation>
</ref>
<ref id="B2">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Au-Yeung</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Chancellor</surname>
<given-names>N.</given-names>
</name>
<name>
<surname>Halffmann</surname>
<given-names>P.</given-names>
</name>
</person-group> (<year>2023</year>). <article-title>NP-Hard but no longer hard to solve? Using quantum computing to tackle optimization problems</article-title>. <source>Front. Quantum Sci. Technol.</source> <volume>2</volume>, <fpage>1128576</fpage>. <pub-id pub-id-type="doi">10.3389/frqst.2023.1128576</pub-id>
</citation>
</ref>
<ref id="B3">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Bak&#xf3;</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Glos</surname>
<given-names>O.</given-names>
</name>
<name>
<surname>Salehi</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Zimbor&#xe1;s</surname>
<given-names>Z.</given-names>
</name>
</person-group> (<year>2022</year>). <source>Near-optimal circuit design for variational quantum optimization</source>. <comment>arXiv:2209.03386</comment>. <pub-id pub-id-type="doi">10.48550/arXiv.2209.03386</pub-id>
</citation>
</ref>
<ref id="B4">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>B&#xe4;rtschi</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Eidenbenz</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>2020</year>). &#x201c;<article-title>Grover mixers for QAOA: shifting complexity from mixer design to state preparation</article-title>,&#x201d; in <source>2020 IEEE international conference on quantum computing and engineering (QCE)</source>, <fpage>72</fpage>&#x2013;<lpage>82</lpage>. <pub-id pub-id-type="doi">10.1109/QCE49297.2020.00020</pub-id>
</citation>
</ref>
<ref id="B5">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Berge</surname>
<given-names>C.</given-names>
</name>
</person-group> (<year>1987</year>). <source>Hypergraphs</source>. <publisher-loc>Amersterdam</publisher-loc>: <publisher-name>Elsevier</publisher-name>.</citation>
</ref>
<ref id="B6">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Berwald</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Chancellor</surname>
<given-names>N.</given-names>
</name>
<name>
<surname>Dridi</surname>
<given-names>R.</given-names>
</name>
</person-group> (<year>2023</year>). <article-title>Understanding domain-wall encoding theoretically and experimentally</article-title>. <source>Phil. Trans. R. Soc. A</source> <volume>381</volume>, <fpage>20210410</fpage>. <pub-id pub-id-type="doi">10.1098/rsta.2021.0410</pub-id>
</citation>
</ref>
<ref id="B7">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Boulebnane</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Montanaro</surname>
<given-names>A.</given-names>
</name>
</person-group> (<year>2022</year>). <source>Solving boolean satisfiability problems with the quantum approximate optimization algorithm</source>. <comment>arXiv preprint arXiv:2208.06909</comment>. <pub-id pub-id-type="doi">10.48550/arXiv.2208.06909</pub-id>
</citation>
</ref>
<ref id="B8">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Cao</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Romero</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Olson</surname>
<given-names>J. P.</given-names>
</name>
<name>
<surname>Degroote</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Johnson</surname>
<given-names>P. D.</given-names>
</name>
<name>
<surname>Kieferov&#xe1;</surname>
<given-names>M.</given-names>
</name>
<etal/>
</person-group> (<year>2019</year>). <article-title>Quantum chemistry in the age of quantum computing</article-title>. <source>Chem. Rev.</source> <volume>119</volume>, <fpage>10856</fpage>&#x2013;<lpage>10915</lpage>. <pub-id pub-id-type="doi">10.1021/acs.chemrev.8b00803</pub-id>
</citation>
</ref>
<ref id="B9">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Carugno</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Ferrari Dacrema</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Cremonesi</surname>
<given-names>P.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Evaluating the job shop scheduling problem on a D-wave quantum annealer</article-title>. <source>Sci. Rep.</source> <volume>12</volume>, <fpage>6539</fpage>. <pub-id pub-id-type="doi">10.1038/s41598-022-10169-0</pub-id>
</citation>
</ref>
<ref id="B10">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Chancellor</surname>
<given-names>N.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Domain wall encoding of discrete variables for quantum annealing and QAOA</article-title>. <source>Quantum Sci. Technol.</source> <volume>4</volume>, <fpage>045004</fpage>. <pub-id pub-id-type="doi">10.1088/2058-9565/ab33c2</pub-id>
</citation>
</ref>
<ref id="B11">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Chancellor</surname>
<given-names>N.</given-names>
</name>
<name>
<surname>Zohren</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Warburton</surname>
<given-names>P. A.</given-names>
</name>
</person-group> (<year>2017</year>). <article-title>Circuit design for multi-body interactions in superconducting quantum annealing systems with applications to a scalable architecture</article-title>. <source>npj Quantum Inf.</source> <volume>3</volume>, <fpage>21</fpage>. <pub-id pub-id-type="doi">10.1038/s41534-017-0022-6</pub-id>
</citation>
</ref>
<ref id="B12">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Chen</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Stollenwerk</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Chancellor</surname>
<given-names>N.</given-names>
</name>
</person-group> (<year>2021</year>). <article-title>Performance of domain-wall encoding for quantum annealing</article-title>. <source>IEEE Trans. Quantum Eng.</source> <volume>2</volume>, <fpage>1</fpage>&#x2013;<lpage>14</lpage>. <pub-id pub-id-type="doi">10.1109/TQE.2021.3094280</pub-id>
</citation>
</ref>
<ref id="B13">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Choi</surname>
<given-names>V.</given-names>
</name>
</person-group> (<year>2010</year>). <source>Adiabatic quantum algorithms for the NP-complete maximum-weight independent set, exact cover and 3SAT problems</source>. <comment>arXiv:1004.2226</comment>. <pub-id pub-id-type="doi">10.48550/ARXIV.1004.2226</pub-id>
</citation>
</ref>
<ref id="B14">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Devroye</surname>
<given-names>L.</given-names>
</name>
<name>
<surname>Epstein</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Sack</surname>
<given-names>J.-R.</given-names>
</name>
</person-group> (<year>1993</year>). <article-title>On generating random intervals and hyperrectangles</article-title>. <source>J. Comput. Graph. Stat.</source> <volume>2</volume>, <fpage>291</fpage>&#x2013;<lpage>307</lpage>. <pub-id pub-id-type="doi">10.2307/1390647</pub-id>
</citation>
</ref>
<ref id="B15">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Di Matteo</surname>
<given-names>O.</given-names>
</name>
<name>
<surname>McCoy</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Gysbers</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Miyagi</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Woloshyn</surname>
<given-names>R. M.</given-names>
</name>
<name>
<surname>Navr&#xe1;til</surname>
<given-names>P.</given-names>
</name>
</person-group> (<year>2021</year>). <article-title>Improving Hamiltonian encodings with the Gray code</article-title>. <source>Phys. Rev. A</source> <volume>103</volume>, <fpage>042405</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevA.103.042405</pub-id>
</citation>
</ref>
<ref id="B16">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Dlaska</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Ender</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Mbeng</surname>
<given-names>G. B.</given-names>
</name>
<name>
<surname>Kruckenhauser</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Lechner</surname>
<given-names>W.</given-names>
</name>
<name>
<surname>van Bijnen</surname>
<given-names>R.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Quantum optimization via four-body rydberg gates</article-title>. <source>Phys. Rev. Lett.</source> <volume>128</volume>, <fpage>120503</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevLett.128.120503</pub-id>
</citation>
</ref>
<ref id="B17">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Dorigo</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Di Caro</surname>
<given-names>G.</given-names>
</name>
</person-group> (<year>1999</year>). &#x201c;<article-title>Ant colony optimization: a new meta-heuristic</article-title>,&#x201d; in <source>Proceedings of the 1999 congress on evolutionary computation-CEC99 (Cat. No. 99TH8406)</source> (<publisher-name>IEEE</publisher-name>), <volume>2</volume>, <fpage>1470</fpage>&#x2013;<lpage>1477</lpage>. <pub-id pub-id-type="doi">10.1109/CEC.1999.782657</pub-id>
</citation>
</ref>
<ref id="B18">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Drieb-Sch&#xf6;n</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Javanmard</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Ender</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Lechner</surname>
<given-names>W.</given-names>
</name>
</person-group> (<year>2023</year>). <article-title>Parity quantum optimization: encoding constraints</article-title>. <source>Quantum</source> <volume>7</volume>, <fpage>951</fpage>. <pub-id pub-id-type="doi">10.22331/q-2023-03-17-951</pub-id>
</citation>
</ref>
<ref id="B19">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Elliott</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Golub</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Jackson</surname>
<given-names>M. O.</given-names>
</name>
</person-group> (<year>2014</year>). <article-title>Financial networks and contagion</article-title>. <source>Am. Econ. Rev.</source> <volume>104</volume>, <fpage>3115</fpage>&#x2013;<lpage>3153</lpage>. <pub-id pub-id-type="doi">10.1257/aer.104.10.3115</pub-id>
</citation>
</ref>
<ref id="B20">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Ender</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Messinger</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Fellner</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Dlaska</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Lechner</surname>
<given-names>W.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Modular parity quantum approximate optimization</article-title>. <source>PRX Quantum</source> <volume>3</volume>, <fpage>030304</fpage>. <pub-id pub-id-type="doi">10.1103/prxquantum.3.030304</pub-id>
</citation>
</ref>
<ref id="B21">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Ender</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>ter Hoeven</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Niehoff</surname>
<given-names>B. E.</given-names>
</name>
<name>
<surname>Drieb-Sch&#xf6;n</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Lechner</surname>
<given-names>W.</given-names>
</name>
</person-group> (<year>2023</year>). <article-title>Parity quantum optimization: compiler</article-title>. <source>Quantum</source> <volume>7</volume>, <fpage>950</fpage>. <pub-id pub-id-type="doi">10.22331/q-2023-03-17-950</pub-id>
</citation>
</ref>
<ref id="B22">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Farhi</surname>
<given-names>E.</given-names>
</name>
<name>
<surname>Goldstone</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Gutmann</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>2014</year>). <source>A quantum approximate optimization algorithm</source>, <fpage>4028</fpage>. <comment>arXiv:1411</comment>. <pub-id pub-id-type="doi">10.48550/ARXIV.1411.4028</pub-id>
</citation>
</ref>
<ref id="B23">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Farhi</surname>
<given-names>E.</given-names>
</name>
<name>
<surname>Goldstone</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Gutmann</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Sipser</surname>
<given-names>M.</given-names>
</name>
</person-group> (<year>2000</year>). <source>Quantum computation by adiabatic evolution</source>. <comment>arXiv:quant-ph/0001106</comment>. <pub-id pub-id-type="doi">10.48550/ARXIV.QUANT-PH/0001106</pub-id>
</citation>
</ref>
<ref id="B24">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Feld</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Roch</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Gabor</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Seidel</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Neukart</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Galter</surname>
<given-names>I.</given-names>
</name>
<etal/>
</person-group> (<year>2019</year>). <article-title>A hybrid solution method for the capacitated Vehicle routing problem using a quantum annealer</article-title>. <source>Front. ICT</source> <volume>6</volume>. <pub-id pub-id-type="doi">10.3389/fict.2019.00013</pub-id>
</citation>
</ref>
<ref id="B25">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Fellner</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Ender</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>ter Hoeven</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Lechner</surname>
<given-names>W.</given-names>
</name>
</person-group> (<year>2023</year>). <article-title>Parity quantum optimization: benchmarks</article-title>. <source>Quantum</source> <volume>7</volume>, <fpage>952</fpage>. <pub-id pub-id-type="doi">10.22331/q-2023-03-17-952</pub-id>
</citation>
</ref>
<ref id="B26">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Fellner</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Messinger</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Ender</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Lechner</surname>
<given-names>W.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Universal parity quantum computing</article-title>. <source>Phys. Rev. Lett.</source> <volume>129</volume>, <fpage>180503</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevLett.129.180503</pub-id>
</citation>
</ref>
<ref id="B27">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Fuchs</surname>
<given-names>F. G.</given-names>
</name>
<name>
<surname>Kolden</surname>
<given-names>H. O.</given-names>
</name>
<name>
<surname>Aase</surname>
<given-names>N. H.</given-names>
</name>
<name>
<surname>Sartor</surname>
<given-names>G.</given-names>
</name>
</person-group> (<year>2021</year>). <article-title>Efficient encoding of the weighted MAX <italic>k</italic>-CUT on a quantum computer using QAOA</article-title>. <source>SN Comput. Sci.</source> <volume>2</volume>, <fpage>89</fpage>. <pub-id pub-id-type="doi">10.1007/s42979-020-00437-z</pub-id>
</citation>
</ref>
<ref id="B28">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Fuchs</surname>
<given-names>F. G.</given-names>
</name>
<name>
<surname>Lye</surname>
<given-names>K. O.</given-names>
</name>
<name>
<surname>Nilsen</surname>
<given-names>H. M.</given-names>
</name>
<name>
<surname>Stasik</surname>
<given-names>A. J.</given-names>
</name>
<name>
<surname>Sartor</surname>
<given-names>G.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Constraint preserving mixers for the quantum approximate optimization algorithm</article-title>. <source>Algorithms</source> <volume>15</volume>, <fpage>202</fpage>. <pub-id pub-id-type="doi">10.3390/a15060202</pub-id>
</citation>
</ref>
<ref id="B29">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Georgescu</surname>
<given-names>I. M.</given-names>
</name>
<name>
<surname>Ashhab</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Nori</surname>
<given-names>F.</given-names>
</name>
</person-group> (<year>2014</year>). <article-title>Quantum simulation</article-title>. <source>Rev. Mod. Phys.</source> <volume>86</volume>, <fpage>153</fpage>&#x2013;<lpage>185</lpage>. <pub-id pub-id-type="doi">10.1103/RevModPhys.86.153</pub-id>
</citation>
</ref>
<ref id="B30">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Glaser</surname>
<given-names>N. J.</given-names>
</name>
<name>
<surname>Roy</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Filipp</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>2023</year>). <article-title>Controlled-controlled-phase gates for superconducting qubits mediated by a shared tunable coupler</article-title>. <source>Phys. Rev. Appl.</source> <volume>19</volume>, <fpage>044001</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevApplied.19.044001</pub-id>
</citation>
</ref>
<ref id="B31">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Glos</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Krawiec</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Zimbor&#xe1;s</surname>
<given-names>Z.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Space-efficient binary optimization for variational quantum computing</article-title>. <source>npj Quantum Inf.</source> <volume>8</volume>, <fpage>39</fpage>. <pub-id pub-id-type="doi">10.1038/s41534-022-00546-y</pub-id>
</citation>
</ref>
<ref id="B32">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Guerreschi</surname>
<given-names>G. G.</given-names>
</name>
<name>
<surname>Matsuura</surname>
<given-names>A. Y.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Qaoa for max-cut requires hundreds of qubits for quantum speed-up</article-title>. <source>Sci. Rep.</source> <volume>9</volume>, <fpage>6903</fpage>. <pub-id pub-id-type="doi">10.1038/s41598-019-43176-9</pub-id>
</citation>
</ref>
<ref id="B33">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Hadfield</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>2021</year>). <article-title>On the representation of Boolean and real functions as Hamiltonians for quantum computing</article-title>. <source>ACM Trans. Quant. Comput.</source> <volume>2</volume>, <fpage>1</fpage>&#x2013;<lpage>21</lpage>. <pub-id pub-id-type="doi">10.1145/3478519</pub-id>
</citation>
</ref>
<ref id="B34">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Hadfield</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Wang</surname>
<given-names>Z.</given-names>
</name>
<name>
<surname>O&#x2019;Gorman</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Rieffel</surname>
<given-names>E. G.</given-names>
</name>
<name>
<surname>Venturelli</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Biswas</surname>
<given-names>R.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>From the quantum approximate optimization algorithm to a quantum alternating operator ansatz</article-title>. <source>Algorithms</source> <volume>12</volume>, <fpage>34</fpage>. <pub-id pub-id-type="doi">10.3390/a12020034</pub-id>
</citation>
</ref>
<ref id="B35">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Hadfield</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Wang</surname>
<given-names>Z.</given-names>
</name>
<name>
<surname>Rieffel</surname>
<given-names>E. G.</given-names>
</name>
<name>
<surname>O&#x2019;Gorman</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Venturelli</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Biswas</surname>
<given-names>R.</given-names>
</name>
</person-group> (<year>2017</year>). <source>Quantum approximate optimization with hard and soft constraints. PMES&#x2019;17</source>. <publisher-loc>New York, NY, USA</publisher-loc>: <publisher-name>Association for Computing Machinery</publisher-name>. <pub-id pub-id-type="doi">10.1145/3149526.3149530</pub-id>
</citation>
</ref>
<ref id="B36">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Hen</surname>
<given-names>I.</given-names>
</name>
<name>
<surname>Sarandy</surname>
<given-names>M. S.</given-names>
</name>
</person-group> (<year>2016</year>). <article-title>Driver Hamiltonians for constrained optimization in quantum annealing</article-title>. <source>Phys. Rev. A</source> <volume>93</volume>, <fpage>062312</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevA.93.062312</pub-id>
</citation>
</ref>
<ref id="B37">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Hen</surname>
<given-names>I.</given-names>
</name>
<name>
<surname>Spedalieri</surname>
<given-names>F. M.</given-names>
</name>
</person-group> (<year>2016</year>). <article-title>Quantum annealing for constrained optimization</article-title>. <source>Phys. Rev. Appl.</source> <volume>5</volume>, <fpage>034007</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevApplied.5.034007</pub-id>
</citation>
</ref>
<ref id="B38">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Ikeda</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Nakamura</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Humble</surname>
<given-names>T. S.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Application of quantum annealing to nurse scheduling problem</article-title>. <source>Sci. Rep.</source> <volume>9</volume>, <fpage>12837</fpage>. <pub-id pub-id-type="doi">10.1038/s41598-019-49172-3</pub-id>
</citation>
</ref>
<ref id="B39">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Izawa</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Kitai</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Tanaka</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Tamura</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Tsuda</surname>
<given-names>K.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Continuous black-box optimization with an ising machine and random subspace coding</article-title>. <source>Phys. Rev. Res.</source> <volume>4</volume>, <fpage>023062</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevResearch.4.023062</pub-id>
</citation>
</ref>
<ref id="B40">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>King</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Yarkoni</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Raymond</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Ozfidan</surname>
<given-names>I.</given-names>
</name>
<name>
<surname>King</surname>
<given-names>A. D.</given-names>
</name>
<name>
<surname>Nevisi</surname>
<given-names>M. M.</given-names>
</name>
<etal/>
</person-group> (<year>2019</year>). <article-title>Quantum annealing amid local ruggedness and global frustration</article-title>. <source>J. Phys. Soc. Jpn.</source> <volume>88</volume>, <fpage>061007</fpage>. <pub-id pub-id-type="doi">10.7566/JPSJ.88.061007</pub-id>
</citation>
</ref>
<ref id="B41">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Kochenberger</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Hao</surname>
<given-names>J.-K.</given-names>
</name>
<name>
<surname>Glover</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Lewis</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>L&#xfc;</surname>
<given-names>Z.</given-names>
</name>
<name>
<surname>Wang</surname>
<given-names>H.</given-names>
</name>
<etal/>
</person-group> (<year>2014</year>). <article-title>The unconstrained binary quadratic programming problem: a survey</article-title>. <source>J. Comb. Optim.</source> <volume>28</volume>, <fpage>58</fpage>&#x2013;<lpage>81</lpage>. <pub-id pub-id-type="doi">10.1007/s10878-014-9734-0</pub-id>
</citation>
</ref>
<ref id="B42">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Kurowski</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Weglarz</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Subocz</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>R&#xf3;&#x17c;ycki</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Walig&#xf3;ra</surname>
<given-names>G.</given-names>
</name>
</person-group> (<year>2020</year>). &#x201c;<article-title>Hybrid quantum annealing heuristic method for solving job shop scheduling problem</article-title>,&#x201d; in <source>Computational science &#x2013; ICCS 2020</source>. Editors <person-group person-group-type="editor">
<name>
<surname>Krzhizhanovskaya</surname>
<given-names>V. V.</given-names>
</name>
<name>
<surname>Z&#xe1;vodszky</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Lees</surname>
<given-names>M. H.</given-names>
</name>
<name>
<surname>Dongarra</surname>
<given-names>J. J.</given-names>
</name>
<name>
<surname>Sloot</surname>
<given-names>P. M. A.</given-names>
</name>
<name>
<surname>Brissos</surname>
<given-names>S.</given-names>
</name>
<etal/>
</person-group> (<publisher-name>Springer International Publishing</publisher-name>), <fpage>502</fpage>&#x2013;<lpage>515</lpage>.</citation>
</ref>
<ref id="B43">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Lai</surname>
<given-names>C.-Y.</given-names>
</name>
<name>
<surname>Kuo</surname>
<given-names>K.-Y.</given-names>
</name>
<name>
<surname>Liao</surname>
<given-names>B.-J.</given-names>
</name>
</person-group> (<year>2022</year>). <source>Syndrome decoding by quantum approximate optimization</source>. <comment>arXiv:2207.05942</comment>. <pub-id pub-id-type="doi">10.48550/ARXIV.2207.05942</pub-id>
</citation>
</ref>
<ref id="B44">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lanthaler</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Lechner</surname>
<given-names>W.</given-names>
</name>
</person-group> (<year>2021</year>). <article-title>Minimal constraints in the parity formulation of optimization problems</article-title>. <source>New J. Phys.</source> <volume>23</volume>, <fpage>083039</fpage>. <pub-id pub-id-type="doi">10.1088/1367-2630/ac1897</pub-id>
</citation>
</ref>
<ref id="B45">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lechner</surname>
<given-names>W.</given-names>
</name>
<name>
<surname>Hauke</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Zoller</surname>
<given-names>P.</given-names>
</name>
</person-group> (<year>2015</year>). <article-title>A quantum annealing architecture with all-to-all connectivity from local interactions</article-title>. <source>Sci. Adv.</source> <volume>1</volume>, <fpage>e1500838</fpage>. <pub-id pub-id-type="doi">10.1126/sciadv.1500838</pub-id>
</citation>
</ref>
<ref id="B46">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lechner</surname>
<given-names>W.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>Quantum approximate optimization with parallelizable gates</article-title>. <source>IEEE Trans. Quantum Eng.</source> <volume>1</volume>, <fpage>1</fpage>&#x2013;<lpage>6</lpage>. <pub-id pub-id-type="doi">10.1109/TQE.2020.3034798</pub-id>
</citation>
</ref>
<ref id="B47">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lenstra</surname>
<given-names>J. K.</given-names>
</name>
<name>
<surname>Rinnooy Kan</surname>
<given-names>A. H. G.</given-names>
</name>
</person-group> (<year>1979</year>). <article-title>Computational complexity of discrete optimization problems</article-title>. <source>AODM</source> <volume>4</volume>, <fpage>121</fpage>&#x2013;<lpage>140</lpage>. <pub-id pub-id-type="doi">10.1016/S0167-5060(08)70821-5</pub-id>
</citation>
</ref>
<ref id="B48">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lu</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Zhang</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Zhang</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Chen</surname>
<given-names>W.</given-names>
</name>
<name>
<surname>Shen</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Zhang</surname>
<given-names>J.</given-names>
</name>
<etal/>
</person-group> (<year>2019</year>). <article-title>Global entangling gates on arbitrary ion qubits</article-title>. <source>Nature</source> <volume>572</volume>, <fpage>363</fpage>&#x2013;<lpage>367</lpage>. <pub-id pub-id-type="doi">10.1038/s41586-019-1428-4</pub-id>
</citation>
</ref>
<ref id="B49">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lucas</surname>
<given-names>A.</given-names>
</name>
</person-group> (<year>2014</year>). <article-title>Ising formulations of many NP problems</article-title>. <source>Front. Phys.</source> <volume>2</volume>, <fpage>5</fpage>. <pub-id pub-id-type="doi">10.3389/fphy.2014.00005</pub-id>
</citation>
</ref>
<ref id="B50">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Mandra</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Zhu</surname>
<given-names>Z.</given-names>
</name>
<name>
<surname>Wang</surname>
<given-names>W.</given-names>
</name>
<name>
<surname>Perdomo-Ortiz</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Katzgraber</surname>
<given-names>H. G.</given-names>
</name>
</person-group> (<year>2016</year>). <article-title>Strengths and weaknesses of weak-strong cluster problems: a detailed overview of state-of-the-art classical heuristics versus quantum approaches</article-title>. <source>Phys. Rev. A</source> <volume>94</volume>, <fpage>022337</fpage>. <pub-id pub-id-type="doi">10.1103/physreva.94.022337</pub-id>
</citation>
</ref>
<ref id="B51">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Mazyavkina</surname>
<given-names>N.</given-names>
</name>
<name>
<surname>Sviridov</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Ivanov</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Burnaev</surname>
<given-names>E.</given-names>
</name>
</person-group> (<year>2021</year>). <article-title>Reinforcement learning for combinatorial optimization: a survey</article-title>. <source>Comput. Oper. Res.</source> <volume>134</volume>, <fpage>105400</fpage>. <pub-id pub-id-type="doi">10.1016/j.cor.2021.105400</pub-id>
</citation>
</ref>
<ref id="B52">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>McArdle</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Endo</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Aspuru-Guzik</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Benjamin</surname>
<given-names>S. C.</given-names>
</name>
<name>
<surname>Yuan</surname>
<given-names>X.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>Quantum computational chemistry</article-title>. <source>Rev. Mod. Phys.</source> <volume>92</volume>, <fpage>015003</fpage>. <pub-id pub-id-type="doi">10.1103/RevModPhys.92.015003</pub-id>
</citation>
</ref>
<ref id="B53">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Melnikov</surname>
<given-names>B.</given-names>
</name>
</person-group> (<year>2005</year>). &#x201c;<article-title>Discrete optimization problems-some new heuristic approaches</article-title>,&#x201d; in <source>Eighth international conference on high-performance computing in asia-pacific region (HPCASIA&#x2019;05)</source> (<publisher-name>IEEE</publisher-name>), <fpage>73</fpage>&#x2013;<lpage>82</lpage>. <pub-id pub-id-type="doi">10.1109/HPCASIA.2005.34</pub-id>
</citation>
</ref>
<ref id="B54">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Menke</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Banner</surname>
<given-names>W. P.</given-names>
</name>
<name>
<surname>Bergamaschi</surname>
<given-names>T. R.</given-names>
</name>
<name>
<surname>Di Paolo</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Veps&#xe4;l&#xe4;inen</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Weber</surname>
<given-names>S. J.</given-names>
</name>
<etal/>
</person-group> (<year>2022</year>). <article-title>Demonstration of tunable three-body interactions between superconducting qubits</article-title>. <source>Phys. Rev. Lett.</source> <volume>129</volume>, <fpage>220501</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevLett.129.220501</pub-id>
</citation>
</ref>
<ref id="B55">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Menke</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>H&#xe4;se</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Gustavsson</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Kerman</surname>
<given-names>A. J.</given-names>
</name>
<name>
<surname>Oliver</surname>
<given-names>W. D.</given-names>
</name>
<name>
<surname>Aspuru-Guzik</surname>
<given-names>A.</given-names>
</name>
</person-group> (<year>2021</year>). <article-title>Automated design of superconducting circuits and its application to 4-local couplers</article-title>. <source>npj Quantum Inf.</source> <volume>7</volume>, <fpage>49</fpage>. <pub-id pub-id-type="doi">10.1038/s41534-021-00382-6</pub-id>
</citation>
</ref>
<ref id="B56">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Messinger</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Fellner</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Lechner</surname>
<given-names>W.</given-names>
</name>
</person-group> (<year>2023</year>). <source>Constant depth code deformations in the parity architecture</source>. <comment>arXiv:2303.08602</comment>. <pub-id pub-id-type="doi">10.48550/arXiv.2303.08602</pub-id>
</citation>
</ref>
<ref id="B57">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Mohseni</surname>
<given-names>N.</given-names>
</name>
<name>
<surname>McMahon</surname>
<given-names>P. L.</given-names>
</name>
<name>
<surname>Byrnes</surname>
<given-names>T.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Ising machines as hardware solvers of combinatorial optimization problems</article-title>. <source>Nat. Rev. Phys.</source> <volume>4</volume>, <fpage>363</fpage>&#x2013;<lpage>379</lpage>. <pub-id pub-id-type="doi">10.1038/s42254-022-00440-8</pub-id>
</citation>
</ref>
<ref id="B58">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Montanez-Barrera</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Maldonado-Romo</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Willsch</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Michielsen</surname>
<given-names>K.</given-names>
</name>
</person-group> (<year>2022</year>). <source>Unbalanced penalization: a new approach to encode inequality constraints of combinatorial problems for quantum optimization algorithms</source>. <comment>arXiv:2211.13914</comment>. <pub-id pub-id-type="doi">10.48550/arXiv.2211.13914</pub-id>
</citation>
</ref>
<ref id="B59">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Or&#xfa;s</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Mugel</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Lizaso</surname>
<given-names>E.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Forecasting financial crashes with quantum computing</article-title>. <source>Phys. Rev. A</source> <volume>99</volume>, <fpage>060301</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevA.99.060301</pub-id>
</citation>
</ref>
<ref id="B60">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Pastawski</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Preskill</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>2016</year>). <article-title>Error correction for encoded quantum annealing</article-title>. <source>Phys. Rev. A</source> <volume>93</volume>, <fpage>052325</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevA.93.052325</pub-id>
</citation>
</ref>
<ref id="B61">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Pelegr&#xed;</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Daley</surname>
<given-names>A. J.</given-names>
</name>
<name>
<surname>Pritchard</surname>
<given-names>J. D.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>High-fidelity multiqubit Rydberg gates via two-photon adiabatic rapid passage</article-title>. <source>Quantum Sci. Technol.</source> <volume>7</volume>, <fpage>045020</fpage>. <pub-id pub-id-type="doi">10.1088/2058-9565/ac823a</pub-id>
</citation>
</ref>
<ref id="B62">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Plewa</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Sie&#x144;ko</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Rycerz</surname>
<given-names>K.</given-names>
</name>
</person-group> (<year>2021</year>). <article-title>Variational algorithms for workflow scheduling problem in gate-based quantum devices</article-title>. <source>Comput. Inf.</source> <volume>40</volume>, <fpage>897</fpage>&#x2013;<lpage>929</lpage>. <pub-id pub-id-type="doi">10.31577/cai_2021_4_897</pub-id>
</citation>
</ref>
<ref id="B63">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Preskill</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>2018</year>). <article-title>Quantum computing in the NISQ era and beyond</article-title>. <source>Quantum</source> <volume>2</volume>, <fpage>79</fpage>. <pub-id pub-id-type="doi">10.22331/q-2018-08-06-79</pub-id>
</citation>
</ref>
<ref id="B64">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Rachkovskii</surname>
<given-names>D. A.</given-names>
</name>
<name>
<surname>Slipchenko</surname>
<given-names>S. V.</given-names>
</name>
<name>
<surname>Kussul</surname>
<given-names>E. M.</given-names>
</name>
<name>
<surname>Baidyk</surname>
<given-names>T. N.</given-names>
</name>
</person-group> (<year>2005</year>). <article-title>Properties of numeric codes for the scheme of random subspaces rsc</article-title>. <source>Cybern. Syst. Anal.</source> <volume>41</volume>, <fpage>509</fpage>&#x2013;<lpage>520</lpage>. <pub-id pub-id-type="doi">10.1007/s10559-005-0086-8</pub-id>
</citation>
</ref>
<ref id="B65">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Ramos-Calderer</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>P&#xe9;rez-Salinas</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Garc&#xed;a-Mart&#xed;n</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Bravo-Prieto</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Cortada</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Planagum&#xe0;</surname>
<given-names>J.</given-names>
</name>
<etal/>
</person-group> (<year>2021</year>). <article-title>Quantum unary approach to option pricing</article-title>. <source>Phys. Rev. A</source> <volume>103</volume>, <fpage>032414</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevA.103.032414</pub-id>
</citation>
</ref>
<ref id="B66">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Rosenberg</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Haghnegahdar</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Goddard</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Carr</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Wu</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>de Prado</surname>
<given-names>M. L.</given-names>
</name>
</person-group> (<year>2015</year>). &#x201c;<article-title>Solving the optimal trading trajectory problem using a quantum annealer</article-title>,&#x201d; in <source>Proceedings of the 8th workshop on high performance computational finance</source> (<publisher-loc>New York, NY, USA</publisher-loc>: <publisher-name>Association for Computing Machinery</publisher-name>). <pub-id pub-id-type="doi">10.1145/2830556.2830563</pub-id>
</citation>
</ref>
<ref id="B67">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Sawaya</surname>
<given-names>N. P. D.</given-names>
</name>
<name>
<surname>Menke</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Kyaw</surname>
<given-names>T. H.</given-names>
</name>
<name>
<surname>Johri</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Aspuru-Guzik</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Guerreschi</surname>
<given-names>G. G.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>Resource-efficient digital quantum simulation of d-level systems for photonic, vibrational, and spin-s Hamiltonians</article-title>. <source>npj Quantum Inf.</source> <volume>6</volume>, <fpage>49</fpage>. <pub-id pub-id-type="doi">10.1038/s41534-020-0278-0</pub-id>
</citation>
</ref>
<ref id="B68">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Sawaya</surname>
<given-names>N. P. D.</given-names>
</name>
<name>
<surname>Schmitz</surname>
<given-names>A. T.</given-names>
</name>
<name>
<surname>Hadfield</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>2022</year>). <source>Encoding trade-offs and design toolkits in quantum algorithms for discrete optimization: coloring, routing, scheduling, and other problems</source>, <fpage>14432</fpage>. <comment>arXiv:2203</comment>. <pub-id pub-id-type="doi">10.48550/arXiv.2203.14432</pub-id>
</citation>
</ref>
<ref id="B69">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Sch&#xf6;ndorf</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Wilhelm</surname>
<given-names>F. K.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Nonpairwise interactions induced by virtual transitions in four coupled artificial atoms</article-title>. <source>Phys. Rev. Appl.</source> <volume>12</volume>, <fpage>064026</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevApplied.12.064026</pub-id>
</citation>
</ref>
<ref id="B70">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Stein</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Chamanian</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Zorn</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>N&#xfc;&#xdf;lein</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Zielinski</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>K&#xf6;lle</surname>
<given-names>M.</given-names>
</name>
<etal/>
</person-group> (<year>2023</year>). <source>Evidence that PUBO outperforms QUBO when solving continuous optimization problems with the QAOA</source>. <comment>arXiv:2305.03390</comment>. <pub-id pub-id-type="doi">10.48550/arXiv.2305.03390</pub-id>
</citation>
</ref>
<ref id="B71">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Tamura</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Shirai</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Katsura</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Tanaka</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Togawa</surname>
<given-names>N.</given-names>
</name>
</person-group> (<year>2021</year>). <article-title>Performance comparison of typical binary-integer encodings in an ising machine</article-title>. <source>IEEE Access</source> <volume>9</volume>, <fpage>81032</fpage>&#x2013;<lpage>81039</lpage>. <pub-id pub-id-type="doi">10.1109/ACCESS.2021.3081685</pub-id>
</citation>
</ref>
<ref id="B72">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Tseitin</surname>
<given-names>G. S.</given-names>
</name>
</person-group> (<year>1983</year>). &#x201c;<article-title>On the complexity of derivation in propositional calculus</article-title>,&#x201d; in <source>Automation of reasoning</source> (<publisher-name>Springer</publisher-name>), <fpage>466</fpage>&#x2013;<lpage>483</lpage>. <pub-id pub-id-type="doi">10.1007/978-3-642-81955-1_28</pub-id>
</citation>
</ref>
<ref id="B73">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Unger</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Messinger</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Niehoff</surname>
<given-names>B. E.</given-names>
</name>
<name>
<surname>Fellner</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Lechner</surname>
<given-names>W.</given-names>
</name>
</person-group> (<year>2022</year>). <source>Low-depth circuit implementation of parity constraints for quantum optimization</source>, <fpage>11287</fpage>. <comment>arXiv:2211</comment>. <pub-id pub-id-type="doi">10.48550/ARXIV.2211.11287</pub-id>
</citation>
</ref>
<ref id="B74">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Venturelli</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Marchand</surname>
<given-names>D. J. J.</given-names>
</name>
<name>
<surname>Rojo</surname>
<given-names>G.</given-names>
</name>
</person-group> (<year>2015</year>). <article-title>Quantum annealing implementation of job-shop scheduling</article-title>. <comment>arXiv:1506.08479</comment>. <pub-id pub-id-type="doi">10.48550/ARXIV.1506.08479</pub-id>
</citation>
</ref>
<ref id="B75">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Wang</surname>
<given-names>Z.</given-names>
</name>
<name>
<surname>Rubin</surname>
<given-names>N. C.</given-names>
</name>
<name>
<surname>Dominy</surname>
<given-names>J. M.</given-names>
</name>
<name>
<surname>Rieffel</surname>
<given-names>E. G.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>XY mixers: analytical and numerical results for the quantum alternating operator ansatz</article-title>. <source>Phys. Rev. A</source> <volume>101</volume>, <fpage>012320</fpage>. <pub-id pub-id-type="doi">10.1103/PhysRevA.101.012320</pub-id>
</citation>
</ref>
<ref id="B76">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Wilkinson</surname>
<given-names>S. A.</given-names>
</name>
<name>
<surname>Hartmann</surname>
<given-names>M. J.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>Superconducting quantum many-body circuits for quantum simulation and computing</article-title>. <source>Appl. Phys. Lett.</source> <volume>116</volume>, <fpage>230501</fpage>. <pub-id pub-id-type="doi">10.1063/5.0008202</pub-id>
</citation>
</ref>
<ref id="B77">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Zhu</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Zhang</surname>
<given-names>Z.</given-names>
</name>
<name>
<surname>Sundar</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Green</surname>
<given-names>A. M.</given-names>
</name>
<name>
<surname>Alderete</surname>
<given-names>C. H.</given-names>
</name>
<name>
<surname>Nguyen</surname>
<given-names>N. H.</given-names>
</name>
<etal/>
</person-group> (<year>2023</year>). <article-title>Multi-round QAOA and advanced mixers on a trapped-ion quantum computer</article-title>. <source>Quantum Sci. Technol.</source> <volume>8</volume>, <fpage>015007</fpage>. <pub-id pub-id-type="doi">10.1088/2058-9565/ac91ef</pub-id>
</citation>
</ref>
</ref-list>
</back>
</article>