Introduction

Quantum control aims to find external actions (i.e., control policies) driving the dynamics of a quantum system such that a chosen target reaches a certain value, typically an extrema. Consider either an open or closed quantum system with the density matrix \({\hat{\rho }}_{t}(u)\) at time t evolving under the action of some time-dependent control u = u(t). The following two control tasks play a prominent role: (i) The problem of maximizing the expectation value of an observable \(\hat{O}\) at time T is to find u such that \({\rm{T}}{\rm{r}}[{\hat{\rho }}_{T}(u)\hat{O}]\to \,{\rm{\max }}\). (ii) The problem of a target density matrix preparation \({\hat{\rho }}_{{\rm{f}}}\) is to construct u such that \(\parallel {\hat{\rho }}_{T}(u)-{\hat{\rho }}_{{\rm{f}}}{\parallel }^{2}\to \,{\rm{\min }}\). Quantum control is of high interest due to fundamental aspects and many existing and prospective applications in quantum technologies including metrology, information processing, and matter manipulation1,2,3,4,5,6,7,8,9. Controls can be continuous pulses3,7, discrete transformations10,11,12, or combined continuous and discrete transformations, e.g., with instant quantum measurements13,14,15.

The theory of Diophantine equations appears to be totally unrelated to quantum control. A Diophantine equation, D(x1, …, xn) = 0, is a polynomial equation with integer coefficients solved with respect to positive integer unknowns x1, …, xn. We note that this is a much more generic formulation than it originally appears. For example, an exponential Diophantine equation is a Diophantine equation additionally containing at least one term of the form mn, where m and n are nonnegative integers and either both n, m or n alone are unknown. Matiyasevich16,17 has surprisingly shown that solving an exponential Diophantine equation is reducible to solving the (polynomial) Diophantine equation. Finding a rational solution of a polynomial equation with rational coefficients is also reducible to solving a Diophantine equation.

Diophantine equations are among the oldest branches of mathematics still actively studied. They also appear in quantum mechanics in a variety of contexts. For example, when deciding whether a quantum transition can be excited by a laser field consisting of n commensurate frequencies18. Utilizing the solutions of the exponential Diophantine Ramanujan-Nagell equation, Pavlyukh and Rau19 established that only in the case of one and two qubit systems unitary transformations can be visualized as rotations. Kieu (Sec. 4 of20) noted that a Diophantine equation has a solution if and only if the Hamiltonian \(\hat{H}={[D({\hat{a}}_{1}^{\dagger }{\hat{a}}_{1},\ldots ,{\hat{a}}_{n}^{\dagger }{\hat{a}}_{n})]}^{2}\) for n noninteracting bosons has the zero ground state. Here \({\hat{a}}_{j}\) and \({\hat{a}}_{j}^{\dagger }\) are the creation and annihilation operators, respectively, for j-th boson.

Diophantine equations are closely related to the theory of computability. A problem is called computable or decidable if in principle there exists an algorithm solving it. For the analysis of computability, the Turing machine21 is a convenient mathematical model of the intuitive notion of algorithm; thus, the “algorithm” and “computer program” are used as the synonyms to the Turing machine throughout. The link between Diophantine equations and computability is established by the Matiyasevich-Robinson-Davis-Putnam theorem, which gaves the negative answer to Hilbert’s tenth problem16,17, meaning that there is no algorithm deciding whether an arbitrary given Diophantine equation is solvable. Furthermore, many open mathematical problems, including the Riemann hypothesis specifying the zeros of the Riemann zeta function, can be reformulated as questions about solvability of specially constructed Diophantine equations22. It is noteworthy that the Riemann zeta function emerges in quantum statistical mechanics23,24, quantum entanglement and coherence25,26,27,28, random matrix theory29,30, string theory and related settings31. This enables a physical assessment of the Riemann hypothesis. Unfortunately, the required physical systems are not available off-the-shelf and need to be finessed, which remains a challenge. Recently a vigorous debate has been initiated by the proposal32 to reduce the Riemann hypothesis to the quantization of the classical Hamilton 2xp.

Physics is also full of noncomputable problems. The undecidability of the presence of chaos in classical Hamiltonian systems has been established33. The problem whether a boolean combination of subspaces (including negations) is reachable by a quantum automation was proved to be undecidable34. The question whether a quantum system is gapless also cannot be decided by an algorithm35,36,37. Whether a many-body model is frustration-free is undecidable as well38. Smith (Sec. 6 of39) identified a striking physical consequence of the Hilbert’s tenth problem that ground state energies and half-life times of excited states are, strictly speaking, non-computable for many-body systems. A variety of seemingly simple problems in quantum information theory has been shown not to be decidable40. The question whether a sequence of outcomes of some sequential measurement cannot be observed is undecidable in quantum mechanics, whereas it is decidable in classical physics41. In this case, the algorithmic undecidability turned out to be the signature of quantumness.

Despite a significant interest to computability of various physical problems, to the best of our knowledge, computability of quantum control has not been systematically studied. The aim of this work is to fill this gap. We establish a connection between optimal quantum control and Diophantine equations and show how the latter emerges in control of various physical systems such as, e.g., a multi-mode coherent field driven by displacement operators of the fixed magnitude (Fig. 1). It is noteworthy that Diophantine equations were mentioned in40 as a possible tool to analyze computability of quantum information tasks, but it has never been put to use. Furthermore, Theorem 2 in40 may be interpreted to imply the undecidability of control task (i) for a finite dimensional quantum system even though “quantum control” is never mentioned in the preprint40. In this work, we not only prove uncomputability of quantum control by a different method and generalize to infinite dimensional quantum systems, but also show that even approximate quantum control tasks (i.e., for which it is sufficient to find an optimum with a ε-accuracy) remain uncomputable as long as ε is small enough. A general scheme to construct control tasks of various complexity classes is also developed.

Figure 1
figure 1

