{'fraction_non_alphanumeric': 0.04547985891962131, 'fraction_numerical': 0.012205309077408577, 'mean_word_length': 4.335231492943798, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Time Optimal Unitary Operations

Extending our previous work on time optimal quantum state evolution, we formulate a variational principle for the time optimal unitary operation, which has direct relevance to quantum computation. We demonstrate our method with three examples, i.e. the swap of qubits, the quantum Fourier transform and the entangler gate, by choosing a two-qubit anisotropic Heisenberg model.


I. INTRODUCTION
Time optimal quantum computation is attracting a growing attention [1,2,3,4] besides the more conventional concept of optimality in terms of gate complexity, i.e. the number of elementary gates used in a quantum circuit [5]. The minimization of physical time to achieve a given unitary transformation is relevant for the design of fast elementary gates. It also provides a physical ground to describe the complexity of quantum algorithms, whereas gate complexity should be regarded as a more abstract concept in which physics is implicit. Works relevant to the former subject can be found, e.g., in [1] and [2], which discuss the time optimal generation of unitary operations for a small number of qubits using a Cartan decomposition scheme and assuming that one-qubit operations can be performed arbitrarily fast. An adiabatic solution to the optimal control problem in holonomic quantum computation was given in [6], while Schulte-Herbrüggen et al. [3] numerically obtained improved upper bounds on the time complexity of certain quantum gates. The present authors [7] discussed the quantum brachistochrone for state evolution, i.e. the problem of finding the time optimal evolution and the optimal Hamiltonian of a quantum system for given initial and final states. Nielsen et al. [8] proposed a criterion for optimal quantum computation in terms of a certain geometry in Hamiltonian space, and showed in [9] that the quantum gate complexity is related to optimal control cost problems. Khaneja et al. [10] suggested a geometrical method for the efficient synthesis of the controlled-not gate between two qubits with a special Hamiltonian.
In the standard quantum computation paradigm a whole algorithm may be reduced to a sequence of unitary transformations between intermediate states and a final measurement to read the result. In this paper we address the time optimality of each unitary transformation, i.e., each subroutine. An example is the discrete Fourier transform in Shor's algorithm for factorization.
In our previous work [7], the quantum brachistochrone was formulated as an action principle for the quantum state in the complex projective space endowed with the Fubini-Study metric, and the Hamiltonian subject to certain constraints. We obtained the time optimal state evolution and the optimal Hamiltonian by solving the Euler-Lagrange equations. In the present work we extend the methods used in [7] and we describe the general framework for finding the time optimal realization of a given unitary operation. Roughly speaking, we replace the projective space representing quantum state vectors with the space of unitary operators. While the optimality in the previous work depends on the initial state, it does not in the present case so that it is more directly relevant to subroutines in quantum computation, where the input may be unknown. This work should be useful not only for designing the efficient quantum algorithms and devices but also for deepening our insight into the true origin of the power of quantum computation.
The paper is organized as follows. In Section II we introduce the problem by defining an action principle for the time optimal realization of unitary operations, under the condition of a Schrödinger evolution and of the existence of a set of constraints for the available Hamiltonians, and we derive the fundamental equations of motion. We discuss a typical class of the problem in Section III. In Section IV we explicitly show how our formalism works via the example of a two-qubit system, which self-interacts by an anisotropic Heisenberg Hamiltonian depending on several control parameters. We derive the time optimal controls and the optimal time duration re-quired to generate a swap gate, a 'qft' gate and an entangler gate. A system in which certain operations take negligible time is discussed briefly in Section V. Finally, Section VI is devoted to the summary and discussion of our results.

II. A VARIATIONAL PRINCIPLE
Let us consider the problem of performing a given unitary operation or a quantum subroutine in the shortest time by controlling a certain physical system. Mathematically this is a time optimality problem of achieving a unitary operator U f ∈ U (N ) (modulo overall phases) by controlling the Hamiltonian H(t) and evolving a unitary operator U (t), where H(t) and U (t) obey to the Schrödinger equation. Note that overall phases are physically irrelevant for quantum evolutions. One immediately observes that there must be some constraints for H(t), because otherwise one would be able to realize U f in an arbitrarily short time simply by rescaling the Hamiltonian [7]. Thus at least the 'magnitude' of the Hamiltonian must be bounded. Physically this corresponds to the fact that one can afford only a finite energy in the experiment. Besides this normalization constraint, the available Hamiltonians may be subject also to other constraints, which can represent either experimental requirements (e.g., the specifications of the apparatus in use) or theoretical conditions (e.g., allowing no operations involving three or more qubits).
We then define the following action for the dynamical variables U (t) and H(t), with where we have introduced the Hilbert-Schmidt norm A, B := Tr A † B and the projection P U (A) := 1 N Tr(AU † )U . The Hermitian operator Λ(t) and the scalars λ j (t) are Lagrange multipliers. The action term L T dt gives the time duration to be optimized and corresponds to the action [ds/v], where v is the velocity of the particle, in the classical brachistochrone. The metric is analogous to the Fubini-Study metric ds 2 F S = dψ|(1 − |ψ ψ|)|dψ for the quantum state |ψ and is invariant under left and right global U (N ) multiplications.
The variation of L S by Λ gives the Schrödinger equation where T is the time ordered product. This is similar to the case of the quantum brachistochrone for quantum states [7]. On the other hand, the variation of L C by λ j leads to the constraints for H, If we assume that the constraint functions where θ is a real function. In the following we will consider the time optimal evolution of operators belonging to the group U (N )/ U (1) ≃ SU (N ). This is natural because overall phases are irrelevant in quantum mechanics.
To present our method in its simplest form, we have restricted ourselves to the case where the gauge degree of freedom is U (1). However, when there are quantum operations whose time duration is so short that it can be neglected, we will have a larger gauge group K. Such a case is discussed briefly in Section V. We incidentally note here that, when the Hamiltonian is time independent, the unitary operator actually evolves along a geodesic with respect to the metric ds 2 U . This can be easily seen from (6), which implies the same equation as derived from the variation by U of the arclength ds U .
Let us now derive the other equations of motion. Before taking variations of the action, it is convenient to rewrite L T as where we have used the relation P U (A) = P 1 (AU † )U . Then the variation of S by H gives where we have introduced the operator which plays an important role in the following. Using (6), which implies L T = 1, and recalling that (1 − P 1 )(H) = H, one can rewrite (11) as Let us now take the variation of S by U . We first note that for any A up to a total time derivative, where D (10) and (14), one can easily calculate δS/δU = 0 to obtain When the Schrödinger equation (6) and (13) for Λ hold, one finds that the argument of D above is simply iF . We thus have D[F ] = 0. Rewriting this, we obtain the quantum brachistochrone equation This, together with the Schrödinger equation (6) and the constraints (7), is our fundamental equation [11]. The quantum brachistochrone equation (16) seems universal, as it holds also in the case of time optimal evolution of pure [7] and mixed [12] quantum states [13]. In particular, equation (16) implies a simple conservation law, In order to solve the quantum brachistochrone equation (16), one should first eliminate the gauge freedom (8). The most natural gauge choice is to take H to be traceless, i.e., This corresponds to choosing the unitary operator U to be an element of SU (N ). Then, for a given operation U f , the procedure to find the optimal Hamiltonian H and the optimal time duration T as follows: (i) specify the functions f j (H) which constrain the range of available Hamiltonians; (ii) write down the quantum brachistochrone equation (16); (iii) solve (16) together with the constraints (7) to obtain H(t); (iv) integrate the Schrödinger equation (6) with (v) fix the constants in H(t) by imposing the condition that U (T ) equals U f modulo a global U (1), i.e., where χ is some real number.
In essence, we have reduced the problem of finding the time optimal unitary evolution, for Hamiltonians subject to certain constraints, to a set of first-order ordinary differential equations, which we call the quantum brachistochrone equation. Such an equation can always be solved in the general U (N ) case, e.g. numerically.

III. TYPICAL CLASS OF CONSTRAINTS
Let us now discuss a typical and important class of constraints. We assume that the normalization condition for H, i.e., the finite energy condition, can be written in the form where ω is a constant. Then the constraint part of the Lagrangian can be rewritten as where λ is a Lagrange multiplier and L ′ C is the sum of the other constraints. Therefore, from (12), (20) and (21) we obtain where (22) by U from the right, using the quantum brachistochrone equation (16), the Schrödinger equation (6) and (18) The system becomes particularly simple if the constraints for H are, except for the finite energy condition (20), linear and homogeneous in H, namely, if where F ′ = j λ j g j with g j ∈ su(N ), so that we have: Many problems in quantum computation or quantum control, including the example in the following section, fall into this subclass. Note that with the assumption (24) F ′ does not depend on the Hamiltonian H explicitly.
We can easily show that λ in (22) is a constant. Choosing the gauge (18), we have where the first equality follows from (16) and the second one from the constraints (20) and (25). Thus λ is a constant, which can be chosen equal to one by a simple rescaling of F . From (23), we finally get while the Hamiltonian H(t) and the Lagrange multipliers λ j (t) are determined by (16), i.e.
IV. EXAMPLE So far we have developed a general framework for finding the time optimal Hamiltonian. Let us now illustrate our method by solving some specific examples explicitly. What we consider is a physical system of two qubits represented by two spins interacting via controllable, anisotropic couplings J j (t) (j = x, y, z) and subject to local, controllable magnetic fields B a (t) (a = 1, 2) restricted to the z-direction. In other words, we choose as an example the following two-qubit Heisenberg Hamiltonian, where σ 1 j := σ j ⊗ 1, σ 2 j := 1 ⊗ σ j and σ j are the Pauli operators [14]. In the standard computational basis labeled as |00 , |01 , |10 , |11 , the Hamiltonian (29) reads where we have introduced B ± (t) := B 1 (t) ± B 2 (t) and J ± (t) := J x (t) ± J y (t). By simply reordering the basis states as |00 , |11 , |01 , |10 , the Hamiltonian can be rewritten as We assume the finite energy condition (20), i.e.
Then our problem is an example of the linear homogeneous constraints discussed in the previous section.
Namely, the form (29) of the physical Hamiltonian is guaranteed by where λ jk (t) and λ (a) j (t) are Lagrange multipliers. Our task is to solve the quantum brachistochrone equation (16), or (28). Comparing the coefficients of the generators of SU (4) on both sides, we find that the Lagrange multipliers λ xy and λ yx and the coupling J z are constants. Furthermore, the control variables B ± and J ± decouple from the others and we obtain, where B 0± , ψ ± and γ ± := λ xy ± λ yx are constants.
The final step is to fix the coefficients J z , α 0± (T ) and α ± (T ) (i.e. the constants B 0± , γ ± and ψ ± ), the time duration T and the global phase χ which realize the target (19). This is done imposing condition (19) with U (T ) expressed via (36) and (37) and U f represented by the gate that we want to implement in a time optimal way. We now demonstrate this explicitly by a few simple but interesting examples.
The swap gate: Let us assume that our target U f is the swap gate which exchanges the states of qubits 1 and 2. Solving (19) by comparison of the matrix elements of (36) and (38) and using (37), we obtain the following set of parameters: , where m, n, p and q are arbitrary integers and T is still to be determined. The zero values of B 0+ and γ − , together with (33) and (34), imply that B ± and J ± are constants and therefore, via (30), that the optimal Hamiltonian is time independent. The time optimal duration T swap can then be found by imposing the constraint (31), which reads 4ωTswap Since the Hamiltonian (39) is constant, due to (9) the time optimal evolution is along a geodesic for the metric ds 2 U .

V. CASE WITH FAST OPERATIONS
Let us now briefly discuss the quantum brachistochrone in the case where certain unitary operations have negligible time duration [19]. We assume that such operations (together with the unphysical global phase transformations) form a subgroup K of the group G = U (N ) of all the unitary operations. We denote the Lie algebras of G and K by g and k, respectively. Note that the formulation in Section II can be considered as the special case of K = U (1).
In order to measure the time duration properly, we have to generalize the projection operator P U = P 1 (AU † )U in (2) so that P 1 is the orthogonal projection to k in g, namely, where {g j } is an orthonormal basis for k. Apart from (44), the action (1) and the Lagrangian terms (2)-(4) are unchanged. Therefore, defining again H := (1 − P 1 )(H), we can repeat the same argument and obtain the same remaining equations of Section II and III. In particular, we obtain the quantum brachistochrone equation (16) and we can still follow the procedure (i)-(v) of Section II. The terms L T and L S of the Lagrangian are now invariant under the (in general non-Abelian) gauge transformation where k(t) ∈ K. Since F transforms as F → kF k † under (45), the quantum brachistochrone equation (16) is always covariant, i.e., unchanged. Furthermore, if L C is invariant under (45), the constraints are also gaugeinvariant.
One of the systems which is often discussed in quantum computation is that of n qubits in which the one-qubit operations take negligible time. This corresponds to the case G = U (2 n ) and K = U (1) ⊗ SU (2) ⊗n . Let g j be the subspace of g representing infinitesimal j-qubit operations. Namely, g j consists of linear combinations of all the operators which are products of j Pauli operators and n − j identity operators: l1···lj ; a 1 < · · · < a j and l j = x, y, z}, where a m represents the a m th qubit for m = 1, · · · , j and σ a1···aj l1···lj is a generalization of σ a j appearing in (29). For example, σ 13 xy = σ x ⊗ 1 ⊗ σ y ⊗ 1 ⊗ · · · ⊗ 1. Then we have k = g 0 ⊕ g 1 . Moreover, we can write (44) explicitly as Note that each P (j) is the orthogonal projection to g j in g.
Let us also assume that the infinitesimal operations including three or more qubits are not allowed in the Hamiltonian. This is the case of the linear homogeneous constraints discussed in Section III with and λ a1···aj l1···lj are Lagrange multipliers. By choosing the gauge H = H we have F ′ j ∈ g j , while from the constraints f j = 0 with j ≥ 3 we get H ∈ g 2 . We find that the following commutation relations of the subspaces g j of the algebra g hold: [g j , g k ] = g |j−k|+1 ⊕ g |j−k|+3 ⊕ · · · ⊕ g j+k−1 , j, k ≥ 1, where we understand that g j = 0 for j > n.
In particular, the three-qubit case, n = 3, turns out to be simple and we can carry out the procedure in Section II up to (iv) in general [19]. In fact, by (49) we have [g 2 , g 3 ] = g 2 , and since H ∈ g 2 and F ′ = F ′ 3 ∈ g 3 , the quantum brachistochrone equation (16) decouples into two equations˙ Thus we have F ′ (t) = F ′ (0) and H(t) = e iF ′ (0)t H(0)e −iF ′ (0)t , so that we can drop the time ordering in (27), and we finally obtain A similar result was recently found in another setting [20]. Although the three-qubit system is particularly simple, the prescription (v) still remains technically involved. We postpone its full analysis to a future work.

