Abstract
Constrained optimization problems are ubiquitous in science and industry. Quantum algorithms have shown promise in solving optimization problems, yet none of the current algorithms can effectively handle arbitrary constraints. We introduce a technique that uses quantum Zeno dynamics to solve optimization problems with multiple arbitrary constraints, including inequalities. We show that the dynamics of quantum optimization can be efficiently restricted to the inconstraint subspace on a faulttolerant quantum computer via repeated projective measurements, requiring only a small number of auxiliary qubits and no postselection. Our technique has broad applicability, which we demonstrate by incorporating it into the quantum approximate optimization algorithm (QAOA) and variational quantum circuits for optimization. We evaluate our method numerically on portfolio optimization problems with multiple realistic constraints and observe better solution quality and higher inconstraint probability than stateoftheart techniques. We implement a proofofconcept demonstration of our method on the Quantinuum H12 quantum processor.
Similar content being viewed by others
Introduction
Combinatorial optimization is widely considered to be one of the most promising problem domains for quantum algorithms. The ubiquity of hard optimization problems in science and industry amplifies the impact of any improvements in algorithmic performance. In practice, the optimization problems often have many constraints, such as the regulatory constraints when optimizing a portfolio or logistic constraints when optimizing flight crew assignments. Being able to incorporate a diverse range of constraints is an essential criterion for the applicability of a quantum algorithm to industrial problems.
A commonly considered class of quantum optimization algorithms uses a parameterized quantum evolution to drive the quantum system towards a state encoding the solution of the optimization problem. This class of algorithms includes the quantum approximate optimization algorithm (QAOA)^{1,2} and variational algorithms for optimization^{3,4}. While these algorithms are often discussed as promising approaches for noisy nearterm devices^{5,6,7,8,9}. Therefore, in this paper we primarily view these algorithms as targeting faulttolerant quantum processors.
One of the main challenges in applying these quantum algorithms to commerciallyrelevant optimization problems is the need to enforce the constraints. Concretely, the goal is to prepare a quantum state such that upon measuring it, a highquality solution that satisfies the constraints is obtained with high probability. Two commonly considered approaches are to encode the constraint into the objective using a penalty term and to directly restrict the parameterized quantum evolution to the inconstraint subspace. In the first approach, a penalty term is added to the objective so that optimizing the objective requires satisfying the constraint. While such approaches are flexible enough to satisfy most constraints, the quality of the result is sensitive to the choice of the penalty strength^{10}. As tuning the penalty strength is difficult in general, this approach often leads to suboptimal performance in practice^{11}. This observation motivates the second approach, i.e., restricting the quantum evolution to the inconstraint subspace.
A number of techniques have been proposed to ensure that the parameterized quantum evolution respects the constraints of the problem. Hadfield et al.^{12,13} proposed the quantum alternating operator ansatz algorithm, which applies pairs of alternating operators to an inconstraint initial state. The first alternating operator (phase operator) is diagonal in the computational basis and encodes the objective, and the second operator (mixing operator or mixer) is nondiagonal and restricts the transitions of probability amplitudes to the computational basis states corresponding to the inconstraint solutions. The problem of constructing a Hamiltonian preserving arbitrary constraints is NPcomplete even for linear constraints^{14}, though explicit constructions are available for some combinatorial optimization problems^{12,13,15,16}. In general, constraintpreserving mixers are difficult to implement, even when constructions are available^{17,18}. The cost of implementing the algorithm on hardware can be reduced for a restricted class of problems by combining the phase and mixing operators^{19}. If a uniform superposition of inconstraint states can be prepared efficiently, a Grover operator can be used as the mixer^{20,21,22}. Finally, for problems with an indexable set of feasible states (such as those with Hammingweight constraints), a continuoustime quantum walk in the solution space can be used as a mixer^{23,24,25}. However, none of these techniques are sufficiently flexible to handle the general case of multiple arbitrary constraints directly. The parity optimization framework^{26,27,28,29,30} can natively handle polynomial equality constraints for QAOAlike circuits. However, this framework introduces an auxiliary qubit for every unique monomial term that appears, leading to large space overhead for complex objectives and constraints. All of the techniques mentioned above consider QAOAlike alternating operator circuits, and are not easy to generalize to other variational algorithms.
In this work, we introduce an approach for enforcing multiple arbitrary constraints in quantum optimization. We restrict the quantum evolution to the inconstraint subspace by repeated projective measurements. In each measurement, the value of the constraint is computed onto an auxiliary register, which is then measured. Our technique uses quantum Zeno dynamics, wherein the evolution of the system is restricted to the subspace defined by the repeated projective measurements and transitions outside of this subspace are suppressed. Our approach is applicable to any problem in NPO (the NP optimization complexity class), as the only restriction we impose on the constraints is the existence of an efficient oracle for testing them. We provide explicit constructions for arbitrary combinatorial constraints. We demonstrate the effectiveness of the proposed technique by using it to enforce constraints in QAOA with various, unconstrained, mixing operators and the layer variational quantum eigensolver (LVQE)^{31}, which is a variational quantum algorithm for optimization. We show analytically that our technique is guaranteed to obtain the optimal inconstraint solution when applied to the digital simulation of the quantum adiabatic algorithm, or equivalently to QAOA in the constrained subspace with sufficiently large depth. We derive an analytical form of the scaling of the number of measurements required to maintain a constant minimum success probability for any parameterized quantum evolution. Furthermore, we provide numerical evidence that our technique, applied to QAOA for the portfolio optimization problem with a budget constraint, provides significant performance improvements over the stateoftheart method of enforcing the constraint by introducing a penalty term. While the results we derive are for faulttolerant quantum processors, highfidelity nearterm devices may be able to implement the algorithms without realizing full errorcorrection. To demonstrate an endtoend realization of our technique, we implement QAOA with Zeno dynamics on the Quantinuum H12 trappedion quantum processor for proofofconcept portfolio optimization problems. These experiments complement our numerical simulations by using explicit constructions and compilations of circuits, including those for checking the constraints. In the hardware experiments, we observe performance improvements from increasing the number of measurements, up to a twoqubit circuit depth of 148.
Results
Quantum Zeno dynamics for constrained optimization
We now introduce our approach to enforcing constraints in quantum optimization by repeated nonselective projective measurements. Our method is general, though here we focus on algorithms utilizing parameterized states of the form
where H_{j} is some Hamiltonian, e.g., a tensor product of singlequbit Pauli operators, and \(\left\vert s\right\rangle\) is the initial state, which lies in the system Hilbert space \({{{{{{{\mathcal{H}}}}}}}}\).
A constrained combinatorial optimization problem has a set of feasible states \({{{{{{{\mathcal{F}}}}}}}}\), which is a subset of the ndimensional Boolean cube \({{\mathbb{B}}}^{n}\). Let \({P}_{{{{{{{{\mathcal{F}}}}}}}}}\) denote the orthogonal projector onto the subspace spanned by computational basis states corresponding to feasible solutions in \({{{{{{{\mathcal{F}}}}}}}}\). We discuss the construction of this operator in the Methods Section. The measurement \({{{{{{{\mathcal{P}}}}}}}}\) is a superoperator as defined as
where \(\mathop{\sum }\nolimits_{j = 1}^{k}{P}_{j}={{{{{{{\rm{I}}}}}}}}\), and P_{j} is a projection onto some subspace \({{{{{{{{\mathcal{H}}}}}}}}}_{j}={P}_{j}{{{{{{{\mathcal{H}}}}}}}}\) of dimensionality \({{{{{{{\rm{Tr}}}}}}}}({P}_{j})\ge 1\). Without loss of generality, we can assume \({P}_{1}={P}_{{{{{{{{\mathcal{F}}}}}}}}}\), and define \({P}_{{{{{{{{\mathcal{G}}}}}}}}}:= {{{{{{{\rm{I}}}}}}}}{P}_{{{{{{{{\mathcal{F}}}}}}}}}=\mathop{\sum }\nolimits_{j = 2}^{k}{P}_{j}\).
We give our main result in Theorem 1, which we use to derive the number of measurements required to enforce constraints in parameterized evolutions of the form given by Equation (1).
Theorem 1
Let \({{{{{{{\mathcal{P}}}}}}}}\) be the measurement defined in Equation (2). Suppose a system is evolved from some initial state ρ_{0} = P_{j}ρ_{0}P_{j} under the action of a Hamiltonian H, whose distinct eigenvalues are \({\xi }_{\min }={\xi }_{1} \, < \, {\xi }_{2} \, < \cdots < \, {\xi }_{d}={\xi }_{\max }\), for time θ. For δ≤0.19, if N applications of \({{{{{{{\mathcal{P}}}}}}}}\) are performed at equallyspaced time intervals with
then the probability of measuring a state in \({{{{{{{{\mathcal{H}}}}}}}}}_{j}\) at time θ is lower bounded by 1 − δ, i.e.,
where
Proof
See the Methods Section.
Remark 1
Note that since \(2{\parallel } H{\parallel }_{2}\ge  {\xi }_{\max }{\xi }_{\min }\), the bound can be reformulated in terms of the spectral norm of the Hamiltonian. This may be useful as the spectral norm may be easier to bound in practice for complicated Hamiltonians.
Assume that the initial state \(\left\vert s\right\rangle\) respects the constraints, that is \({P}_{{{{{{{{\mathcal{F}}}}}}}}}\left\vert s\right\rangle =\left\vert s\right\rangle\). We apply a parameterized unitary U(θ) to the initial state following Equation (1). To enforce the constraints, we can insert measurements into the parameterized evolution as follows:
where \(r(k,j)=\mathop{\sum }\nolimits_{t = 1}^{k1}{m}_{t}+j\) and each sequence of m_{k} parameterized evolutions, without a measurement, is called a block. We define N_{k} = 0 to mean that no measurement is performed and no θ_{r(k, j)} is not scaled for that block. The following corollarly provides a sufficient N_{k} for each block to ensure a desired minimum inconstraint probability. The asymptotic dynamics, i.e. when N_{k} → ∞, ∀ k and also called the Zeno limit, will be different depending on how the blocks are chosen.
Corollary 1
Let \({{{{{{{\mathcal{P}}}}}}}}\) be the measurement defined in Equation (1). Let the parameterized evolution defined in Equation (6) evolve the system from some initial state ρ_{0} = P_{j}ρ_{0}P_{j}. Then, in order to ensure that
it suffices to choose
where

\(\tau (\delta )=\ln {(12\delta )}^{2}\) if H_{r(k, j)} pairwise commute,