A physical system for simulating Diophantine equations with n variables. The system is either n trapped ions or an n–mode coherent field. The controls \({\hat{D}}_{1}^{\dagger }\), …, \({\hat{D}}_{n}^{\dagger }\) independently address each subsystem. For ions, the controls excite transitions between nearest levels, and transfer population of the highest excited state down to the ground state. For coherent states, the control for the i-th mode is the displacement \({\hat{D}}_{i}\) by the magnitude one. The Diophantine polynomial is embedded in the observable \(\hat{O}\) whose expectation value has to be optimized as the control goal. A highly non-trivial example corresponds already to the simple case of a two-mode coherent field (n = 2) with \(\hat{O}=-\,(\alpha {\hat{a}}_{1}^{\dagger }{\hat{a}}_{1}^{\dagger }+\beta {\hat{a}}_{2}^{\dagger }-\gamma )(\alpha {\hat{a}}_{1}{\hat{a}}_{1}+\beta {\hat{a}}_{2}-\gamma )\), where α, β, and γ are positive integers. The observable is non-linear but physical; its leading term is of the Kerr-type nonlinearity. Maximizing the expectation of this observable is NP-hard, i.e., it is at least as hard as the famous Traveling Salesman Problem. Note that an n = 9 system is sufficient to solve any Diophantine equation.

In particular, we show that solving a Diophantine equation is equivalent to solving a certain quantum control task, and moreover, any question for which a computer program can give an answer can be stated as a quantum control task. This means that quantum control is Turing complete. In our approach the Diophantine equation is embedded in the target observable \(\hat{O}\) whose expectation value has to be optimized as the control goal. This implies uncomputability of quantum control tasks (i) and (ii) introduced at the beginning. From a pragmatic point of view, this results means that there is no algorithm that outputs “true” or “false” whether a control sequence composed from a finite set of available controls exists to maximize either the observable’s expectation or state-to-state transfer in an arbitrary generic case. This, however, does not exclude the possibility that some particular classes of control problems can have such an algorithm. The uncomputability motivates use of heuristics, e.g., such as machine learning42. Moreover, any control problem can be made algorithmically solvable if we deploy a sufficiently flexible controls.

Our technique based on establishing the equivalence between quantum control problems and Diophantine equations also enables knowledge transfer from the complexity theory for Diophantine equations to quantum control theory. In particular, one can construct control problems belonging to various complexity classes. A highly non-trivial example corresponds already to a seemingly simple case of two-mode coherent field (n = 2) with target observable \(\hat{O}=-\,(\alpha {\hat{a}}_{1}^{\dagger }{\hat{a}}_{1}^{\dagger }+\beta {\hat{a}}_{2}^{\dagger }-\gamma )(\alpha {\hat{a}}_{1}{\hat{a}}_{1}+\beta {\hat{a}}_{2}-\gamma )\), where α, β, and γ are positive integers. The controlled evolution is represented by a family of simple bosonic Gaussian channels. (Note that bosonic Gaussian channels play an important role in quantum information science43). Maximizing the expectation of \(\hat{O}\) is NP-hard, i.e., it is at least as hard as the famous Traveling Salesman Problem.

The rest of the paper is organized as follows: We proceed by giving a precise mathematical formulation of the quantum control problem. Then, we show how for a given quantum control problem to construct a Diophantine equation whose solution yields the optimal control policy. After that we demonstrate the converse: how to simulate a given Diophantine equation using quantum control. Finally, the uncomputability and complexity of the considered quantum control tasks are discussed.

Results

Coherent quantum control

There are two physically distinct types of control regimes: Coherent control exploits conservative forces, predominately, coherent electromagnetic fields (e.g., MRI and laser pulses)3,4,7,9,44,45,46, whereas quantum reservoir engineering utilizes nonconservative interactions with a thermostat47,48,49,50,51,52,53,54,55. These different physical implementations have different mathematical formulations. Coherent control seeks a smooth temporal profile of the electromagnetic field steering dynamics, whereas reservoir engineering tailors a coupling between a thermostat and a controlled system.

Consider coherent control of an n-dimensional closed quantum system whose dynamics is governed by the Schrödinger equation for the unitary evolution operator \({\hat{U}}_{t}^{u}\)

$$i\frac{d{\hat{U}}_{t}^{u}}{dt}=({\hat{H}}_{0}+u(t)\hat{V}){\hat{U}}_{t}^{u}.$$
(1)

here \({\hat{H}}_{0}\) and \(\hat{V}\) are the free and interaction Hamiltonians and u(t) is a time-dependent control (e.g., a shaped laser pulse). Interaction with several controls can be described similarly. The control u(t) is commonly assumed to belong to some functional space, e.g., to the space L2([0, ∞]) of square integrable functions of time. A key notion is the controllability of the system. A (closed) quantum system is pure state controllable if any two pure initial \(|{\psi }_{{\rm{i}}}\rangle \) and final \(|{\psi }_{{\rm{f}}}\rangle \) states can be connected by some control such that \(|{\psi }_{{\rm{f}}}\rangle ={\hat{U}}_{t}^{u}|{\psi }_{{\rm{i}}}\rangle \) for some t and u. The famous result is that the system is projective state controllable if and only if the Lie algebra \({\rm{Lie}}\,\{\,-\,i{\hat{H}}_{0},-\,i\hat{V}\}\), generated by all commutators of the operators \(-i{\hat{H}}_{0}\) and \(-i\hat{V}\), is isomorphic to the Lie algebra \({\mathfrak{s}}{\mathfrak{p}}(n/2)\) or \({\mathfrak{s}}{\mathfrak{u}}(n)\) for even n, or \({\mathfrak{s}}{\mathfrak{u}}(n)\) for odd n.

A typical quantum control goal is to maximize objective \({J}_{\hat{O}}(u)=\langle \hat{O}\rangle \), which is expectation value of an observable \(\hat{O}\). Without the loss of generality, the maximum value of \(\langle \hat{O}\rangle \) (i.e., the largest eigenvalue of \(\hat{O}\)) can be assumed to be zero since adding a constant to \(\hat{O}\) has no physical consequences. If the system is controllable, then this maximum value is attained by some control. Thus, the problem of existence for any \(\hat{O}\) of a globally optimal control u*, i.e., such that \({J}_{\hat{O}}({u}^{\ast })=0\), is reduced to calculation of the rank of the Lie algebra \({\rm{Lie}}\,\{\,-\,i{\hat{H}}_{0},-\,i\hat{V}\}\), which can be done algorithmically for all finite-dimensional quantum controlled systems. In particular, this implies that establishing controllability of a quantum system is a computable task.