VI. SUMMARY AND DISCUSSION
We have studied the problem of finding the time optimal evolution of a unitary operator in U (N ) and the corresponding time optimal Hamiltonian within the context of a variational principle. Our main result is an explicit prescription for finding the time optimal unitary operation. Once the constraints for the available Hamiltonians are specified, the quantum brachistochrone equation can be immediately written down, and then the problem simply reduces to obtaining its solutions. Our formulation is general, systematic, and does not rely upon any restrictive assumptions, e.g., adiabaticity of quantum evolutions. We explicitly showed our methods and found the optimal Hamiltonian and the optimal time duration for three important examples of quantum gates acting on two qubits. The optimal Hamiltonians realizing the swap and qft gates are time independent and, therefore, the corresponding optimal unitary operators follow geodesic curves on the SU (4) manifold endowed with the metric ds 2 U . This is not the case for the entangler gate (as expected for generic gates) where the optimal Hamiltonian is time dependent and the time evolution of the corresponding unitary operator is not geodesic. We also discussed the quantum brachistochrone for unitary operations in the case where there are operations whose time duration is negligible.
This work is a natural extension of our previous analysis of the time optimal evolution of quantum states in the projective space. The present formulation has direct relevance to quantum computation, since it gives the optimal realization of subroutines for unknown input states, e.g. the discrete Fourier transform. On the other hand, the quantum brachistochrone for state evolution in [7] may be viewed as a quantum computation for known initial states, e.g. the transition from |00..0 to a certain entangled state [16] in Shor's factorization algorithm.
We should caution the reader that, in order to make the variational principle well defined, the action (1) should be actually expressed as an integration over a parameter with fixed initial and final values. Since this does not affect our results, we have omitted these details for simplicity. Furthermore, we note that, instead of (2), any function of iU U † and H which becomes constant upon using the Schrödinger equation would produce the same quantum brachistochrone equation (16). In this sense, the explicit expression of the metric in (2) does not affect our formulation. In a related work, the authors of [8], [9] and [17] rephrased the problem of finding efficient quantum algorithms in terms of the shortest path in a curved geometry. Their goal was to obtain a bound on the number of gates required to synthesize a given target unitary operation in terms of a cost function based on a certain metric in the space of Hamiltonians. By tailoring the form of such a metric they were able to approximate the target unitary operation by a circuit of size polynomial in the distance from the identity. On the other hand, our point of view here is that the time complexity of an algorithm is of more physical relevance than its gate complexity (see also, e.g. [3]). Furthermore, although our result does not depend on the choice of the metric on U (N ), the bi-invariant metric (5) is the most natural. Also note that the simplest isotropic constraint (20) does not provide any non-trivial bound to the gate complexity. In our framework the general relationship between time and gate complexity is still an open issue.
Another point which we would like to emphasize is that, although what we treated here for the simplicity of exposition was the case in which the constraints are expressed as equality conditions for the functions f j (H), there should be no conceptual difficulty in extending our variational methods to the more realistic case when similar constraints are given in terms of inequalities (see. e.g., [18]).
Finally, we should note that the authors of [1], by using the Pontryagin maximal principle, also showed an optimal time dependent Hamiltonian as a particular solution to an equation which is similar to our quantum brachistochrone equation. In the two-qubit demonstration of our variational methods, we have obtained a general solution for the optimal Hamiltonian without attempting to match it to a prescribed NMR experiment, which was a main concern in [1]. Our formalism also naturally allows for the treatment of the more general and physical situation in which one-qubit local controls require a nonzero time cost.