\(\tau (\delta )=\ln {\left(1\delta \right)}^{1.78}\) otherwise,
and δ≤0.19. In addition, the asymptotic dynamics is
where \({{{{{{{\mathcal{P}}}}}}}}\) acts elementwise on the vector \({{{{{{{{\boldsymbol{H}}}}}}}}}_{k}={({H}_{(k,1)},\ldots ,{H}_{(k,{m}_{k})})}^{{\mathsf{T}}}\) and \({{{{{{{{\boldsymbol{\theta }}}}}}}}}_{k}=({\theta }_{(k,1)},\ldots ,{\theta }_{(k,{m}_{k})})\).
Proof
See the Methods Section.
Remark 2
For combinatorial optimization problems, constraintpreserving measurements that correspond to different constraints always commute. Thus \({{{{{{{{\mathcal{P}}}}}}}}}_{{{{{{{{\mathcal{F}}}}}}}}}\) can be implemented as a composition of measurements corresponding to different constraints.
While the previous results indicate that N_{k} can grow inverse polynomially with the desired error probability, the following result (Corollary 2) shows that fixing δ and applying a simple repetition scheme suffices to suppress the failure probability arbitrarily below δ with only logarithmic overhead. Thus, the overall procedure can be made efficient. The purpose of the Zeno framework is to ensure that we can obtain a state that has an overlap with \({{{{{{{{\mathcal{H}}}}}}}}}_{j}\) that is lower bounded by a constant and prepare this state with an overhead that is \(O({{{{{{{\rm{polylog}}}}}}}}(\dim {{{{{{{\mathcal{H}}}}}}}}))\).
Corollary 2
Let \({{{{{{{\mathcal{P}}}}}}}}\) be the measurement defined in Equation (2). Let the parameterized evolution defined in Equation (6) evolve the system from some initial state ρ_{0} = P_{j}ρ_{0}P_{j}. In addition, suppose that the number of measurements N_{k} was chosen, using Corollary 1, to ensure that \({{{{{{{\rm{Tr}}}}}}}}[{P}_{j}{\rho }_{Z}({{{{{{{\boldsymbol{\theta }}}}}}}})]={{{{{{{\rm{Tr}}}}}}}}[{P}_{j}{{{{{{{{\mathcal{U}}}}}}}}}_{Z}({{{{{{{\boldsymbol{\theta }}}}}}}}){\rho }_{0}{{{{{{{{\mathcal{U}}}}}}}}}_{Z}{({{{{{{{\boldsymbol{\theta }}}}}}}})}^{{{{\dagger}}} }]\) is lower bounded by a constant independent of the system size, and then in order to ensure that \({{{{{{{\mathcal{P}}}}}}}}\) applied to ρ_{Z}(θ) prepares a state in \({{{{{{{{\mathcal{H}}}}}}}}}_{j}\) with a probability at least 1 − ϵ, it suffices to prepare and measure at most \(\log (1/\epsilon )\) copies of ρ_{Z}(θ).
Proof
Suppose \({{{{{{{\rm{Tr}}}}}}}}[{P}_{j}{\rho }_{Z}({{{{{{{\boldsymbol{\theta }}}}}}}})]=c\). Since we can efficiently check whether the postmeasurement state obtained from applying \({{{{{{{\mathcal{P}}}}}}}}\) to ρ_{Z}(θ) is in \({{{{{{{{\mathcal{H}}}}}}}}}_{j}\), \(\log (1/\epsilon )/\log (1/(1c)) < \log (1/\epsilon )\) repetitions suffice to ensure that the outcome of at least one of the repetitions is in \({{{{{{{{\mathcal{H}}}}}}}}}_{j}\) with probability at least 1 − ϵ.
These results imply that for most practical cases, e.g. when H_{j} are Pauli operators as in the cases of QAOA and hardwareefficient parameterized circuits, the number of measurements scales at most quadratically in the circuit depth and width, i.e., as \(O({{{{{{{\rm{polylog}}}}}}}}(\dim {{{{{{{\mathcal{H}}}}}}}}))\). Thus, QZD can be used to efficiently constrain parameterized evolution for quantum optimization.
Constrained QAOA via Zeno dynamics
We now discuss the application of QZD to QAOA. In a QAOA circuit, the phase operator U_{C}(γ) is diagonal in the computational basis and cannot violate constraints. More specifically, it evolves the current state, for time γ, under the diagonal operator \(C={\sum }_{{{{{{{{\boldsymbol{x}}}}}}}}\in {{\mathbb{B}}}^{n}}f({{{{{{{\boldsymbol{x}}}}}}}})\left\vert {{{{{{{\boldsymbol{x}}}}}}}}\right\rangle \left\langle {{{{{{{\boldsymbol{x}}}}}}}}\right\vert\), which encodes the values of the objective function f on \({{\mathbb{B}}}^{n}\). The Hermitian mixing operator B transitions probability amplitude between elements of \({{\mathbb{B}}}^{n}\) and, in general, does not respect the problem constraints. Therefore the measurements only need to be added to the mixing operator. Since a player QAOA circuit consists of p applications of the phase and mixing operators in an alternating fashion, the full circuit combined with the Zeno framework then becomes
where
In the notation of Equation (6), this corresponds to setting all m_{k} = 1, and setting N_{k} = 0 for blocks containing the cost operator. While there are other valid choices for the blocks, the decomposition we have chosen is sufficient to achieve an efficient scheme.
As the mixing operator B is known, we can explicitly derive the number of measurements required to maintain a constant success probability. We observe that for any mixer this number of measurements grows linearly with the number of QAOA layers, and for commonly considered mixers, the number of measurements grows no more than quadratically with the number of qubits.
Corollary 3
Let \({{{{{{{{\mathcal{U}}}}}}}}}_{Z{{{{{{{\rm{QAOA}}}}}}}}}({{{{{{{\boldsymbol{\beta }}}}}}}},{{{{{{{\boldsymbol{\gamma }}}}}}}})\) denote the QAOA circuit on n qubits with N measurements added to each mixing operator as defined in Equation (9). Let the initial state \({\rho }_{0}=\left\vert s\right\rangle \left\langle s\right\vert\) be inconstraint. Then N_{j} measurements suffice to maintain at least a 1 − δ probability of obtaining an inconstraint measurement outcome, where

if \(B=\mathop{\sum }\nolimits_{k = 1}^{n}{{{{{{{{\rm{x}}}}}}}}}_{k}\), then \({N}_{j}=\left\lceil\frac{p{\beta }_{j}^{2}{n}^{2}}{\ln {\left[12\delta \right]}^{\frac{1}{2}}}\right\rceil\)