Digitized quantum control

The assumption that controls belong to some infinite-dimensional functional space, while convenient mathematically, is not realistic from an engineering perspective. In experiments, one always has a limited finite number of available controls. A typical example is bang-bang control where u(t) admits only two (on/off) values, or a switching control that can take several values. Any continuous control function in experiments is approximated by some, usually small enough, set of values. Thus in laboratory and numerical experiments, both coherent and incoherent types of controls are digitized, which imposes the discretization and boundedness for the accessible values. The number of available controls N is always finite, albeit large. Moreover, the measured or computed values of physical quantities have a finite precision, and thus can be represented as rational numbers. This fact lead to the development of the p-adic mathematical physics56,57.

The most general state of a controlled quantum system is represented by a density matrix \(\hat{\rho }\), which is a positive trace one operator in the system Hilbert space H. The transformation of the system’s initial density matrix \({\hat{\rho }}_{0}\) into the final density matrix under the action of the i-th control (i = 1, …, N) most generally can be represented by a Kraus map Φi, i.e., a completely positive trace preserving transformation58. Such maps have a (non-unique) operator-sum representation59

$${\Phi }_{i}[{\hat{\rho }}_{0}]=\sum _{j}\,{\hat{K}}_{i,j}{\hat{\rho }}_{0}{\hat{K}}_{i,j}^{\dagger }.$$
(2)

Here \({\hat{K}}_{i,j}\) are (in general non-commuting) operators in H that satisfy the condition \(\sum _{j}\,{\hat{K}}_{i,j}^{\dagger }{\hat{K}}_{i,j}={\mathbb{I}}\) to guarantee the trace preservation for the density matrix.

We define the Digitized Quantum Control as a task of finding the control policy p specified by an integer sequence of length P, p = (p1, p2, …, pP) AP, which is from some set of accessible policies AP, such that the propagated quantum state \(\hat{\rho }({\bf{p}})={\Phi }_{{p}_{P}}\cdots {\Phi }_{{p}_{1}}[{\hat{\rho }}_{0}]\) yields an extremum for a desired objective function.

In particular, for the problem of preparing a target density matrix, when a quantum system is steered to a desired state \({\hat{\rho }}_{{\rm{f}}}\), one seeks the control policy p (if it exists) vanishing the objective function

$${F}_{{\hat{\rho }}_{{\rm{f}}}}({\bf{p}})=\parallel \hat{\rho }({\bf{p}})-{\hat{\rho }}_{{\rm{f}}}{\parallel }^{2}.$$
(3)

This objective equals to zero if and only if \(\hat{\rho }({\bf{p}})={\hat{\rho }}_{{\rm{f}}}\). A special yet equally important instance of the quantum state preparation problem is the problem of maximizing the expectation value of an observable \(\hat{O}\). Without the loss of generality, the maximum value of \(\langle \hat{O}\rangle \) is set to zero. In this case, the goal is to find a control policy vanishing the objective function

$${J}_{\hat{O}}({\bf{p}})={\rm{T}}{\rm{r}}\,(\hat{O}\hat{\rho }({\bf{p}})).$$
(4)

A particular case is the problem of steering an initial pure state |ψi〉 into a final pure state |ψf〉. For this problem, \(\hat{O}\) = |ψf〉〈ψf| is the projector onto the final state and \({\hat{\rho }}_{0}=|{\psi }_{{\rm{i}}}\rangle \langle {\psi }_{{\rm{i}}}|\) is the projector on the initial state, and the objective becomes the transition probability, \({J}_{|{\psi }_{{\rm{f}}}\rangle \langle {\psi }_{{\rm{f}}}|}={P}_{{\rm{i}}\to {\rm{f}}}=\langle {\psi }_{{\rm{f}}}|\hat{\rho }({\bf{p}})|{\psi }_{{\rm{f}}}\rangle \).

The functions (3) and (4) are related by the equality \({F}_{{\hat{\rho }}_{{\rm{f}}}}({\bf{p}})=\parallel {\hat{\rho }}_{{\rm{f}}}{\parallel }^{2}+\parallel \hat{\rho }({\bf{p}}){\parallel }^{2}-2{J}_{{\hat{\rho }}_{{\rm{f}}}}({\bf{p}})\), where \(\parallel {\hat{\rho }}_{{\rm{f}}}{\parallel }^{2}\) is a constant independent of the control policy. In the general case, the problem of minimizing F cannot be reduced to maximizing J, as illustrated by the example of a qubit with \({\hat{\rho }}_{{\rm{f}}}={\mathbb{I}}/2\) for which \({J}_{{\hat{\rho }}_{{\rm{f}}}}({\bf{p}})=1/2\) is constant for any p, while \({F}_{{\hat{\rho }}_{{\rm{f}}}}({\bf{p}})={\rm{const}}+\parallel \hat{\rho }({\bf{p}}){\parallel }^{2}\) is non-constant. However, in the case of pure initial |ψi〉 and final |ψf〉 states and controls restricted to unitary transformations, the problem (3) reduces to (4) with \(\hat{O}\) = |ψf〉〈ψf| − 1. Indeed, according to the Cauchy-Schwarz inequality, for an arbitrary state \(|\varphi \rangle \), \(\langle \hat{O}\rangle =\langle \varphi |\hat{O}|\varphi \rangle \le 0\) and the equality \(\langle \hat{O}\rangle =0\) takes place if and only if \(|\varphi \rangle =|{\psi }_{{\rm{f}}}\rangle \). The latter guarantees that the desired final state |ψf〉 is reached once maximization of (4) is converged. Note that problem (4) is a special case of problem (3) since minimizing (4) is equivalent to minimizing (3) with \({\hat{\rho }}_{{\rm{f}}}\) chosen as the projector onto the eigenstate corresponding to the largest eigenvalue of \(\hat{O}\).

