We present a general framework for finding the time-optimal evolution and the optimal Hamiltonian for a quantum system with a given set of initial and final states. Our formulation is based on the variational principle and is analogous to that for the brachistochrone in classical mechanics. We reduce the problem to a formal equation for the Hamiltonian which depends on certain constraint functions specifying the range of available Hamiltonians. For some simple examples of the constraints, we explicitly find the optimal solutions.PACS numbers: 03.67.Lx, 03.65.Ca, 02.30.Xx, 02.30.Yy In quantum mechanics one can change a given state to another by applying a suitable Hamiltonian on the system. In many situations, e.g. quantum computation, it is desirable to know the pathway in the shortest time.In this paper we consider the problem of finding the time-optimal path for the evolution of a pure quantum state and the optimal driving Hamiltonian. Recently, a growing number of works related to this topic have appeared. For instance, Alvarez and Gómez [1] showed that the quantum state in Grover's algorithm [2], known as the optimal quantum search algorithm [3], actually follows a geodesic curve derived from the Fubini-Study metric in the projective space. Khaneja et al. [4] and Zhang et al.[5], using a Cartan decomposition scheme for unitary operations, discussed the time optimal way to realize a two-qubit universal unitary gate under the condition that one-qubit operations can be performed in an arbitrarily short time. On the other hand, Tanimura et al. [6] gave an adiabatic solution to the optimal control problem in holonomic quantum computation, in which a desired unitary gate is generated as the holonomy corresponding to the minimal length loop in the space of control parameters for the Hamiltonian. Schulte-Herbrüggen et al.[7] exploited the differential geometry of the projective unitary group to give the tightest known upper bounds on the actual time complexity of some basic modules of quantum algorithms. More recently, Nielsen [8] introduced a lower bound on the size of the quantum circuit necessary to realize a given unitary operator based on the geodesic distance, with a suitable metric, between the unitary and the identity operators. However, a general method for generating the time optimal Hamiltonian evolution of quantum states was not known until now.Here we are going to study this problem by exploiting the analogy with the so-called brachistochrone problem in classical mechanics and the elementary properties * Electronic address: carlini@th.phys.titech.ac.jp † Electronic address: ahosoya@th.phys.titech.ac.jp ‡ Electronic address: koike@phys.keio.ac.jp § Electronic address: okudaira@th.phys.titech.ac.jp of quantum mechanics. In ordinary quantum mechanics the initial state and the Hamiltonian of a physical system are given and one has to find the final state using the Schrödinger equation. In our work we generalize this framework so as to optimize a certain cost functional with respect to the Hamiltonian a...