if \(B=\left\vert +\right\rangle \left\langle +\right\vert\), then \({N}_{j}=\left\lceil\frac{p{\beta }_{j}^{2}}{\ln {\left[12\delta \right]}^{2}}\right\rceil\),
and δ ≤ 0.19.
Proof
The proof follows from Theorem 1 by noting that for \(B=\mathop{\sum }\nolimits_{k = 1}^{n}{{{{{{{{\rm{x}}}}}}}}}_{k}\) the minimum and maximum eigenvalues are − n and n, respectively, and for \(B=\left\vert +\right\rangle \left\langle +\right\vert\) the only eigenvalues are one and zero. For QAOA with p layers, the number of measurements increases by a factor of p. Note that while we could of instead used Corollary 1, using Theorem 1 directly results in N_{k} being lower by a constant for \(B=\left\vert +\right\rangle \left\langle +\right\vert\).
Note that the scaling rule of Corollary 3 implies that the number of measurements will change with β_{j} and thus each mixer layer.
Figure 1 visualizes how the number of measurements required to maintain a given minimum inconstraint probability, according to Corollary 3, grows with the evolution time β for the B = ∑_{j}x_{j} (✖ marker) and \(B=\left\vert +\right\rangle \left\langle +\right\vert\) (✚ marker) mixing operators for p = 1 QAOA with a 3qubit initial state \(\left\vert s\right\rangle\). As the phase operator is diagonal, there is no dependency on it. We note that the number of measurements for the mixer B = ∑_{j}x_{j} grows with number of qubits and is therefore larger than for \(B=\left\vert +\right\rangle \left\langle +\right\vert\). Note that when following the scaling rules of Corollary 3, the number of measurements is multiplied by the number of QAOA layers p.
In the Results Section, we observe that for realistic constraints, the number of measurements is significantly lower. This is because the worstcase \({P}_{{{{{{{{\mathcal{F}}}}}}}}}\) and \(\left\vert s\right\rangle\), i.e., from Equation (37) in the proof of Lemma 1, are far from those encountered in practice. Specifically, the worstcase \({P}_{{{{{{{{\mathcal{F}}}}}}}}}\) is rank one (i.e., only one state is inconstraint). A larger inconstraint subspace leads to a lower sufficient number of measurements. Moreover, in practice the initial state is unlikely to align perfectly with the worst case presented in Equation (37). We also observe in our experiments that the required number of measurements has only a weak dependence on the number of QAOA layers p for the problem instances considered. Therefore, one could consider a significantly relaxed and simplified version of the rules provided in Corollary 3 as follows:
where η is some hyperparameter to be fine tuned. One could always efficiently estimate the inconstraint probability of a QAOA circuit with a fixed η by measuring a single auxiliary qubit indicating whether the final state output by the circuit is inconstraint. In the portfolio optimization experiments, we successfully use an η for the B = ∑_{j}x_{j} mixer that is orders of magnitude larger than predicted by Corollary 3, requiring a correspondingly smaller number of measurements.
QAOA with Zeno dynamics in the adiabatic limit
If the initial state \(\left\vert s\right\rangle\) is the ground state of the mixer Hamiltonian B, QAOA is known to be able to prepare the ground state of the cost Hamiltonian C and thereby solve the problem exactly in the limit of an infinite number of QAOA layers by approximating adiabatic evolution^{2}. We now show that this limiting behavior is preserved for constrained QAOA with Zeno dynamics.
Now consider QAOA with constraints enforced by measurement \({{{{{{{\mathcal{P}}}}}}}}\) as defined in Equation (2), in the Zeno limit, when the number of measurements is taken to infinity, the operator describing the asymptotic dynamics is a sum of the original mixer B projected onto the subspaces defined by the projectors constituting \({{{{{{{\mathcal{P}}}}}}}}\), i.e.,
Concretely, consider the task of using QAOA to approximate the adiabatic evolution under the following timedependent Hamiltonian:
where s: [0, T] → [0, 1] is the interpolating schedule function. A common schedule function is the linear schedule defined by
where T is the evolution time scale. Suppose \(T\gg O({(\mathop{\min }\nolimits_{s}{\Delta }_{n}(s))}^{2})\), where Δ_{n}(s) is the instantaneous minimum difference between the nth eigenvalue and any other eigenvalue of H(s). If ∀ s, it holds that Δ_{n}(s) ≠ 0, then the quantum adiabatic theorem^{32} implies:
In the Zeno case, we consider
Consider the QAOA operator with only one measurement per layer, i.e., ∀ j, N_{j} = 1 in (9):
Now it is easy to recover the parameters β_{j}, γ_{j} giving the limit. From the definition of the product integral^{33} it follows that
where the third equality follows from expanding to the first order in \(\frac{T}{p}\) and that \(\frac{j}{p}\) and \(1\frac{j}{p}\) are bounded by 1. Also, since the evolution is in a finitedimensional space, B and C have bounded operator norms.
Thus if \({\rho }_{n}(0)=\left\vert {\psi }_{n}(0)\right\rangle \left\langle {\psi }_{n}(0)\right\vert\) is an nth eigenstate of H_{Z} then
where ρ_{n}(T) is pure and is an nth eigenstate of \({{{{{{{\mathcal{P}}}}}}}}C\). Thus with \({\beta }_{j}=\frac{T}{p}(1\frac{j}{p})\) and \({\gamma }_{j}=\frac{jT}{{p}^{2}}\) as p → ∞, QAOA with Zeno dynamics approaches the adiabatic limit and recovers the optimal solution.
Mitigating mixer limitations in the Zeno limit
While the evolution under \({P}_{{{{{{{{\mathcal{F}}}}}}}}}B{P}_{{{{{{{{\mathcal{F}}}}}}}}}\) is guaranteed to preserve the inconstraint subspace, it may inhibit transitions between states in \({{{{{{{\mathcal{F}}}}}}}}\) that were allowed with B. This is because states in \({{{{{{{\mathcal{F}}}}}}}}\) may be connected by B through a path that passes through states not in \({{{{{{{\mathcal{F}}}}}}}}\). To see this, consider a simple example of the twoqubit mixer B_{2} = x_{1} + x_{2} and the inconstraint space \({{{{{{{\mathcal{F}}}}}}}}=\{\left\vert 01\right\rangle ,\left\vert 10\right\rangle \}\). In the Zeno limit, the mixing operator evolution in the inconstraint subspace is generated by \({P}_{{{{{{{{\mathcal{F}}}}}}}}}{B}_{2}{P}_{{{{{{{{\mathcal{F}}}}}}}}}\), which equals the zero matrix. Thus, the propagator corresponding to the projected mixer becomes the identity operator and the dynamics become trivial. In general, if there is no path between two computational basis states \(\left\vert j\right\rangle ,\left\vert k\right\rangle \in {{{{{{{\mathcal{F}}}}}}}}\) in the graph defined by B, the continuoustime quantum walk defined by the mixing operator cannot move probability amplitude from \(\left\vert k\right\rangle\) to \(\left\vert j\right\rangle\). Whether the transitions between inconstraint states are suppressed in the Zeno limit is in general dependent on the inconstraint space \({{{{{{{\mathcal{F}}}}}}}}\).
One way to avoid the issue of suppressed transitions is by choosing a mixer B with a complete connectivity graph among computational basis states, i.e., \(B=\left\vert +\right\rangle \left\langle +\right\vert\). This mixer is also known as the completegraph mixer^{20,34}. It has been conjectured^{34} that mixers with high connectivity, such as the \(B=\left\vert +\right\rangle \left\langle +\right\vert\), can at best produce a Groverlike speedup since they do not make use of the structure of the cost operator. While it is unclear if this conjecture is true, we emphasize that our approach can utilize any mixer and can efficiently enforce constraints as long as the difference between the maximum and minimum eigenvalues of the mixer is polynomial in the number of qubits.
Numerical experiments
We now present the numerical experiments showing the power of the proposed method. The technique we propose is general, though in this section we consider only the problem of portfolio optimization (with both equality and inequality constraints) and only the QAOA and LVQE algorithms. The parameters in QAOA and VQE were optimized using COBYLA^{35} initialized with a large number of random initial points. We compare the results to the stateoftheart method of encoding constraints by introducing a penalty into the objective, and observe significant improvements in both approximation ratio and inconstraint probability. In addition to better performance, the proposed method does not require complicated tuning of the penalty factor.
Benchmark: portfolio optimization
The daily operation of a large financial institution requires solving many classicallyhard optimization problems^{36,37,38}. Among such problems, one of the most important is portfolio optimization. Modern portfolio theory^{39} considers the task of finding a portfolio with a desired tradeoff between risk and expected return. This task is typically formulated as an optimization problem, which is hard to solve classically in many settings, such as when the variables are required to only take on a discrete set of values. When designing an algorithm for portfolio optimization, a central consideration is the ability to incorporate a general class of constraints. Such constraints can come from regulatory or business considerations, with examples ranging from portfoliolevel constraints (including budget and total number of assets) to assetlevel constraints (such as minimum holding size).
The particular constrained portfolio optimization problems we study numerically arise from the discrete meanvariance Markowitz model^{39} and have the following objective function
where \({{{{{{{\mathcal{F}}}}}}}}\) is defined by some set of constraints on the portfolio. We consider two sets of problems. In the first set, we impose an inequality constraint on the total size of the portfolio (∑_{j}x_{j} ≤ C). In the second set of problems, in addition to the inequality constraint on portfolio size, we include a constraint on the total expected return (∑_{j}μ_{j}x_{j} ≥ R). For each of the two sets of constraints, we consider seven instances with between four and ten assets, for a total of fourteen instances. In all problem instances \({{{{{{{\mathcal{F}}}}}}}}\subset {{\mathbb{B}}}^{n}\), where n is the number of assets.
Zeno dynamics improves quantum optimization performance
Figure 2 presents the comparison between QAOA with Zeno dynamics and QAOA with constraints enforced using a penalty factor on the fourteen problem instances described in the previous subsection. The penalty method is described in the Methods Section. The solution quality is measured in terms of the approximation ratio r, a value between 0 and 1, with larger r being better. The approximation ratio is formally defined in the Methods Section. We consider QAOA with mixers B = ∑_{j}x_{j} (✖ marker) and \(B=\left\vert +\right\rangle \left\langle +\right\vert\) (✚ marker), and optimize the QAOA parameters exhaustively. To improve the performance of parameter optimization, we follow ref. ^{40} and rescale the cost function so that the gradients with respect to β and γ are roughly of the same magnitude.
For instances with a single constraint (see dotted lines in Fig. 2a–d) we perform extensive tuning of the penalty factor λ. For multiconstraint problems, the tuning becomes prohibitively expensive. Therefore, we exclude QAOA with constraints enforced through penalties from the comparison for problems with multiple constraints. The choice of the penalty factor and the difficulty of its optimization are discussed in detail in the next subsection.
We observe that Zeno dynamics (see solid lines in Fig. 2a–d) enables consistently better solution quality and inconstraint probability as compared to QAOA with constraints enforced using a penalty (dotted lines) for all problems considered. Furthermore, Fig. 2b shows that for 6 and 10 assets the inconstraint probability drops off rapidly with the number of QAOA layers if the penalty factor is kept constant. This highlights an important limitation of enforcing the constraints via penalties, namely that the penalty factor must be tuned independently for each QAOA depth. In contrast, for QAOA with Zeno dynamics we obtain an explicit rule for how η, from (11), should change with the QAOA depth (see Corollary 3). However, for the numerics shown in Fig. 2, we fix η to ensure a constant minimum inconstraint probability per layer. We observe good performance despite η being a depthindependent constant in this case. We note that since η was held constant while p varied, the inconstraint probability slowly decreases with the number of layers as predicted by Corollary 3. For \(B=\left\vert +\right\rangle \left\langle +\right\vert\) mixer, this results in an average number of measurements of ≈ 77 for 6 assets and ≈ 35 for 7 assets.
Since multiple constraints can be efficiently handled in the Zeno framework, in Fig. 2e, f, we include the performance of QAOA with Zeno dynamics on problems with multiple constraints (one on the budget and one on the total expected return). The results show that the Zenoenhanced QAOA is able to achieve a similar performance as it did for the singleconstraint problems, with sufficiently high p.
We note that the inconstraint probability can be improved arbitrarily for the Zeno dynamics approach by decreasing η, without the need to reoptimize the QAOA parameters. This is due to the objective function landscape becoming independent of η as the Zeno limit is approached. In fact, we observe that transferring parameters from a smaller to a larger number of measurements (larger to smaller η) works well even for practically relevant values of η. Figure 3 shows the approximation ratio r and inconstraint probability with directly optimized QAOA parameters and with preoptimized parameters transferred from a fixed value of η = 1.6 (marked with a star in the plot). We observe that for sufficiently small η, transfer works well and the difference in approximation ratio is negligible. Specifically, parameter transfer using the B = ∑_{j}x_{j} mixer and a total of 33, 75, and 200 measurements results in inconstraint probabilities of at least 85%, 89%, and 96%, respectively for the nineassets, singleconstraint problem at p = 5. At the same time, if the number of measurements is very small (η large), the objective function landscape is very different from the landscape in the Zeno limit, and the parameter transfer does not work well. We remark that while the inconstraint probability increases monotonically as η decreases, no such guarantee is given for approximation ratio r. In fact, in Fig. 3 we observe that depending on the problem and the circuit depth, r can either increase or decrease with η.
Note that the same approach of boosting the inconstraint probability without reoptimizing the QAOA parameters does not work if the constraints are enforced using penalties. Figure 4 shows that transferring parameters from a fixed value of penalty factor (marked with a star) leads to the approximation ratio rapidly dropping off to random guess. It is however possible that better performance may be achieved by leveraging more sophisticated parameter transfer strategies, such as the rescaling rule proposed for the weighted MaxCut problem^{41,42} or machine learning methods^{43}.
While for QAOA with Zeno dynamics the approximation ratio r given in Equation (23) increases monotonically with the number of QAOA layers, this is not guaranteed for QAOA with constraints enforced through penalties. This is because the QAOA parameters are chosen with respect to the objective with penalties and the increased expressivity of the higherdepth circuit is only guaranteed to improve the performance with respect to that objective. Figure 5 shows that this is indeed the case and the approximation ratio r_{penalty} given in Equation (24) increases with the number of QAOA layers as expected.
Finally, we include the results for Zenoenhanced LVQE with L = 1 in Equation (6). The structure of LVQE is presented in Equation (26) and further described in the Methods Section. However, instead of using Corollary 1 to determine a sufficient value for the number of measurements N, we heuristically set N = 100. Table 1 presents the results. As expected, LVQE achieves high approximation ratio, while Zeno dynamics enables high inconstraint probability. As the total number of measurements is kept fixed for all problems and parameter values, slightly lower inconstraint probability is observed for higher qubit counts. As is the case for QAOA, the inconstraint probability can be increased by increasing the number of measurements.
Penalty factor tuning is difficult
An important advantage of our method is the simplicity of hyperparameter tuning, as only η in Equation (11) needs to be chosen. This choice is made easy by Theorem 1 and its corollaries, which imply the monotonic increase of inconstraint probability with decrease in η. This is in sharp contrast with the penalty approach, where the performance crucially depends on the penalty strength, which is hard to tune in general. We now present how the penalty strength was chosen for the experiments above, and discuss the challenges that arose in doing so.
Figure 6 presents the performance of QAOA on a singleconstraint problem enforced using a penalty term with varying penalty factors λ. In the plot, the inconstraint probability 1 − δ monotonically increases with λ, while the approximation ratio r decreases. This indicates a tradeoff between r and the outofconstraint probability δ, and hence hyperparameter tuning on λ must be performed in order to obtain a good approximation ratio while meeting requirements on the minimum inconstraint probability. We also observe that for QAOA with small p, 1 − δ tends to levels off at a value far below what is achievable by using Zeno dynamics. For example, the top figure in Fig. 6 shows that the highest inconstraint probability achievable with p = 1 is around 80% for the problem tested. Given that the approximation ratio with the penalty term r_{penalty} is above 0.9 for the high λ regime, it indicates that the maximum achievable inconstraint probability may be limited by the expressivity of the variational circuit. On the other hand, constraints enforced by Zeno dynamics do not suffer from such problems, as the inconstraint probability can be arbitrarily boosted regardless of the expressivity of the varational circuit (see Fig. 3). In the numerical experiments, we choose the value of λ independently for each problem instance with the goal of obtaining a high inconstraint probability 1 − δ. Since we show that the factor λ trades off r and δ, both cannot be improved at the same time. This suggests that there does not exist a choice of λ such that QAOA with the penalty method outperforms QAOA with Zeno dynamics.
For problems with multiple constraints, hyperparameter tuning should generally be performed on each penalty factor λ_{j} included in the relaxed objective (Equation (21)). This means that hyperparameter tuning can quickly become infeasible, as the search space for all λ_{j}’s grows exponentially with the number of penalty terms. We show in Fig. 7 how hyperparameter tuning works with two penalty factors: λ_{1} and λ_{2}, which correspond to penalty terms enforcing the budget constraint and the return constraint respectively. The figure shows the inconstraint probability of the optimal solution obtained with varying λ_{1} and λ_{2}. Similar to the singleconstraint case, maximal approximation ratio r and maximal inconstraint probability 1 − δ cannot be simultaneously achieved. Specifically, the solutions with the maximal r and maximal 1 − δ have very different values in λ_{1} and λ_{2}. Moreover, unlike Fig. 6, Fig. 7 clearly shows the nonmonotonic behavior of 1 − δ in both λ_{1} and λ_{2}. In fact, we observe a similar behavior across many of the single and multiconstraint problems that we have tested, and for both the B = ∑_{j}x_{j} and \(B=\left\vert +\right\rangle \left\langle +\right\vert\) mixers. This indicates that tuning the penalty factors is indeed difficult in the general case.
Hardware experiments
While the numerical experiments presented earlier show evidence of the performance of our technique, they do not make use of any concrete circuit implementations of the constraintchecking oracles. In this section, we consider optimized circuit implementations of constraintchecking oracles for two proofofconcept portfolio optimization problems on noisy quantum hardware. This enables us to validate all of the hardware features, such as midcircuit measurements and quantum conditional logic (QCL), that are required to implement the efficient oracle construction presented in the Methods Section.
We execute QAOA with Zeno dynamics on the Quantinuum H12 trappedion quantum processor. Our implementation uses constraintchecking oracles that perform quantum arithmetic in the Fourier domain, following directly the construction in the Methods Section. We observe that increasing the number of measurements improves the inconstraint probability 1 − δ, as expected. The improvement from additional measurements continues up to a twoqubit gate depth of 148, at which point the hardware noise prevents further improvements.
The experiments presented in this Section utilize p = 1 QAOA and the B = ∑_{j}x_{j} mixer. We use the cost function of the fourassets portfolio optimization problem used in the numerics described in the Results Section, but apply different constraints. We consider two instances with linear constraints, one with an equality constraint and one with an inequality constraint. Figure 8 shows a highlevel circuit diagram. For each problem, the QAOA parameters are first optimized using a noiseless simulator. All circuit executions use 2000 shots and no error mitigation.
The first portfolio optimization instance we consider has an equality constraint on the four binary variables x_{1}, x_{2}, x_{3}, x_{4}: 2x_{1} − x_{2} − x_{3} = 0. As discussed in the Methods Section, the semiclassical quantum Fourier transform (QFT) can be utilized for equality constraints. The semiclassical QFT makes use of QCL and midcircuit measurements, which are features supported by the H12 device. This results in an oracle that uses only one auxiliary qubit, and thus the circuit uses five qubits in total. The circuit for the oracle is shown in Fig. 9. We note that the uncomputation step consists of resetting the one auxiliary qubit to the \(\left\vert +\right\rangle\) state.
As a comparison, we also implement the coherent QFT (Fig. 10) on three qubits, resulting in seven qubits in total. After applying the oracle and measuring, all auxiliary qubits are reset to the ground state for the uncompute step. Figure 11a shows the inconstraint probability as a function of the number of projective measurements. Figure 12a shows the distributions of measurement outcomes of QAOA for varying numbers of measurements (N), with the outcomes (computational basis states) ordered by the objective function value. For both implementations, the inconstraint probability improves with the number of measurements up to N ≈ 15. For a higher number of measurements, the hardware noise arising from high circuit depth prevents further improvements in the inconstraint probability 1 − δ.
While the QCL and nonQCL implementations both perform similarly, we do note a reduction in the number of twoqubit gates and auxiliary qubits. For QCL and N = 15, the twoqubit gate depth was 122 and the count was 123. Without QCL, for N = 15, the twoqubit gate depth was 148 and the count was 165. The similar performance between QCL and nonQCL versions despite the difference in gate count may be due to the higher impact of measurement error on the QCL implementation.
The second portfolio optimization instance we consider has a cardinality (Hammingweight) inequality constraint \(\mathop{\sum }\nolimits_{j = 1}^{4}{x}_{j}\le 2\). For this problem, it is necessary to utilize the coherent QFT, and thus QCL does not lead to a resourcerequirement reduction. The QFT adder is used to compute ∑_{j}x_{j} − 3, which requires four qubits to accommodate the range. In addition, unlike the equalityconstraint case, the inverse oracle is necessary for uncomputation. The system is inconstraint when the mostsignificant qubit, i.e., the sign bit, is a one. The circuit for the oracle is shown in Fig. 10. Similar to the previous run, we plot the inconstraint probability for varying numbers of measurements (Fig. 11b), as well as, the measurement distributions obtained from QAOA (Fig. 12b). For N = 3, the twoqubit gate depth is 112 and the count is 186. Similarly to the experiments with the equality constraint, the inconstraint probability 1 − δ improves until N = 3. For a higher number of measurements, the hardware noise prevents further improvements.
Note that the performance deteriorates at a significantly lower N for the inequality constraint problem than equality. This occurs even though the twoqubit circuit depth is lower for the inequality case and the twoqubit gate count is not significantly higher. Besides the inclusion of an additional qubit, one potential reason for this is that for the inequality constraint, only one of the auxiliary qubits is measured and then the inverse oracle is applied. This allows for errors to accumulate more and propagate to the rest of circuit. However, in the equality constraint case, after applying the oracle, all auxiliary qubits are measured and then reset to the ground state. In addition, the total gate count happens to be significantly higher for the inequality constraint case.
Discussion
In this work, we propose an approach for enforcing constraints in quantum optimization and demonstrate its effectiveness by applying it to constrained instances of portfolio optimization in simulation and on a trappedion quantum processor. Our technique has two major advantages: the ability to enforce a very general class of constraints and the simplicity of hyperparameter tuning. Two important downsides of our approach are the complexity of implementing the measurement and the possibility of the measurements resulting in trivial dynamics.
Implementing the oracle for a constraint in general requires quantum arithmetic and may lead to high gate count for more complex constraints. However, the asymptotic efficiency of our approach makes it viable for faulttolerant quantum devices. Additionally, reductions in the cost of implementing quantum arithmetic, such as techniques utilizing quantum conditional logic, can further reduce the overhead of the proposed method.
Moreover, for noisy quantum devices, additional performance improvements can be obtained by leveraging advanced algorithmspecific error mitigation techniques such as the ones recently proposed for QAOA^{44,45}. Such techniques may help bridge the gap between the noisy nearterm devices and the error correction likely required to execute circuits of sufficient depth to provide performance improvements over classical algorithms^{46,47,48}.
As discussed in the Results Section, restricting the evolution to the Zeno subspace may result in trivial dynamics for certain mixers. Therefore an important consideration when applying the proposed technique is evaluating whether the particular choice of mixer has this behavior. As this effect would apply generally to all instances with a given class of constraints, the mixer only needs to be analyzed once for a class of problems.
Methods
Preliminaries
We begin by briefly introducing the relevant concepts and setting the notation. We undertake the task of minimizing an objective function f defined on the Boolean cube, \({{\mathbb{B}}}^{n}\), over the set of feasible solutions \({{{{{{{\mathcal{F}}}}}}}}\subseteq {{\mathbb{B}}}^{n}\):
We consider sets \({{{{{{{\mathcal{F}}}}}}}}\) of the form \({{{{{{{\mathcal{F}}}}}}}}=\{{{{{{{{\boldsymbol{x}}}}}}}}\in {{\mathbb{B}}}^{n}\  \ {\bar{g}}_{j}({{{{{{{\boldsymbol{x}}}}}}}})=0\ \forall j\}\), where \({\bar{g}}_{j}({{{{{{{\boldsymbol{x}}}}}}}})\) is an oracle that returns 0 if x satisfies the jth constraint and a value strictly greaterthan 0 otherwise. This general definition includes most commonly considered problems such as those with equality and inequality constraints.
This constrained optimization problem can be solved by relaxing the constraints and introducing penalty terms as follows:
where \({\lambda }_{j}\in {{\mathbb{R}}}^{+}\) are the penalty factors.
Specifically, for an equality constraint g(x) = 0, the penalty function may be written as
On the other hand, an inequality constraint g(x) ≥ 0 can be converted into an equivalent equality constraint \(g({{{{{{{\boldsymbol{x}}}}}}}})\hat{s}=0\) by introducing a slack variable\(\hat{s}\in [0,{g}_{\max }]\), where \({g}_{\max }=\mathop{\max }\nolimits_{{{{{{{{\boldsymbol{x}}}}}}}}\in {{{{{{{\mathcal{F}}}}}}}}}g({{{{{{{\boldsymbol{x}}}}}}}})\). If we assume g(x) can be discretized with a spacing of Δ_{g}, then \(\hat{s}\) can be implemented using \({n}_{{{{{{{{\rm{slack}}}}}}}}}=\lceil {\log }_{2}({g}_{\max }/{\Delta }_{g})\rceil\) binary variables \({{{{{{{\boldsymbol{s}}}}}}}}={({s}_{1},\ldots ,{s}_{{n}_{{{{{{{{\rm{slack}}}}}}}}}})}^{{\mathsf{T}}}\), and the resultant equality constraint is g(x) − Δ_{g}∑_{j}2^{j−1}s_{j} = 0. Therefore the penalty function for an inequality constraint can be written as
The magnitudes of the penalty factors λ_{j} control how much the constraint violations are penalized. Intuitively, a higher value of λ_{j} should lead to a higher inconstraint probability. However, in practice, the relationship between the penalty factor, the inconstraint probability and the solution quality may be nonmonotonic. This makes choosing λ_{j} harder. We discuss the difficulty of tuning the penalty factors in the Results Section.
Quantum algorithms for approximate optimization
In this work, we focus on the class of quantum optimization algorithms that use a parameterized quantum evolution to prepare a state, such that the corresponding measurement outcomes contain a highquality, valid solution to the original optimization problem with high probability. This parameterized state, a restatement of Equation (1), is prepared by applying a parameterized evolution U(θ) to some initial state \(\left\vert s\right\rangle\):
where H_{j} is some Hamiltonian, e.g., a tensor product of singlequbit Pauli operators.
Let \(C={\sum }_{{{{{{{{\boldsymbol{x}}}}}}}}\in {{\mathbb{B}}}^{n}}f({{{{{{{\boldsymbol{x}}}}}}}})\left\vert {{{{{{{\boldsymbol{x}}}}}}}}\right\rangle \left\langle {{{{{{{\boldsymbol{x}}}}}}}}\right\vert\) be the operator encoding the objective function f on qubits and \({C}_{{{{{{{{\rm{penalty}}}}}}}}}={\sum }_{{{{{{{{\boldsymbol{x}}}}}}}}\in {{\mathbb{B}}}^{n}}{f}_{{{{{{{{\rm{penalty}}}}}}}}}({{{{{{{\boldsymbol{x}}}}}}}})\left\vert {{{{{{{\boldsymbol{x}}}}}}}}\right\rangle \left\langle {{{{{{{\boldsymbol{x}}}}}}}}\right\vert\) be the operator encoding the relaxed objective function (21). The figures of merit used to evaluate the quality of a parameter θ^{*} obtained by algorithms that employ parameterized circuit (22) are approximation ratios, defined as follows:
and
where \({C}_{{{{{{{{\mathcal{F}}}}}}}}}={\sum }_{{{{{{{{\boldsymbol{x}}}}}}}}\in {{{{{{{\mathcal{F}}}}}}}}}f({{{{{{{\boldsymbol{x}}}}}}}})\left\vert {{{{{{{\boldsymbol{x}}}}}}}}\right\rangle \left\langle {{{{{{{\boldsymbol{x}}}}}}}}\right\vert\), \({f}^{\min }=\mathop{\min }\nolimits_{{{{{{{{\boldsymbol{x}}}}}}}}\in {{{{{{{\mathcal{F}}}}}}}}}f({{{{{{{\boldsymbol{x}}}}}}}})\), \({f}^{\max }=\mathop{\max }\nolimits_{{{{{{{{\boldsymbol{x}}}}}}}}\in {{{{{{{\mathcal{F}}}}}}}}}f({{{{{{{\boldsymbol{x}}}}}}}})\), \({f}_{{{{{{{{\rm{penalty}}}}}}}}}^{\min }=\mathop{\min }\nolimits_{{{{{{{{\boldsymbol{x}}}}}}}}\in {{\mathbb{B}}}^{n}}{f}_{{{{{{{{\rm{penalty}}}}}}}}}({{{{{{{\boldsymbol{x}}}}}}}})\), and \({f}_{{{{{{{{\rm{penalty}}}}}}}}}^{\max }=\mathop{\max }\nolimits_{{{{{{{{\boldsymbol{x}}}}}}}}\in {{\mathbb{B}}}^{n}}{f}_{{{{{{{{\rm{penalty}}}}}}}}}({{{{{{{\boldsymbol{x}}}}}}}})\).
This class of algorithms includes QAOA^{1,2,48} and its generalization, the quantum alternating operator ansatz algorithm^{13}. In both algorithms, the parameterized quantum evolution is performed by applying pairs of alternating operators:
where \({U}_{C}({\gamma }_{j})={e}^{i{\gamma }_{j}C}\) is the phase operator, and U_{B}(β_{j}) is the mixing operator. In the special case of QAOA, the initial state \(\left\vert s\right\rangle\) is the uniform superposition over all computational basis states and the mixing operator U_{B} is set to be \({U}_{B}({\beta }_{j})={e}^{i{\beta }_{j}B}\), where B = ∑_{k}x_{k} is a sum of singlequbit Paulix operators. In quantum alternating operator ansatz, U_{B} and \(\left\vert s\right\rangle\) are allowed to be arbitrary, and are typically set such that the resulting state \(\left\vert \psi ({{{{{{{\boldsymbol{\beta }}}}}}}},{{{{{{{\boldsymbol{\gamma }}}}}}}})\right\rangle\) preserves the constraints, in the sense that every measurement outcome x belongs to \({{{{{{{\mathcal{F}}}}}}}}\). In this paper, we consider QAOA with an arbitrary mixing Hamiltonian B, defined in ref. ^{13} as Hamiltonianbased QAOA. In all other sections of this paper, unless it is specified otherwise, the acronym QAOA is used to denote this version of the algorithm.
In addition to QAOA, we consider the layer variational quantum eigensolver (LVQE)^{31}, which is a version of VQE with the hardwareefficient layered parameterized circuit tailored towards optimization problems. LVQE uses the parameterized circuit of the form
where U_{NN} consists of nearestneighbor CNOT’s and singlequbit Ry’s, and V is a layer of singlequbit Ry’s. The reader is referred to ref. ^{31} for the precise definition of the circuit. While the circuit includes nonparameterized CNOT’s, it is easy to write it equivalently in the form of Equation (22) by pushing Ry through the control of the CNOT and noting that \({{{{{{{\rm{Ry}}}}}}}}(\theta )={e}^{i\frac{\theta }{2}{{{{{{{\rm{y}}}}}}}}}\) and \({{{{{{{{\rm{cnot}}}}}}}}}_{1,2}{{{{{{{{\rm{Ry}}}}}}}}}_{2}(\theta ){{{{{{{{\rm{cnot}}}}}}}}}_{1,2}={e}^{i\frac{\theta }{2}{{{{{{{{\rm{z}}}}}}}}}_{1}{{{{{{{{\rm{y}}}}}}}}}_{2}}\). Here, y_{j} and z_{j} denote a singlequbit Pauliy and Pauliz, respectively, acting on the jth qubit.
Quantum Zeno dynamics
The quantum Zeno effect (QZE)^{49,50} is named after Zeno’s paradox^{51}, which regards the continuous observation of a moving arrow. Zeno’s paradox states that an arrow cannot move if no time has elapsed since the point it was last observed. If the time difference between observations is Δt, continuous observation occurs in the limit of Δt → 0. Under continuous observation, no time elapses between observations, and during each observation the arrow is not moving; thus, no overall movement is possible. The analog in quantum mechanics is a consequence of the Schrödinger equation. We first introduce a simpler onedimensional version, in which the quantum state is restricted from evolving due to repeated measurements, and then present a more general case in which the dynamics of the system are restricted to a particular subspace, called a Zeno subspace.
Suppose a timedependent quantum state is evolved in a finitedimensional Hilbert space \({{{{{{{\mathcal{H}}}}}}}}\) from some initial state \(\left\vert {\psi }_{0}\right\rangle\) under the action of some Hamiltonian H for time t. Define a projective measurement \({{{{{{{\mathcal{P}}}}}}}}\) given by a pair of complement projections \(P=\left\vert {\psi }_{0}\right\rangle \left\langle {\psi }_{0}\right\vert\) and Q = I − P, which acts on a density operator ρ as
If we carry out N repeated projective measurements \({{{{{{{\mathcal{P}}}}}}}}\) at a time interval of t/N, then the probability that the system remains in the initial state is
where \({\tau }_{Z}^{2}=\left\langle {\psi }_{0}\right\vert {H}^{2}\left\vert {\psi }_{0}\right\rangle \left\langle {\psi }_{0}\right\vert H{\left\vert {\psi }_{0}\right\rangle }^{2}\) is called the Zeno time and quantifies how often the measurements need to be taken. As the frequency at which the measurements are performed increases without bound, the probability of remaining in the initial state approaches one.
Quantum Zeno dynamics (QZD)^{52,53,54,55} considers the more general case where the evolution of the state is constrained to a subspace of dimension greater than one. Thus the projective measurement \({{{{{{{\mathcal{P}}}}}}}}\) can contain multiple projections with ranks all greater than one. Specifically, a restatement of Equation (2),
where \(\mathop{\sum }\nolimits_{j = 1}^{k}{P}_{j}={{{{{{{\rm{I}}}}}}}}\), and P_{j} is a projection onto some subspace \({{{{{{{{\mathcal{H}}}}}}}}}_{j}={P}_{j}{{{{{{{\mathcal{H}}}}}}}}\) of dimensionality \({{{{{{{\rm{Tr}}}}}}}}({P}_{j})\ge 1\). Informally, QZD states that if the evolution starts in \({{{{{{{{\mathcal{H}}}}}}}}}_{j}\) and the measurement \({{{{{{{\mathcal{P}}}}}}}}\) is performed sufficiently often, then the system will remain in \({{{{{{{{\mathcal{H}}}}}}}}}_{j}\) with high probability.
Consider an initial state ρ_{0}, after N projective measurements by \({{{{{{{\mathcal{P}}}}}}}}\), the state of the system is given by
where \({{{{{{{\mathcal{U}}}}}}}}(t)={({{{{{{{\mathcal{P}}}}}}}}{e}^{iHt/N})}^{N}\) and \(p(t)={{{{{{{\rm{Tr}}}}}}}}({P}_{j}\rho (t))\) is the probability of the system remaining in \({{{{{{{{\mathcal{H}}}}}}}}}_{j}\) after evolving for time t. Note that
and the dynamics of the system are governed by \({H}_{Z}={{{{{{{\mathcal{P}}}}}}}}H\), called the Zeno Hamiltonian. Moreover, as N → ∞, transitions between different subspaces \(\{{{{{{{{{\mathcal{H}}}}}}}}}_{1},\ldots ,{{{{{{{{\mathcal{H}}}}}}}}}_{k}\}\) of \({{{{{{{\mathcal{H}}}}}}}}\) are suppressed. This implies if ρ_{0} = P_{j}ρ_{0}P_{j} for some j ∈ [k] ≔ {1, …, k}, then in the limit of N → ∞, called the Zeno limit, it follows that p(t) → 1, and thus the state will remain in \({{{{{{{{\mathcal{H}}}}}}}}}_{j}\) throughout the evolution. For a more detailed discussion the reader is referred to refs. ^{54,55}.
QZE has many applications in algorithms and error mitigation. Childs et al.^{56} propose a version of Grover’s search based on QZD that utilizes frequent measurements instead of slow adiabatic evolution. This alternative approach to slow evolution was also observed in ref. ^{57}. Somma et al.^{58,59} develop a quantumenhanced version of the simulated annealing algorithm. Their approach makes use of QZD to ensure that the evolution remains in the instantaneous quantum Gibbs state for varying temperature. Boixo et al.^{60} show that for Grover’s algorithm and simulated annealing based on QZD, one could use frequent randomized evolutions instead of measurements (the randomization method). The randomization method has also been used to implement algorithms for quantum linear systems^{61,62}. Finally, dynamical decoupling, also called bangbang decoupling^{63}, is a popular errormitigation technique that uses QZE to suppress decoherence^{55,64,65,66,67,68}.
Proof of Theorem 1
In this Section we derive our main result, Theorem 1, for the number of measurements required to maintain a constant success probability. We start by deriving the required lemmas.
Lemma 1
Let H be a Hermitian matrix. Then
where P is an orthogonal projector and \({\xi }_{\max }\) and \({\xi }_{\min }\) are the largest and smallest eigenvalues of H.
Proof
Suppose H has the following eigendecomposition
where ξ_{k} are the unique eigenvalues of H (including 0 if H is not full rank) and \({\{{Q}_{k}\}}_{k = 1}^{d}\) is the complete set of projectors onto the corresponding eigenspaces. Therefore
where \({c}_{jk}=\cos (\theta ({\xi }_{j}{\xi }_{k}))\), \({x}_{j}=\left\langle \psi \right\vert {Q}_{j}\left\vert \psi \right\rangle \ge 0\). Note that the second to the last equality follows from
Let C be the matrix with elements c_{jk} at the jth row and kth column. Then using simple trigonometric identities, it can be shown that
where
Since C is the sum of positive semidefinite matrices, it too is positive semidefinite.
Therefore, minimizing p(θ) is equivalent to solving the following convex constrained minimization problem
\({{{{{{{\boldsymbol{x}}}}}}}}={({x}_{1},\ldots ,{x}_{d})}^{{\mathsf{T}}}\) and thus a sufficient condition^{69}, Theorem 2.2.5 for x^{⋆} to be the optimum is
Consider the following trial solution
We have that \(\forall {{{{{{{\boldsymbol{x}}}}}}}}\in {{{{{{{\mathcal{S}}}}}}}}\)
Also for \( \theta  \le \frac{\pi }{{\xi }_{\max }{\xi }_{\min }}\), we have \({c}_{j,k}\ge {c}_{\max ,\min }\), and thus
Combining the above results, we obtain that \(2{{{{{{{{{\boldsymbol{x}}}}}}}}}^{\star }}^{{\mathsf{T}}}C({{{{{{{\boldsymbol{x}}}}}}}}{{{{{{{{\boldsymbol{x}}}}}}}}}^{\star })\ge 0\). Thus our choice is optimal.
After, plugging in the optimal choice and noting that all steps are equalities in (31) when \(P=\left\vert \psi \right\rangle \left\langle \psi \right\vert\), we obtain:
Additionally, the result implies that minimization occurs when
for any \(\left\vert {\xi }_{\max }\right\rangle \in {{{{{\rm{Im}}}}}} ({Q}_{\max })\) and \(\left\vert {\xi }_{\min }\right\rangle \in {{{{{\rm{Im}}}}}} ({Q}_{\min })\).
Note as observed in the proof of Lemma 1, the lower bound on the inconstraint probability bound is saturated when the initial state is chosen to be either \(\left\vert {+}_{H}\right\rangle\) or \(\left\vert {}_{H}\right\rangle\) in Equation (37), and P is the projector onto the chosen initial state.
Lemma 2
Let H be a Hermitian matrix. Then
where \({{{{{{{\mathcal{P}}}}}}}}\) is a projective measurement as defined in Equation (27) with projectors P and I − P,
and \({\xi }_{\max }\) and \({\xi }_{\min }\) are the largest and smallest eigenvalues of H.
Proof
Consider a fixed θ and some N that satisfies the hypothesis. The stochastic process formed by random variables indicating whether the system is in Im(P) or its complement after each evolution segment \({{{{{{{\mathcal{P}}}}}}}}{e}^{i\frac{\theta }{N}H}\) form a twostate Markov chain. According to Lemma 1, the probability of remaining in a state on the chain at any point in time is at least
and this minimum probability is attained at each segment when \(\left\vert \psi \right\rangle\) is (37) and \(P=\left\vert \psi \right\rangle \left\langle \psi \right\vert\). Because, in this case, the evolution lies in the twodimensional space spanned by \(\left\vert {\pm }_{H}\right\rangle\), the result is a Markov chain with transition matrix
and ∀ k > N, A(k) = I.
Therefore the probability of the state remaining in Im(P) after N steps of the chain is \({\bar{A}}_{0,0}^{N}\), or the first diagonal element of the matrix \(\bar{A}\) after raising it to the Nth power. Applying diagonalization on \(\bar{A}\), we obtain
We now proceed to derive Theorem 1 using the above lemmas.
Proof of Theorem 1
For all \(\theta \in {\mathbb{R}}\), such that
it follows that
If we combine this result with Lemma 2, then we obtain
To lower bound this by 1 − δ, we can choose N as stated in Theorem 1. Note that to ensure Equation (41) we must have
and thus
At the minimum of value of N, we have
Proof of Corollary 1
Proof
For simplicity, consider a single block of size m:
First, suppose that the elements of \({\{{H}_{j}\}}_{j = 1}^{m}\) do not all pairwise commute. Then, according to^{70}, Proposition 9:
This implies that
Then
If we choose
then for α≤1, Theorem 1 with Remark 1 implies that the outofconstraint probability is at most
where δ ≤ 0.19. If α = 0.89, then
To compensate for the decay of the success probability after L blocks, each N_{k} must be multiplied by L.
Lastly, for the asymptotic dynamics, from Equation (29)(30) we get
Thereby the dynamics are described by the Zeno Hamiltonian \({{{{{{{{\boldsymbol{H}}}}}}}}}_{{{{{{{{\boldsymbol{Z}}}}}}}}}={{{{{{{\mathcal{P}}}}}}}}{{{{{{{\boldsymbol{H}}}}}}}}\), where \({{{{{{{\mathcal{P}}}}}}}}\) acts elementwise on the vector \({{{{{{{\boldsymbol{H}}}}}}}}={({H}_{1},\ldots ,{H}_{m})}^{{\mathsf{T}}}\). The limiting dynamics of L blocks is the product of these limits.
If the elements of \({\{{H}_{j}\}}_{j = 1}^{m}\) pairwise commute, then there is no Trotter error, and α = 1 without the need to halve δ. The limiting dynamics follows trivially as well.
Realizing oracles for combinatorial constraints
In this Section, we review the constructions of quantum oracles for implementing polynomial inequality and equality constraints. We use the constructions provided in this Section in the experiments on a trappedion quantum computer described in the Results Section. Since any function on the Boolean cube can be expressed as a polynomial it suffices to only demonstrate constructions for polynomial constraints^{71}. In addition, since we are considering problems in NPO we can assume the existence of a polyomiallysized classical circuit for evaluating any constraints to sufficient precision. Given that all classical basis gates can be represented as polynomials, we can represent our constraint as the composition of polynomially many polynomial functions. Of course, one could also directly implement the classical circuit in a reversible fashion on a quantum device efficiently. For the remainder of this Section, we consider a polynomial function g:
where S_{k} ⊆ [n] and \({d}_{k}\in {\mathbb{R}}\). In addition for \({S}_{k}=\varnothing\), \({\prod }_{l\in {S}_{k}}{b}_{l}:= 1\).
Without loss of generality we can assume that equality constraints are of the form g(b) = 0 and inequality constraints are of the form g(b) ≥ 0. We assume that there exists an oracle that computes the value of g(b) into a quantum register (constructions of such oracles are briefly reviewed in the Methods Section). For an equality constraint, we implement the constraintenforcing measurement by simply measuring the entire register. A projection onto the inconstraint subspace implies that we have observed a 0 in the register. For an inequality constraint, we measure the qubit corresponding to the sign, a 0 corresponds to a successful projection, and apply the inverse of the oracle post measurement.
While the above procedure works in general, there are further optimizations that can be made by utilizing quantum conditional logic (QCL). We give an example of such an optimization in the Results Section. Further optimizations are possible for doublesided inequalities of the form 0 ≤ g(b) < a, where a is a power of 2. To implement the measurement corresponding to this doublesided inequality, we only need to measure higherorder bits. Since the results of these highorder bits are now classical, we can replace the part of the inverseoracle circuit controlled on these bits with classicallyconditioned singlequbit gates. Lastly, because all constraintpreserving measurements can be implemented separately and thus auxiliary qubits can be reused, the required number of auxiliary qubits to implement all constraintpreserving measurements is equal to the maximum amount of auxiliary qubits required by any oracle call.
In the subsections that follow, we present efficient constructions of oracles that can be used to implement polynomial functions. Both of these use techniques that have been presented in prior work. Here we include a brief review for completeness and present the resource analysis for our setting.
Review of classical reversible arithmetic circuits
The design of reversible versions of classical arithmetic circuits has been extensively explored and highly optimized constructions are available^{72,73,74}. Such constructions allow one to implement unitary operations for performing arithmetic on quantum registers. Consider fixedpoint arithmetic of m bits including digits both before and after the decimal point. Suppose polynomial g has K terms. For each coefficient d_{k}, we require an nqubit controlled mbit adder. A controlled mbit adder can be implemented with O(m) T gates^{75}. Since a multicontrolled Toffoli can be implemented with a T count of O(n)^{76,77} and thus the overall multicontrolled adder can be implemented with a T count of O(n + m). The T count for implementing g is O(K(n + m)).
Review of quantum Fourier arithmetic
For smaller quantum devices, a more resource efficient approach is to switch to the Fourier basis using the quantum Fourier transform (QFT) and perform the arithmetic in the Fourier basis. This approach has worse asymptotic complexity in terms of Tgate counts, but requires fewer qubits and CNOT gates. We use this approach in the hardware experiments discussed in the Results Section. The discussion in this Section is based on ref. ^{21}, though the idea of using the QFT for quantum arithmetic is wellknown, see e.g.^{78,79,80}.
For s ∈ [2^{m}], the QFT on \({{\mathbb{Z}}}_{{2}^{m}}\) is defined as follows:
It can be shown^{81} that the righthand side of (57) is a product state and can be expressed in the following form:
where
implements the desired operation. In addition, R(α) denotes the phase gate \(\left\vert 0\right\rangle \left\langle 0\right\vert +{e}^{i\alpha }\left\vert 1\right\rangle \left\langle 1\right\vert\). The angle θ is restricted to \(\left[\frac{1}{2},\frac{1}{2}\right)\) to avoid overflow and allow for representing negative numbers. Thus, when implementing a polynomial g, we require that its range match the range of θ, i.e., \(\parallel g{\parallel }_{\infty }\le \frac{1}{2}\). This can always be satisfied by scaling g accordingly.
As an example, we can add two integers a and b, with the conditions a, b, a + b ∈ { − 2^{m−1}, …0, …, 2^{m−1} − 1}, as follows:
Note, the value in the quantum register is really the two’s complement of a + b. We define the following controlled operation:
where \({{{{{{{\boldsymbol{b}}}}}}}}\in {{\mathbb{B}}}^{n}\). For S_{k} ⊆ [n], let \({{{{{{{{\boldsymbol{1}}}}}}}}}_{{S}_{k}}\in {{\mathbb{B}}}^{n}\) denote the indicator vector of S_{k}. The process for (approximately) loading the value of the polynomial (56) into a quantum register is:
where by the assumption on the range of g, \( \tilde{g}({{{{{{{\boldsymbol{b}}}}}}}})g({{{{{{{\boldsymbol{b}}}}}}}}) \le {2}^{m}\). The result is stored in an auxiliary quantum register of size O(m). The operation F_{m}(b, θ) requires m ncontrolled rotation gates. Thus overall it requires Km ncontrolled rotation gates. An O(n)controlled Toffoli can be implemented with O(n) T gates^{76,77} and each controlled rotation can be ϵapproximately implemented with \(O(\log (1/\epsilon ))\) T’s^{82,83}. Thus, assuming a fixed rotationgate approximation error the total cost is O(Kmn).
The operation \({{{{{{{{\rm{QFT}}}}}}}}}_{{2}^{m}}\) requires O(m^{2}) gates to be implemented exactly^{81} and can be implemented approximately, for a fixed approximation error, on a faulttolerant device with \(O(m\log (m))\) T gates^{83}. For equality constraints, since we will be measuring the entire register containing the value \(\tilde{g}({{{{{{{\boldsymbol{b}}}}}}}})\), we swap the coherent implementation of the inverse QFT for the semiclassical variant^{84,85}. This semiclassical version of the QFT replaces all twoqubit gates with classicallycontrolled single qubit gates and requires only a single auxiliary qubit that is repeatedly measured and reset to compute the bits of \(\tilde{g}({{{{{{{\boldsymbol{b}}}}}}}})\). Thus, this approach benefits from both midcircuit measurements and QCL. A faulttolerant version of this circuit can be approximately implemented with \(O(m\log (m))\) T gates^{86}. Thus in a faulttolerant setting the overall T count of the QFTbased approach is \(O(Kmn+m\log (m))\).
Initial state construction
Our proposed approach is flexible with regards to the choice of the initial state, any initial state that is inconstraint suffices. Thus, unlike ref. ^{20}, when using the completegraph mixer our approach does not require repeated applications of a unitary and its inverse for preparing the uniform superposition of inconstraint states. However, the initial state we use in experiments discussed in the Results Section is the uniform superposition over all computational basis states encoding inconstraint solutions. In general, this superposition is hard to prepare. However, there exist constructions for a wide range of practically relevant cases. If the set of feasible solutions is efficiently indexable, (ref. ^{24}, Section IIIB) gives an efficient procedure for the initial state preparation. In the specific case of a Hammingweight equality or inequality constraint, the uniform superposition over feasible states is a superposition of Dicke states with corresponding Hamming weights, which can be constructed efficiently^{87}. Since, our technique does not require the state preparation method be reversible, we can make use of repeatuntilsuccess schemes.
Parameter optimization
The Zeno framework we propose works well with standard techniques used to optimize parameterized quantum circuits. Specifically, as long as each N_{r} is large enough to ensure the desired minimum inconstraint probability is 1 − δ (c.f. Corollary 1) for the given parameter range, the direction of steepest descent will still result in a circuit with the same minimum inconstraint probability. Here we make an assumption that θ remains bounded throughout optimization, which is a valid assumption in practice. This means that both gradientbased and gradientfree local optimization methods can be used with Zenoaugmented hybrid quantumclassical algorithms. A commonly used way to optimize parameterized quantum circuits is to use the parametershift rule^{88,89} in conjunction with a gradientbased optimizer. We now show that the Zeno framework works efficiently with the parametershift rule.
We consider the task of finding a minimumeigenvalue state of an observable M using a parameterized quantum evolution consisting of generating Hamiltonians that are also unitary, e.g. LVQE. We utilize the measurement scheme presented in Equation (6) with the condition that ∀ k, m_{k} = 1. (Following similar arguments as^{88}, Section 3), we obtain
where M_{k} and ρ_{k} contain terms that have not been differentiated, and \({{{{{{{{\mathcal{U}}}}}}}}}_{Z}^{\pm (r,k)}\) is the same as \({{{{{{{{\mathcal{U}}}}}}}}}_{Z}({{{{{{{\boldsymbol{\theta }}}}}}}})\) except that the evolution at the \(\mathop{\sum }\nolimits_{t = 1}^{r1}{N}_{t}+k\)th step has a phase shift of \(\pm \frac{\pi }{4{N}_{r}}\). Thus, whereas the normal parametershift requires two expectation evaluations per parameter, Zeno would require 2N_{r}. This is the same additional overhead as in the case of a circuit with gates that share parameters.
It also easy to see that the gradient is biased towards minimizing \({M}_{{{{{{{{\mathcal{F}}}}}}}}}={P}_{{{{{{{{\mathcal{F}}}}}}}}}M{P}_{{{{{{{{\mathcal{F}}}}}}}}}\), i.e. the inconstraint Hamiltonian, as follows:
where \({\Pr }_{{{{{{{{\mathcal{F}}}}}}}}}\) is the probability of projecting onto \({{{{{{{\mathcal{F}}}}}}}}\) when measuring the parameterized evolution with \({{{{{{{\mathcal{P}}}}}}}}\). Lastly, Corollary 1 can be used to ensure \({\Pr }_{{{{{{{{\mathcal{F}}}}}}}}} \, > \, 1\delta\).
Data availability
We make all the data presented in this paper available online at https://doi.org/10.5281/zenodo.7125969.
Code availability
We make the code required to reproduce the figures presented in this paper as well as the code executed on quantum hardware available online at https://doi.org/10.5281/zenodo.7125969.
References
Hogg, T. & Portnov, D. Quantum optimization. Inform. Sci. 128, 181–197 (2000).
Farhi, E., Goldstone, J. & Gutmann, S. A quantum approximate optimization algorithm. arXiv preprint arXiv:1411.4028 (2014).
Cerezo, M. et al. Variational quantum algorithms. Nat. Rev. Phys. 3, 625–644 (2021).
Rattew, A. G., Hu, S., Pistoia, M., Chen, R. & Wood, S. A domainagnostic, noiseresistant, hardwareefficient evolutionary variational quantum eigensolver. https://arxiv.org/abs/1910.09694 (2019).
Kandala, A. et al. Hardwareefficient variational quantum eigensolver for small molecules and quantum magnets. Nature 549, 242–246 (2017).
Shaydulin, R. & Pistoia, M. QAOA with n ⋅ p≥200. arXiv:2303.02064 (2023).
You, X., Chakrabarti, S. & Wu, X. A convergence theory for overparameterized variational quantum eigensolvers. arXiv:2205.12481 (2022).
Boulebnane, S. & Montanaro, A. Solving Boolean satisfiability problems with the quantum approximate optimization algorithm. https://doi.org/10.48550/arXiv.2208.06909 (2022).
Shaydulin, R. et al. Evidence of scaling advantage for the quantum approximate optimization algorithm on a classically intractable problem. arXiv preprint arXiv:2308.02342 (2023).
Wang, Z., Rubin, N. C., Dominy, J. M. & Rieffel, E. G. XYmixers: Analytical and numerical results for the quantum alternating operator ansatz. Phys. Rev. A 101, https://doi.org/10.1103/physreva.101.012320 (2020).
Niroula, P. et al. Constrained quantum optimization for extractive summarization on a trappedion quantum computer. Sci. Rep. 12, 17171 (2022).
Hadfield, S. Quantum algorithms for scientific computing and approximate optimization. Columbia university PhD dissertation, arXiv:1805.03265 (2018).
Hadfield, S. et al. From the quantum approximate optimization algorithm to a quantum alternating operator ansatz. Algorithms 12, 34 (2019).
Leipold, H. & Spedalieri, F. M. Constructing driver Hamiltonians for optimization problems with linear constraints. Quantum Sci. Technol. 7, 015013 (2021).
Stollenwerk, T., Hadfield, S. & Wang, Z. Toward quantum gatemodel heuristics for realworld planning problems. IEEE Transac. Quantum Eng. 1, 1–16 (2020).
Hen, I. & Sarandy, M. S. Driver hamiltonians for constrained optimization in quantum annealing. Phys. Rev. A 93, https://doi.org/10.1103/physreva.93.062312 (2016).
Cook, J., Eidenbenz, S. & Bärtschi, A. The quantum alternating operator ansatz on maximum kvertex cover. 2020 IEEE International Conference on Quantum Computing and Engineering (QCE).8392 (2020).
Fuchs, F. G., Lye, K. O., Nilsen, H. M., Stasik, A. J. & Sartor, G. Constrained mixers for QAOA. arXiv preprint arXiv:2203.06095 (2022).
LaRose, R., Rieffel, E. & Venturelli, D. Mixerphaser ansätze for quantum optimization with hard constraints. arXiv preprint arXiv:2107.06651 (2021).
Bärtschi, A. & Eidenbenz, S. Grover mixers for qaoa: Shifting complexity from mixer design to state preparation. 2020 IEEE International Conference on Quantum Computing and Engineering (QCE). 7282 (2020).
Gilliam, A., Woerner, S. & Gonciulea, C. Grover adaptive search for constrained polynomial binary optimization. Quantum 5, 428 (2021).
Golden, J., Bärtschi, A., O’Malley, D. & Eidenbenz, S. Thresholdbased quantum optimization. 2021 IEEE International Conference on Quantum Computing and Engineering (QCE). 137–147 (2021).
Marsh, S. & Wang, J. B. A quantum walkassisted approximate algorithm for bounded NP optimisation problems. Quantum Inform. Process. 18, 1–18 (2019).
Marsh, S. & Wang, J. B. Combinatorial optimization via highly efficient quantum walks. Phys. Rev. Res. 2, https://doi.org/10.1103/physrevresearch.2.023302 (2020).
Slate, N., Matwiejew, E., Marsh, S. & Wang, J. B. Quantum walkbased portfolio optimisation. Quantum 5, 513 (2021).
Ender, K., ter Hoeven, R., Niehoff, B. E., DriebSchön, M. & Lechner, W. Parity quantum optimization: Compiler. https://arxiv.org/abs/2105.06233 (2021).
DriebSchön, M., Javanmard, Y., Ender, K. & Lechner, W. Parity quantum optimization: Encoding constraints. https://arxiv.org/abs/2105.06235 (2021).
Fellner, M., Ender, K., ter Hoeven, R. & Lechner, W. Parity quantum optimization: Benchmarks. https://arxiv.org/abs/2105.06240 (2021).
Ender, K., Messinger, A., Fellner, M., Dlaska, C. & Lechner, W. Modular parity quantum approximate optimization. PRX Quantum 3, 030304 (2022).
Dominguez, F. et al. Encodingindependent optimization problem formulation for quantum computing. https://arxiv.org/abs/2302.03711 (2023).
Liu, X. et al. Layer VQE: A variational approach for combinatorial optimization on noisy quantum computers. IEEE Transactions on Quantum Engineering 3, 1–20 (2022).
Childs, A. M. Lecture notes on quantum algorithms. Lecture notes at University of Maryland. https://www.cs.umd.edu/~amchilds/qa/qa.pdf (2017).
Dollard, J. D. & Friedman, C. N. Product Integration with Application to Differential Equations. Encyclopedia of Mathematics and its Applications (Cambridge University Press, 1984).
McClean, J. R. et al. Lowdepth mechanisms for quantum optimization. PRX Quantum 2, https://doi.org/10.1103/prxquantum.2.030312 (2021).
Powell, M. J. D. A Direct Search Optimization Method That Models the Objective and Constraint Functions by Linear Interpolation. (Springer Netherlands, Dordrecht, 1994).
Herman, D. et al. Quantum computing for finance. Nat. Rev. Phys. https://doi.org/10.1038/s42254023006031 (2023).
Yalovetzky, R., Minssen, P., Herman, D. & Pistoia, M. NISQHHL: Portfolio optimization for nearterm quantum hardware. https://arxiv.org/abs/2110.15958 (2021).
He, Z. et al. Alignment between initial state and mixer improves QAOA performance for constrained portfolio optimization. arXiv preprint arXiv:2305.03857 (2023).
Markowitz, H. M. Portfolio selection. J. Financ. 7, 77–91 (1952).
Boulebnane, S., Lucas, X., Meyder, A., Adaszewski, S. & Montanaro, A. Peptide conformational sampling using the quantum approximate optimization algorithm. arXiv preprint arXiv:2204.01821 (2022).
Shaydulin, R., Lotshaw, P. C., Larson, J., Ostrowski, J. & Humble, T. S. Parameter transfer for quantum approximate optimization of weighted maxcut. arXiv preprint arXiv:2201.11785 (2022).
Sureshbabu, S. H. et al. Parameter setting in quantum approximate optimization of weighted problems. https://doi.org/10.48550/arXiv.2305.15201 (2023).
Khairy, S., Shaydulin, R., Cincio, L., Alexeev, Y. & Balaprakash, P. Learning to optimize variational quantum circuits to solve combinatorial problems. Proc. AAAI Conf. Artif. Intell. 34, 2367–2375 (2020).
Shaydulin, R. & Galda, A. Error mitigation for deep quantum optimization circuits by leveraging problem symmetries. https://doi.org/10.1109/qce52317.2021.00046 (2021).
Kakkar, A., Larson, J., Galda, A. & Shaydulin, R. Characterizing error mitigation by symmetry verification in QAOA. https://arxiv.org/abs/2204.05852 (2022).
Takagi, R., Endo, S., Minagawa, S. & Gu, M. Fundamental limits of quantum error mitigation. npj Quantum Inform. 8, 114 (2022).
Farhi, E., Gamarnik, D. & Gutmann, S. The quantum approximate optimization algorithm needs to see the whole graph: A typical case. https://doi.org/10.48550/arXiv.2004.09002 (2020).
Sanders, Y. R. et al. Compilation of faulttolerant quantum heuristics for combinatorial optimization. PRX Quantum 1, 020312 (2020).
Misra, B. & Sudarshan, E. C. G. The Zeno’s paradox in quantum theory. J. Math. Phys. 18, 756–763 (1977).
Presilla, C., Onofrio, R. & Tambini, U. Measurement quantum mechanics and experiments on quantum Zeno effect. Annal. Phys. 248, 95–121 (1996).
Huggett, N. Zeno’s Paradoxes. In Zalta, E. N. The Stanford Encyclopedia of Philosophy (Metaphysics Research Lab, Stanford University, 2019), Winter 2019 edn.
Facchi, P., Gorini, V., Marmo, G., Pascazio, S. & Sudarshan, E. Quantum Zeno dynamics. Phys. Lett. A 275, 12–19 (2000).
Facchi, P. & Pascazio, S. Quantum Zeno subspaces. Phys. Rev. Lett. 89, https://doi.org/10.1103/PhysRevLett.89.080401 (2002).
Facchi, P. & Pascazio, S. Quantum Zeno dynamics: mathematical and physical aspects. J. Phys. A 41, 493001 (2008).
Burgarth, D., Facchi, P., Nakazato, H., Pascazio, S. & Yuasa, K. Quantum Zeno dynamics from general quantum operations. Quantum 4, 289 (2020).
Childs, A. M. et al. Quantum search by measurement. Phys. Rev. A 66, 032314 (2002).
Aharonov, D. & TaShma, A. Adiabatic quantum state generation and statistical zero knowledge. https://arxiv.org/abs/quantph/0301023 (2003).
Somma, R., Boixo, S. & Barnum, H. Quantum simulated annealing. https://arxiv.org/abs/0712.1008 (2007).
Somma, R. D., Boixo, S., Barnum, H. & Knill, E. Quantum simulations of classical annealing processes. Phys. Rev. Lett. 101, https://doi.org/10.1103/PhysRevLett.101.130504 (2008).
Boixo, S., Knill, E. & Somma, R. Eigenpath traversal by phase randomization. Quantum Info. Comput. 9, 833–855 (2009).
Subaşı, Y., Somma, R. D. & Orsucci, D. Quantum algorithms for systems of linear equations inspired by adiabatic quantum computing. Phys. Rev. Lett. 122, 060504 (2019).
Lin, L. & Tong, Y. Optimal polynomial based quantum eigenstate filtering with application to solving quantum linear systems. Quantum 4, 361 (2020).
Viola, L. & Lloyd, S. Dynamical suppression of decoherence in twostate quantum systems. Phys. Rev. A 58, 2733–2744 (1998).
Facchi, P., Lidar, D. A. & Pascazio, S. Unification of dynamical decoupling and the quantum Zeno effect. Phys. Rev. A 69, https://doi.org/10.1103/PhysRevA.69.032314 (2004).
Halimeh, J. C., Lang, H., Mildenberger, J., Jiang, Z. & Hauke, P. Gaugesymmetry protection using singlebody terms. PRX Quantum 2, 040311 (2021).
Halimeh, J. C., Zhao, H., Hauke, P. & Knolle, J. Stabilizing disorderfree localization. https://arxiv.org/abs/2111.02427 (2021).
Halimeh, J. C. et al. Stabilizing lattice gauge theories through simplified local pseudogenerators. Phys. Rev. Res. 4, 033120 (2022).
Halimeh, J. C. et al. Enhancing disorderfree localization through dynamically emergent local symmetries. PRX Quantum 3, 020345 (2022).
Nesterov, Y. Introductory lectures on convex optimization: A basic course, vol. 87 (Springer Science & Business Media, 2003).
Childs, A. M., Su, Y., Tran, M. C., Wiebe, N. & Zhu, S. Theory of trotter error with commutator scaling. Physical Review X 11, 011020 (2021).
O’Donnell, R. Analysis of Boolean Functions (Cambridge University Press, 2014).
Häner, T., Roetteler, M. & Svore, K. M. Factoring using 2n+2 qubits with Toffoli based modular multiplication. https://arxiv.org/abs/1611.07995 (2016).
Häner, T., Rötteler, M. & Svore, K. M. Optimizing quantum circuits for arithmetic. arXiv preprint arXiv:1805.12445 (2018).
Häner, T., Soeken, M., Roetteler, M. & Svore, K. M. Quantum circuits for floatingpoint arithmetic. https://arxiv.org/abs/1807.02023 (2018).
Gidney, C. Halving the cost of quantum addition. Quantum 2, 74 (2018).
Jones, C. Lowoverhead constructions for the faulttolerant Toffoli gate. Phys. Rev. A 87, https://doi.org/10.1103/physreva.87.022328 (2013).
Maslov, D. Advantages of using relativephase Toffoli gates with an application to multiple control Toffoli optimization. Phys. Rev. A 93, 022311 (2016).
Draper, T. G. Addition on a quantum computer. https://arxiv.org/abs/quantph/0008033 (2000).
RuizPerez, L. & GarciaEscartin, J. C. Quantum arithmetic with the quantum Fourier transform. Quantum Inform. Process. 16, https://doi.org/10.1007/s1112801716031 (2017).
Şahin, E. Quantum arithmetic operations based on quantum Fourier transform on signed integers. Int. J. Quantum Inform. 18, 2050035 (2020).
Nielsen, M. A. & Chuang, I. Quantum computation and quantum information (Cambridge University Press, 2010).
Bocharov, A., Roetteler, M. & Svore, K. M. Efficient synthesis of universal repeatuntilsuccess quantum circuits. Phys. Rev. Lett. 114, https://doi.org/10.1103/physrevlett.114.080502 (2015).
Nam, Y., Su, Y. & Maslov, D. Approximate quantum Fourier transform with o(n log(n)) T gates. npj Quantum Inform. 6, https://doi.org/10.1038/s4153402002575 (2020).
Griffiths, R. B. & Niu, C.S. Semiclassical Fourier transform for quantum computation. Phys. Rev. Lett. 76, 3228 (1996).
Parker, S. & Plenio, M. B. Efficient factorization with a single pure qubit and logn mixed qubits. Phys. Rev. Lett. 85, 3049–3052 (2000).
Goto, H. Resource requirements for a faulttolerant quantum fourier transform. Phys. Rev. A 90, 052318 (2014).
Bärtschi, A. & Eidenbenz, S. Shortdepth circuits for Dicke state preparation. arXiv preprint arXiv:2207.09998 (2022).
Schuld, M., Bergholm, V., Gogolin, C., Izaac, J. & Killoran, N. Evaluating analytic gradients on quantum hardware. Phys. Rev. A 99, 032331 (2019).
Wierichs, D., Izaac, J., Wang, C. & Lin, C. Y.Y. General parametershift rules for quantum gradients. Quantum 6, 677 (2022).
Acknowledgements
The authors wish to thank Antonio Mezzacapo from IBM for his invaluable contributions to this project. Special thanks also to Tony Uttley, Jenni Strabley and Brian Neyenhuis from Quantinuum for their assistance on the execution of the experiments on the Quantinuum H12 trappedion quantum processor. Disclaimer: This paper was prepared for information purposes with contributions from the Global Technology Applied Research center of JPMorgan Chase. This paper is not a product of the Research Department of JPMorgan Chase or its affiliates. Neither JPMorgan Chase nor any of its affiliates make any explicit or implied representation or warranty and none of them accept any liability in connection with this paper, including, but not limited to, the completeness, accuracy, reliability of information contained herein and the potential legal, compliance, tax or accounting effects thereof. This document is not intended as investment research or investment advice, or a recommendation, offer or solicitation for the purchase or sale of any security, financial instrument, financial product or service, or to be used in any way for evaluating the merits of participating in any transaction.
Author information
Authors and Affiliations
Contributions
M.P. led the overall project. D.H., R.S., Y.S., and R.Y. developed the simulation code and performed numerical experiments. D.H. performed the experiments on trappedion quantum processors. D.H., R.S., Y.S., S.C., and A.R. developed the theoretical results. S.H. and P.M. contributed to technical discussions. All authors contributed to the writing of the manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Peer review
Peer review information
Communications Physics thanks the anonymous reviewers for their contribution to the peer review of this work.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Herman, D., Shaydulin, R., Sun, Y. et al. Constrained optimization via quantum Zeno dynamics. Commun Phys 6, 219 (2023). https://doi.org/10.1038/s42005023013319
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s42005023013319
This article is cited by

Shortdepth QAOA circuits and quantum annealing on higherorder ising models
npj Quantum Information (2024)

Quantum computing for finance
Nature Reviews Physics (2023)

Alignment between initial state and mixer improves QAOA performance for constrained optimization
npj Quantum Information (2023)
Comments
By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.