Let us give examples of digitized quantum control. The simplest example is bang-bang control, which is switched on and off at some time instants, or more generally, is switched between two (maximal and minimal) values of its amplitude. In coherent control setting, steering quantum dynamics is achieved by tailoring the time profile of a laser pulse, whose intensity and bandwidth should not exceed engineering capabilities. The temporal form of the laser pulse can have the form \(u(t)=\mathop{\sum }\limits_{j=1}^{P}\,{A}_{j}{\chi }_{[{t}_{j},{t}_{j+1}]}(t)\), where \({\chi }_{[{t}_{j},{t}_{j+1}]}\) is the characteristic function of the fixed time interval [tj, tj+1] and Aj is the pulse intensity at the j-th time interval to be chosen among N available pulse intensities. Another example is the field of the form \(u(t)=\mathop{\sum }\limits_{j=1}^{P}\,{A}_{j}\,\cos \,({\omega }_{j}t)\), where ωi are some fixed frequencies and the amplitudes Aj are sought controls. In both cases the set AP of all attainable laser pulses has NP elements. In quantum computing, digitized quantum control mimics the problem of building a desired unitary transformation of a multi-qubit state using a finite number of universal quantum gates60,61, as well as various problems of finite computability62. The discrete-time control10,11,12,13,14 is also a particular type of digitized quantum control.

The digitized quantum control describes a very wide class of quantum control problems and has the following generic properties:

(i) The optimization problem (4), in general, cannot be solved by the control policy of a finite length (see Theorem 1 in Methods). This results follows from the fact that there is a continuum of digitized quantum control formulations, while finite-length controls form at most a countable set.

(ii) For any observable and an arbitrary initial state, the relaxed condition \({J}_{\hat{O}}\approx 0\) can be satisfied with any desired error for a control policy of a finite length if the set of controls is rich enough (see Theorem 2 in Methods). For example, one can use the dissipative interaction to cool the quantum system to the ground state, and then rotate this state using a tailored unitary transformation constructed from a set of universal quantum gates to the state with \(\langle \hat{O}\rangle \approx 0\) (i.e., to the eigenstate of \(\hat{O}\) corresponding to the largest eigenvalue).

According to the first property, time-discretization alone makes a quantum control problem ill-posed. For example, for closed systems there is no finite set of elementary unitary transformations that would exactly map a given pure initial state into a given pure target state. However, exact attainability of the target state is not required in practice. It is always sufficient to steer the system into a small neighborhood of the target state. The digitization, combining discretization and a finite precision, makes the problem well posed as per the second property. Theorem 2 shows that for some (specially constructed) set of accessible controls such an approximate attainability is achievable in a finite number of steps. The finiteness, in turn, automatically implies algorithmic solvability since straightforward, albeit time consuming, looping through all the allowed control policies is guaranteed to terminate with uncovering the sought control strategy. The algorithmic solvability for this special control set, however, does not imply computability for any other set. In practical terms, Theorem 2 means that any approximate quantum control task can be made solvable if the set of accessible controls is rich enough.

Reduction of digitized quantum control to a Diophantine equation

As discussed above, in laboratory and numerical experiments elements of the matrices \({\hat{K}}_{i,k}\), \({\hat{\rho }}_{0}\), \({\hat{\rho }}_{{\rm{f}}}\) and \(\hat{O}\) are complex numbers with rational imaginary and real parts. Using this fact, consider the matrix valued polynomials of the positive integer argument i

$${\hat{\varphi }}_{j}(i)=\mathop{\sum }\limits_{l=1}^{N}\,{\hat{K}}_{l,j}\mathop{\prod }\limits_{m=1,\,l\ne m}^{N}\,\frac{i-m}{l-m}.$$
(5)

By construction \({\hat{\varphi }}_{j}(i)\equiv {\hat{K}}_{i,j}\) for 1 ≤ i ≤ N. For every fixed j, Eq. (5) is a matrix-valued Lagrange interpolation polynomial of variable i passing trough N points \((1,{\hat{K}}_{1,j}),\ldots ,(N,{\hat{K}}_{N,j})\). The objective function \({F}_{{\hat{\rho }}_{{\rm{f}}}}\) from Eq. (3) reduces to the following polynomial with rational coefficients of P positive integer arguments

$${\mathfrak{F}}({\bf{p}})={\left \Vert \sum _{{k}_{1},\ldots ,{k}_{P}}(\mathop{\prod }\limits_{l=P}^{1}{\hat{\varphi }}_{{k}_{l}}({p}_{l})){\hat{\rho }}_{0}{(\mathop{\prod }\limits_{m=P}^{1}{\hat{\varphi }}_{{k}_{m}}({p}_{m}))}^{\dagger }-{\hat{\rho }}_{{\rm{f}}}\right\Vert }^{2}.$$
(6)

Finally, the policy p solves the state preparation problem (3) if and only if it solves the Diophantine equation

$${\mathfrak{F}}({\bf{p}})+\prod _{{\bf{p}}\text{'}\in AC}\,\mathop{\sum }\limits_{k=1}^{P}\,{({p}_{k}-{p^{\prime} }_{k})}^{2}=0,$$
(7)

Both the terms in Eq. (7) are non-negative. The sum equals to zero only if each term vanishes. The first term is zero if and only if the control policy p is optimal, i.e., \(\hat{\rho }({\bf{p}})={\hat{\rho }}_{{\rm{f}}}\). The last term equals to zero if and only if the control policy p is an accessible control, i.e., its components satisfy \({p}_{k}={p^{\prime} }_{k}\) for some p′ AC.

In the similar fashion, the policy p solves the problem of maximizing the expectation value (4) if and only if it solves the Diophantine equation

$${{\mathfrak{J}}}^{2}({\bf{p}})+\prod _{{\bf{p}}\text{'}\in AC}\,\mathop{\sum }\limits_{k=1}^{P}\,{({p}_{k}-{p^{\prime} }_{k})}^{2}=0,$$
(8)

where the reduction of the objective function \({J}_{\hat{O}}\) to a polynomial with rational coefficients reads

$${\mathfrak{J}}({\bf{p}})=\sum _{{k}_{1},\ldots ,{k}_{P}}\,{\rm{Tr}}\left(\hat{O}\left[\mathop{\prod }\limits_{l=P}^{1}\,{\hat{\varphi }}_{{k}_{l}}({p}_{l})\right]{\hat{\rho}}_{0}{\left[\mathop{\prod }\limits_{m=P}^{1}{\hat{\varphi }}_{{k}_{m}}({p}_{m})\right]}^{\dagger }\right).$$
(9)

Note that there are many other ways to construct polynomials (6) and (9).

We now show that the problem of finding a control policy bringing the value of an objective function approximately close to the extremum (with a desired degree of accuracy) is also reducible to solving a Diophantine equation. To present the derivation in a unified fashion, let \({\mathfrak{G}}({\bf{p}})\) denote either \({{\mathfrak{J}}}^{2}({\bf{p}})\) or \({\mathfrak{F}}({\bf{p}})\). By definition \({\mathfrak{G}}({\bf{p}})\ge 0\) [i.e., it follows from Eqs. (9) and (6)]. Thus, reaching close to the optimum means that for a given rational ε > 0, \({\mathfrak{G}}({\bf{p}}) < \varepsilon \). Using the methods presented in Ch. 1 of ref. 16, we observe that the inequality is satisfied if and only if there are positive integers a and b such that \({\mathfrak{G}}({\bf{p}})+a/b=\varepsilon \). Lagrange’s four-square theorem, stating that a positive integer can be written as the sum of four integer squares, lifts the requirement of the positivity of a and b, leading to the following Diophantine equation with ancillary unknowns a1, …, a4, b1, …, b4:

$$({b}_{1}^{2}+{b}_{2}^{2}+{b}_{3}^{2}+{b}_{4}^{2})({\mathfrak{G}}({\bf{p}})-\varepsilon )+{a}_{1}^{2}+{a}_{2}^{2}+{a}_{3}^{2}+{a}_{4}^{2}=0.$$
(10)

Finally, by constraining control policies to the accessible set AP, we obtain the sought Diophantine equation for the control policy p yielding the optimum within an ε-accuracy

$${[({b}_{1}^{2}+{b}_{2}^{2}+{b}_{3}^{2}+{b}_{4}^{2})({\mathfrak{G}}({\bf{p}})-\varepsilon )+{a}_{1}^{2}+{a}_{2}^{2}+{a}_{3}^{2}+{a}_{4}^{2}]}^{2}+\prod _{{\bf{p}}\text{'}\in AC}\,\mathop{\sum }\limits_{k=1}^{P}\,{({p}_{k}-{p^{\prime} }_{k})}^{2}=0.$$
(11)

Simulation of a Diophantine equation with digitized quantum control

Here we show how to simulate the problem of finding positive integer solutions of a Diophantine equation D(x1, …, xn) = 0 with digitized quantum control. Let us introduce X-dimensional vectors |ek〉 containing 1 in the k-th position and zeros elsewhere, the matrix \(\hat{H}=\mathrm{diag}\,(1,2,\ldots ,X)\) and the unitary X × X shift matrix

$$\hat{\Sigma}=\left(\begin{array}{llll} 0 & & & 1\\ 1 & 0 & &\\ & \ddots & \ddots & \\ & & 1 & 0\\ \end{array}\right)$$
(12)

obeying \(\hat{\Sigma }|{e}_{k}\rangle =|{e}_{k+1}\rangle \), where |eX+1〉 = |e1〉 is assumed. Define also for l = 1, …, n

$$\left(\begin{array}{c}{\hat{H}}_{l}\\ {\hat{\Sigma }}_{l}\end{array}\right)=\begin{array}{c}l-1\\ \otimes \\ q=1\end{array}\hat{1}\otimes \left(\begin{array}{c}\hat{H}\\ \hat{\Sigma }\end{array}\right)\begin{array}{c}n-l\\ \otimes \\ q=1\end{array}\hat{1}.$$
(13)

Since all matrices \({\hat{H}}_{l}\) commute by construction, the eigenvalues and eigenvectors of the matrix \(\hat{D}=D({\hat{H}}_{1},\ldots ,{\hat{H}}_{n})\) are given by

$$(D({\hat{H}}_{1},\ldots ,{\hat{H}}_{n})-D({x}_{1},\ldots ,{x}_{n}))|{e}_{{x}_{1}},\ldots ,{e}_{{x}_{n}}\rangle =0,$$
(14)

where 1 ≤ xl ≤ X. This relation allows to formulate the equivalence between Diophantine equations and quantum control:

A Diophantine equation D(x1, …, xn) = 0 has a positive integer solution with 1 ≤ xl ≤ X if and only if the control problem (4) with \(\hat{O}=-\,D{({\hat{H}}_{1},\ldots ,{\hat{H}}_{n})}^{2}\), \({\hat{\rho }}_{0}={\otimes }_{l=1}^{n}|{e}_{1}\rangle \langle {e}_{1}|\), \({\Phi }_{0}[\hat{\rho }]=\hat{\rho }\), \({\Phi }_{l}[\hat{\rho }]={\hat{\Sigma }}_{l}\hat{\rho }{\hat{\Sigma }}_{l}^{\dagger }\), l = 1, …, n has a policy p yielding \({J}_{\hat{O}}=0\). The set of accessible policies is AP = [0,1,2, …, n]Q, where Q ≥ nX.

The motivation for this construction is as follows (see also Fig. 1): The vector |ek〉 encodes integer k as \(\hat{H}|{e}_{k}\rangle =k|{e}_{k}\rangle \); similarly, vector \(|{e}_{{x}_{1}},\ldots ,{e}_{{x}_{n}}\rangle \) encodes an integer tuple (x1, …, xn). The initial density matrix \({\hat{\rho }}_{0}\) represents the n-tuple (1, …, 1). The action of each Φl onto a density matrix encoding a tuple (x1, …, xn) is equivalent to the operation xl → xl + 1 of incrementing the tuple’s l-th component. To scan all the values of xl from 1 to X, Φl needs to sequentially act X times onto \({\hat{\rho }}_{0}\). Thus, the length of the policy should be at least nX to scan through all possible combinations of the n variables. The trivial identity transformation Φ0 (not modifying the density matrix) is employed due to the following reason: Assume the value of the l′-th component of the solution of the Diophantine equation is L < X, then Φl should be used only L times followed by (X − L) applications of Φ0.

The construction above employs only unitary operations. However, the described method can be adopted to use the amplitude damping Kraus maps59. Consider the Kraus map \(\Phi [\hat{\rho }]=\mathop{\sum }\limits_{i=1}^{X}\,{\hat{K}}_{i}\hat{\rho }{\hat{K}}_{i}^{\dagger }\), where \({\hat{K}}_{1}=|{e}_{1}\rangle \langle {e}_{1}|\), \({\hat{K}}_{i}=|{e}_{i-1}\rangle \langle {e}_{i}|\), i = 2, …, X obeying \(\Phi (|{e}_{k}\rangle \langle {e}_{k}|)=|{e}_{{\rm{\max }}(1,k-1)}\rangle \langle {e}_{{\rm{\max }}(1,k-1)}|\), which moves the population from k to (k − 1) level with the first level being the stationary state. Then a Diophantine equation D(x1, …, xn) = 0 has a positive integer solution, 1 ≤ xl ≤ X, if and only if the optimization problem (4) with \(\hat{O}=-\,D{({\hat{H}}_{1},\ldots ,{\hat{H}}_{n})}^{2}\), \({\hat{\rho }}_{0}={\otimes }_{l=1}^{n}|{e}_{X}\rangle \langle {e}_{X}|\), \({\Phi }_{0}[\hat{\rho }]=\hat{\rho }\), \({\Phi }_{i}[\hat{\rho }]=\mathop{\sum }\limits_{j=1}^{X}\,{\hat{K}}_{i,j}\hat{\rho }{\hat{K}}_{i,j}^{\dagger }\), \({\hat{K}}_{l,k}={\otimes }_{q=1}^{l-1}\hat{1}\otimes {\hat{K}}_{k}{\otimes }_{q=1}^{n-l}\hat{1}\), l = 1, …, n has a policy p yielding \({J}_{\hat{O}}=0\). The set of accessible policies is AP = [0,1,2, …, n]Q, where Q ≥ nX.

The two presented constructions have a drawback that they involve the upper bound X for a sought solution. The following third reduction of the Diophantine equation into digitized quantum control uses multi-mode coherent states and overcomes this limitation (see also Fig. 1):

Theorem. A Diophantine equation D(x1, …, xn) = 0 is solvable in nonnegative integers if the optimization problem (4) with \({\hat{\rho }}_{0}=|0,\ldots ,0\rangle \langle 0,\ldots ,0|\), \({\Phi }_{l}[\hat{\rho }]={\hat{D}}_{l}\hat{\rho }{\hat{D}}_{l}^{\dagger }\), \({\hat{D}}_{l}=\exp ({\hat{a}}_{l}^{\dagger }-{\hat{a}}_{l})\) and a control policy of an arbitrary length achieves \({J}_{\hat{O}}=0\) for the observable \(\hat{O}=-\,D{({\hat{a}}_{1},\ldots ,{\hat{a}}_{n})}^{\dagger }D({\hat{a}}_{1},\ldots ,{\hat{a}}_{n})\).

The controlled Kraus map Φl is a bosonic Gaussian channel43. Here |α1, …, αn〉 is a composite coherent state: \({\hat{a}}_{l}|{\alpha }_{1},\ldots ,{\alpha }_{n}\rangle ={\alpha }_{l}|{\alpha }_{1},\ldots ,{\alpha }_{n}\rangle \), so that \(D({\hat{a}}_{1},\ldots ,{\hat{a}}_{n})|{\alpha }_{1},\ldots ,{\alpha }_{n}\rangle =D({\alpha }_{1},\ldots ,{\alpha }_{n})|{\alpha }_{1},\ldots ,{\alpha }_{n}\rangle \). The displacement operator \({\hat{D}}_{l}\) acts on l-th mode as \({\hat{D}}_{l}|\ldots ,{\alpha }_{l},\ldots \rangle =|\ldots ,{\alpha }_{l}+1,\ldots \rangle \) and describes the increase of the laser intensity by the magnitude one for the l-th mode without altering the phase. Thus, the maximum of the objective function, \({J}_{\hat{O}}=0\), is reached only by the coherent state |x1, …, xn〉 such that D(x1, …, xn) = 0. Unlike number states, which are difficult to create experimentally, this reduction uses only easily available coherent states describing laser radiation. The presented formulation is open to a number of generalizations.

Solving a Diophantine equation can also be reduced to solving an optimization problem with an ε-accuracy for a sufficiently small ε. This readily follows from the above constructions. Chosen controls and initial quantum state ensure that \(\langle \hat{O}\rangle \) takes only non-positive integer values during optimization. Thus, for any 0 < ε < 1, finding a control policy that − ε ≤ \(\langle \hat{O}\rangle \) ≤ 0 (i.e., optimal with an ε-accuracy) is equivalent to reaching the maximum \(\langle \hat{O}\rangle \) = 0. This conclusion holds for ε < 1 which is relatively small in comparison with typical values of the objective (i.e., values of the Diophantine polynomial evaluated at integer arguments). If the allowed error is large enough then a separate analysis is needed, which is beyond the scope of this work.

The found equivalence of Diophantine equations and digitized quantum control employs commuting Kraus maps. They can be viewed as a faithful matrix formulation of the special Turing machine that was constructed in section 5.4 of16. This Turing machine for any given Diophantine equation loops through all the tuples of positive integers and halts when a solution is found. The formulation obtained in the present work is not necessarily optimal, e.g., in the number of used Kraus maps. Constructing more compact representations relying on non-commutative operators and using quantum interferences should be a subject of future work. Furthermore, the presented reduction transfers the complexity of a Diophantine equation into the observable while keeping controls simple. Different constructions that distribute the complexity between the control and observable should be investigated.

By including additional unknowns any Diophantine equation can be transformed to the equivalent forth order equation16. The number of unknowns can be decreased down to 9 by increasing the degree of the Diophantine polynomial63. These observations imply that for digitized quantum control with multimode coherent states, it is always sufficient to use no more than 9 modes by utilizing a higher order polynomial observable; whereas, the order of nonlinearities can be decreased to 4 by increasing the number of modes.

Uncomputability and complexity of digitized quantum control

The Matiyasevich-Robinson-Davis-Putnam theorem16,17 uncovers an equivalence between sets of solutions of Diophantine equations and sets of outputs of computer programs, which are allowed to run forever. The reduction of a computer program to the corresponding Diophantine equation is constructive. The Matiyasevich-Robinson-Davis-Putnam theorem leads to the negative resolution of Hilbert’s tenth problem16,17, meaning that the solvability of an arbitrary Diophantine equation is not decidable.

The negative resolution of Hilbert’s tenth problem also implies the uncomputability of digitized quantum control. Moreover, digitized quantum control with an ε-accuracy for small enough ε are also uncomputable.

Thus, the problem of maximizing an expectation value (4) is undecidable and so is the problem of quantum state preparation (3) since the former is a special case of the latter. This means that there is no algorithm deciding on the existence or non-existence of an optimal control solution for an arbitrary digitized quantum control problem. This finding does not preclude an algorithmic solution for a particular digitized quantum control problem. It is noteworthy that tracking the time-evolution of an observable64,65 is a manifestly algorithmically solvable quantum control problem, which nevertheless cannot be reduced to either objective function (3) or (4).

The established equivalence between digitized quantum control and Diophantine equations can be used to synthesize quantum control problems belonging to a certain computational complexity class. For example, finding an optimal control policy to reach \(\langle \hat{O}\rangle \) = 0 with \(\hat{O}=-\,(\alpha {\hat{a}}_{1}^{\dagger }{\hat{a}}_{1}^{\dagger }+\beta {\hat{a}}_{2}^{\dagger }-\gamma )(\alpha {\hat{a}}_{1}{\hat{a}}_{1}+\beta {\hat{a}}_{2}-\gamma )\) is NP-hard. This is a consequence of the fact that it is an NP-complete problem to decide the solvability of the Diophantine equation \(\alpha {x}_{1}^{2}+\beta {x}_{2}=\gamma \) with respect to x1 and x266. Therefore, this digitized quantum control problem is at least as hard as the celebrated Traveling Salesman Problem. Note that the leading nonlinearity in \(\hat{O}\) is of the Kerr type (see, e.g.67,68), which makes this proposal of experimental interest.

On the contrary, our technique can also be used to construct simple quantum control problems. For example, finding an optimal control policy to reach \(\langle \hat{O}\rangle =0\) with \(\hat{O}=-\,({\hat{a}}_{1}^{\dagger }{\hat{a}}_{1}^{\dagger }-{n}^{2}{\hat{a}}_{2}^{\dagger }{\hat{a}}_{2}^{\dagger }-1)({\hat{a}}_{1}{\hat{a}}_{1}-{n}^{2}{\hat{a}}_{2}{\hat{a}}_{2}-1)\) is easy because x1 = 1, x2 = 0 is the only solution of the Pell’s Diophantine equation \({x}_{1}^{2}-{n}^{2}{x}_{2}^{2}=1\) in non-negative integers.

It is worth comparing our findings with the theory of quantum control landscapes69, which studies the objective, e.g., \({J}_{\hat{O}}(u)\), as a functional of the control u = u(t), which is an arbitrary time dependent function not restricted to integer sequences. If the objective has only global maxima (i.e., local maxima are absent), then a gradient algorithm converges to an optimal control. In this work, we consider a different situation when there is a finite number of basic elementary controls that can be applied multiple times and in an arbitrary time order. This is the case of digitized quantum control, for which no algorithm can find a solution in the general case. In ref. 70, it has been shown how the control landscape of digitized quantum control problems can be mapped to a classical Ising model, which among other things reveals that the connection between easy and hard control tasks is akin to a phase transition.

Our reduction of Diophantine equations to quantum control problems allows to formulate various mathematical conjectures as, perhaps extremely complex, quantum control tasks, thereby in principle providing a route for experimental assessment for the unsolved conjectures. As an example, consider the Riemann hypothesis. Matiyasevich wrote the explicit form of the Diophantine equation with the property that it has infinitely many solutions if the hypothesis is false and has no solution if the hypothesis is true22. Using our approach the Riemann hypothesis can be reformulates as some quantum control problem albeit extremely complex. Moreover, quantum control can be applied to evaluate any mathematical expression formed from arithmetic (+, ×, −, =) and logical (>, “and”, “or”) operations, existential quantifiers (e.g., \(\exists x\) – there exists x), and bounded universal quantifiers (e.g., \(\forall x < M\) – for all x less than M). A constructive proof that such expressions are equivalent to solving Diophantine equations can be found in chapters 1 and 6 of16.

Discussion

Computability of quantum control problems has been analyzed. A realistic situation, when a number of controls is finite, has been considered. We have shown that within this setting solving quantum control problems is equivalent to solving Diophantine equations. As a consequence, quantum control is Turing complete. The established equivalence is a new technique for quantum technology that, e.g., allows to construct quantum problems belonging to a specific complexity class. Examples of a multimode coherent field control are explicitly constructed. The negative answer to the Hilbert’s tenth problem implies that there is no algorithm deciding whether there is a control policy connecting two quantum states represented by arbitrary pure or mixed density matrices, i.e., the most general fixed-time quantum state-to-state control problem is not algorithmically solvable. This result applies to the problems of finding exact as well approximate solutions for sufficiently small errors. Our method opens up an opportunity to recast many open mathematical problems, including the Riemann hypothesis, as quantum control tasks. The uncovered non-algorithmic nature makes quantum control a fruitful research area.

Methods

We shall prove two theorems elucidating properties of digitized quantum control.

Theorem 1. There are digitized quantum control problems for which the condition \({J}_{\hat{O}}({\bf{p}})={J}_{0}\) for some J0 such that Omin ≤ J0 ≤ Omax (Omin and Omax are minimal and maximal eigenvalues of \(\hat{O}\)) is never satisfied by any control policy of finite length.

Proof. Consider a specific class of digitized quantum control problems with Kraus maps Φi being unitary rotations, \({\Phi }_{i}[\hat{\rho }]={\hat{V}}_{i}\hat{\rho }{\hat{V}}_{i}^{\dagger }\), \({\hat{V}}_{i}{\hat{V}}_{i}^{\dagger }=\hat{{\mathbb{I}}}\), and the initial density matrix \({\hat{\rho }}_{0}=|\psi \rangle \langle \psi |\) corresponding to a pure state. In this case, the negation of the theorem statement implies that for every \(\hat{O}\) and |ψ〉 there exists a policy p of a finite length P such that \({J}_{\hat{O}}({\bf{p}})={J}_{0}\), where

$${J}_{\hat{O}}({\bf{p}})=\langle \psi |{\left(\mathop{\prod }\limits_{k=1}^{P}{\hat{V}}_{{p}_{k}}\right)}^{\dagger }\hat{O}\left(\mathop{\prod }\limits_{k=1}^{P}\,{\hat{V}}_{{p}_{k}}\right)|\psi \rangle .$$
(15)

Comparing this with the eigendecomposition of the observable \(\hat{O}={\hat{U}}^{\dagger }{\rm{diag}}\,({O}_{{\rm{\min }},\ldots ,}{O}_{{\rm{\max }}})\hat{U}\), \(\hat{U}{\hat{U}}^{\dagger }=\hat{{\mathbb{I}}}\), we conclude that the condition \({J}_{\hat{O}}={J}_{0}\) can be met if we select \(\hat{U}=\mathop{\prod }\limits_{k=1}^{P}\,{\hat{V}}_{{p}_{k}}\) and \(|\psi \rangle =\sqrt{\lambda }|{\psi }_{{\rm{\min }}}\rangle +\sqrt{1-\lambda }|{\psi }_{{\rm{\max }}}\rangle ,\) where |ψmax〉 and |ψmin〉 are the normalized eigenvectors corresponding to the largest and smallest eigenvalues of \(\hat{O}\) and λ = (Omax − J0)/(Omax − Omin).

The latter establishes a correspondence between an arbitrary unitary matrix and a finite integer sequence p. Thus we reached the contradiction that the set of all unitary matrices is countable.

Theorem 2. For an n-dimensional quantum system, there exists a finite set of Kraus map controls such that for any \({\hat{\rho }}_{0}\), \(\hat{O}\), J0 (Omin ≤ J0 ≤ Omax), and an arbitrary ε > 0, there is a control policy of a finite length satisfying \(|{J}_{\hat{O}}-{J}_{0}| < \varepsilon \).

Proof. Let \(|\tilde{\psi }\rangle \) be any pure state of the quantum system. Then there exists a universally optimal Kraus map71 \({\Phi }_{\tilde{\psi }}\) such that \({\Phi }_{\tilde{\psi }}(\hat{\rho })=|\tilde{\psi }\rangle \langle \tilde{\psi }|\) for any density matrix ρ̂. Kraus operators for this universally optimal Kraus map have the form \({\hat{K}}_{i}=|\tilde{\psi }\rangle \langle {\chi }_{i}|\), where \(\{|{\chi }_{i}\rangle {\}}_{i=1}^{n}\) is an orthonormal basis in the system Hilbert space.

By the Solovay-Kitaev theorem59,72,73, for an n-dimensional quantum system there exists a finite set \({\mathscr{U}}\) of unitary operators such that for any unitary operator \(\hat{U}\in SU(n)\) there exists a finite sequence \(\hat{S}={\hat{S}}_{k}\cdots {\hat{S}}_{1}\) with elements \({\hat{S}}_{i}\in {\mathscr{U}}\) that satisfies \(d(\hat{U},\hat{S})\equiv \parallel \hat{U}-\hat{S}\parallel \equiv \mathop{{\rm{\sup }}}\limits_{\parallel \psi \parallel =1}\parallel (\hat{U}-\hat{S})\psi \parallel < \varepsilon \). Let the corresponding set of Kraus maps be \({\mathscr{K}}=\{\Phi |\Phi (\hat{\rho })=\hat{U}\hat{\rho }{\hat{U}}^{\dagger },{\rm{w}}{\rm{h}}{\rm{e}}{\rm{r}}{\rm{e}}\,\hat{U}\in {\mathscr{U}}\}\).

Consider the (finite) set \(\tilde{{\mathscr{K}}}=\{{\Phi }_{\tilde{\psi }}\}{\cup }^{}{\mathscr{K}}\) of Kraus maps, where one map is non-unitary and all other are unitary. Then the constructed set satisfies the statement of the theorem. Indeed, let |ψ〉 be the vector constructed in the proof of Theorem 1. Let \(\hat{U}\) be a unitary operator such that \(\hat{U}|\mathop{\psi }\limits^{ \sim }\rangle =|\psi \rangle \), and \(\hat{S}={\hat{S}}_{k}\cdots {\hat{S}}_{1}\) be its \(\varepsilon /\parallel \hat{O}\parallel \)-approximation by elements of \({\mathscr{U}}\). Then for the finite composition \(\Phi ={\Phi }_{k}\ldots {\Phi }_{1}{\Phi }_{\tilde{\psi }}\) we have \(|{J}_{\hat{O}}-{J}_{0}| < \varepsilon \).

We remark that, by construction, there are infinitely many sets \(\tilde{{\mathscr{K}}}\) satisfying the theorem. Indeed, the map \({\Phi }_{\tilde{\psi }}\) can be chosen for any vector \(|\tilde{\psi }\rangle \) and moreover, there exist infinitely many sets of unitary operators \({\mathscr{U}}\).