Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

arXiv:2511.01217 · The Journal of Open Source Software

GRAPE.jl: Gradient Ascent Pulse Engineering in Julia

Michael H. Goerz, Sebastián C. Carrasco, Alastair Marshall, Vladimir S. Malinovsky

quant-phSubmitted Nov 3, 2025• Announced Nov 4, 2025• 1 citation
arXivHTMLPDF

Abstract

The GRAPE$.$jl package (https://github.com/JuliaQuantumControl/GRAPE.jl) implements Gradient Ascent Pulse Engineering, a widely used method of quantum optimal control. Its purpose is to find controls that steer a quantum system in a particular way. This is a prerequisite for next-generation quantum technology, such as quantum computing or quantum sensing. GRAPE$.$jl exploits the unique strengths of the Julia programming language to achieve both flexibility and numerical performance. It builds on the QuantumControl$.$jl framework.

Journal reference
J. Open Source Softw. 10, 8813 (2025)
DOI
10.21105/joss.08813

Related papers

Accelerating quantum optimal control through iterative gradient-ascent pulse engineering

Yuquan Chen, Yajie Hao, Ze Wu +6 more

Quantum optimal control, a powerful toolbox for engineering an optimal control field modulation that most precisely implements a desired quantum operation in the best way possible, has evolved into one of the cornerstones for enabling quantum technologies. The gradient ascent pulse engineering (GRAPE) algorithm is a widely used method in quantum optimal control, which has achieved great success in different physical platforms. However, its computational complexity increases exponentially with the number of qubits, making it challenging to be implemented for large-scale quantum systems. To mitigate this issue, we present the iterative GRAPE algorithm (iGRAPE), which reduces the optimization problem into a series of lower-dimensional subproblems by incorporating disentanglement operations. Our numerical simulations on physical platforms such as nuclear magnetic resonance and superconducting quantum systems demonstrate that iGRAPE significantly enhances state preparation speed. Specifically, compared to GRAPE, iGRAPE achieves up to a five-fold acceleration in preparing Greenberger--Horne--Zeilinger states using a 12-qubit implementation, and up to a 13-fold acceleration for arbitrary state preparation with eight qubits. To further validate our findings, we conduct experimental validation of iGRAPE on a four-qubit nuclear magnetic resonance system. Overall, iGRAPE offers an efficient solution for implementing optimal control in large-scale quantum systems, holding great potential for advancing quantum technologies during the noisy intermediate-scale quantum era.

arXiv:2212.02806•Physical Review A•Nov 7, 2023•15 citations

Gradient-Ascent Pulse Engineering with Feedback

Riccardo Porotti, Vittorio Peano, Florian Marquardt

Efficient approaches to quantum control and feedback are essential for quantum technologies, from sensing to quantum computation.Open-loop control tasks have been successfully solved using optimization techniques, including methods such as gradient-ascent pulse engineering (GRAPE) , relying on a differentiable model of the quantum dynamics.For feedback tasks, such methods are not directly applicable, since the aim is to discover strategies conditioned on measurement outcomes.In this work, we introduce feedback GRAPE, which borrows some concepts from model-free reinforcement learning to incorporate the response to strong stochastic (discrete or continuous) measurements, while still performing direct gradient ascent through the quantum dynamics.We illustrate its power considering various scenarios based on cavity-QED setups.Our method yields interpretable feedback strategies for state preparation and stabilization in the presence of noise.Our approach could be employed for discovering strategies in a wide range of feedback tasks, from calibration of multiqubit devices to linear-optics quantum computation strategies, quantum enhanced sensing with adaptive measurements, and quantum error correction.

arXiv:2203.04271•PRX Quantum•Jul 13, 2023•49 citations

Quantum Optimal Control via Semi-Automatic Differentiation

Michael H. Goerz, Sebastian Camilo Carrasco, Vladimir S. Malinovsky

We develop a framework of "semi-automatic differentiation" that combines existing gradient-based methods of quantum optimal control with automatic differentiation. The approach allows to optimize practically any computable functional and is implemented in two open source Julia packages, GRAPE.jl and Krotov.jl , part of the QuantumControl.jl framework. Our method is based on formally rewriting the optimization functional in terms of propagated states, overlaps with target states, or quantum gates. An analytical application of the chain rule then allows to separate the time propagation and the evaluation of the functional when calculating the gradient. The former can be evaluated with great efficiency via a modified GRAPE scheme. The latter is evaluated with automatic differentiation, but with a profoundly reduced complexity compared to the time propagation. Thus, our approach eliminates the prohibitive memory and runtime overhead normally associated with automatic differentiation and facilitates further advancement in quantum control by enabling the direct optimization of non-analytic functionals for quantum information and quantum metrology, especially in open quantum systems. We illustrate and benchmark the use of semi-automatic differentiation for the optimization of perfectly entangling quantum gates on superconducting qubits coupled via a shared transmission line. This includes the first direct optimization of the non-analytic gate concurrence.

arXiv:2205.15044•Quantum•Dec 7, 2022•37 citations

Instrumental distortions in quantum optimal control

Uluk Rasulov, Ilya Kuprov

Quantum optimal control methods, such as gradient ascent pulse engineering (GRAPE), are used for precise manipulation of quantum states. Many of those methods were pioneered in magnetic resonance spectroscopy, where instrumental distortions are often negligible. However, that is not the case elsewhere: the usual jumble of cables, resonators, modulators, splitters, amplifiers, and filters can and would distort control signals. Those distortions may be non-linear; their inverse functions may be ill-defined and unstable; they may even vary from one day to the next and across the sample. Here we introduce the response-aware gradient ascent pulse engineering framework, which accounts for any cascade of differentiable distortions within the GRAPE optimization loop, does not require filter function inversion, and produces control sequences that are resilient to user-specified distortion cascades with user-specified parameter ensembles. The framework is implemented into the optimal control module supplied with versions 2.10 and later of the open-source Spinach library; the user needs to provide function handles returning the actions by the distortions and, optionally, parameter ensembles for those actions.

arXiv:2502.02198•The Journal of Chemical Physics•Apr 25, 2025•10 citations

Gradient ascent pulse engineering (GRAPE)–a primer on quality functions and pulse shape penalties

Armin J. Römer, Josef Granwehr, S. Kocher

Quantum optimal control is a versatile, powerful method to tailor quantum experiments. In NMR, numerical quantum optimal control algorithms such as the gradient ascent pulse engineering (GRAPE) algorithm have sparked many developments in pulse shaping, pushing the limits of pulse selectivity and robustness. To provide an overview of its core principles and the many expansions it has undergone ever since its introduction, the most common quality functions are benchmarked in their ability to guide the spin state transfer for facilitating excitation, inversion, and maximum quantum coherence. Explicit derivations of gradient and Hessian formulas are given, both summarizing what is known from the literature and complementing it. The derivations also give due consideration to the fact that spin states can be represented as density operators or spin operators. Analogously, the most common penalties to guide optimization toward experimentally feasible controls are discussed along with their explicit gradient and Hessian formula derivations. The discussion is complemented by thorough benchmarking for the most commonly used optimization algorithms.

•Nov 11, 2026•0 citations

GRAPE optimization for open quantum systems with time-dependent decoherence rates driven by coherent and incoherent controls

Vadim N. Petruhanov, Alexander Nikolaevich Pechen

Abstract The GRadient Ascent Pulse Engineering (GRAPE) method is widely used for optimization in quantum control. GRAPE is gradient search method based on exact expressions for gradient of the control objective. It has been applied to various coherently controlled closed and open quantum systems. In this work, we adopt the GRAPE method for optimizing objective functionals in open quantum systems driven by both coherent and incoherent controls. In our case, a tailored or engineered environment acts on the controlled system as control via time-dependent decoherence rates γ i ( t ) or, equivalently, via spectral density n ω ( t ) of the environment . To develop the GRAPE approach for this problem, we compute gradient of various objectives for general N -level open quantum systems for the piecewise constant class of control. The case of a single qubit is considered in details and solved analytically. For this case, an explicit analytical expression for evolution and objective gradient is obtained via diagonalization of a 3 × 3 matrix determining the system’s dynamics in the Bloch ball. The diagonalization is obtained by solving a cubic equation via Cardano’s method. The efficiency of the algorithm is demonstrated through numerical simulations for the state-to-state transition problem and its complexity is estimated. Robustness of the optimal controls is also studied.

arXiv:2307.08479•Journal of Physics A Mathematical and Theoretical•Jul 11, 2023•42 citations
The GRAPE...jl package (https://github.com/JuliaQuantumControl/GRAPE.jl) implements Gradient Ascent Pulse Engineering, a widely used method of quantum optimal control. Its purpose is to find controls that steer a quantum system in a particular way. This is a prerequisite for next-generation quantum technology, such as quantum computing or quantum sensing. GRAPE...jl exploits the unique strengths of the Julia programming language to achieve both flexibility and numerical performance. It builds on the QuantumControl...jl framework.
Quantum optimal control, a powerful toolbox for engineering an optimal control field modulation that most precisely implements a desired quantum operation in the best way possible, has evolved into one of the cornerstones for enabling quantum technologies. The gradient ascent pulse engineering (GRAPE) algorithm is a widely used method in quantum optimal control, which has achieved great success in different physical platforms. However, its computational complexity increases exponentially with the number of qubits, making it challenging to be implemented for large-scale quantum systems. To mitigate this issue, we present the iterative GRAPE algorithm (iGRAPE), which reduces the optimization problem into a series of lower-dimensional subproblems by incorporating disentanglement operations. Our numerical simulations on physical platforms such as nuclear magnetic resonance and superconducting quantum systems demonstrate that iGRAPE significantly enhances state preparation speed. Specifically, compared to GRAPE, iGRAPE achieves up to a five-fold acceleration in preparing Greenberger--Horne--Zeilinger states using a 12-qubit implementation, and up to a 13-fold acceleration for arbitrary state preparation with eight qubits. To further validate our findings, we conduct experimental validation of iGRAPE on a four-qubit nuclear magnetic resonance system. Overall, iGRAPE offers an efficient solution for implementing optimal control in large-scale quantum systems, holding great potential for advancing quantum technologies during the noisy intermediate-scale quantum era.
Efficient approaches to quantum control and feedback are essential for quantum technologies, from sensing to quantum computation.Open-loop control tasks have been successfully solved using optimization techniques, including methods such as gradient-ascent pulse engineering (GRAPE) , relying on a differentiable model of the quantum dynamics.For feedback tasks, such methods are not directly applicable, since the aim is to discover strategies conditioned on measurement outcomes.In this work, we introduce feedback GRAPE, which borrows some concepts from model-free reinforcement learning to incorporate the response to strong stochastic (discrete or continuous) measurements, while still performing direct gradient ascent through the quantum dynamics.We illustrate its power considering various scenarios based on cavity-QED setups.Our method yields interpretable feedback strategies for state preparation and stabilization in the presence of noise.Our approach could be employed for discovering strategies in a wide range of feedback tasks, from calibration of multiqubit devices to linear-optics quantum computation strategies, quantum enhanced sensing with adaptive measurements, and quantum error correction.
We develop a framework of "semi-automatic differentiation" that combines existing gradient-based methods of quantum optimal control with automatic differentiation. The approach allows to optimize practically any computable functional and is implemented in two open source Julia packages, GRAPE.jl and Krotov.jl , part of the QuantumControl.jl framework. Our method is based on formally rewriting the optimization functional in terms of propagated states, overlaps with target states, or quantum gates. An analytical application of the chain rule then allows to separate the time propagation and the evaluation of the functional when calculating the gradient. The former can be evaluated with great efficiency via a modified GRAPE scheme. The latter is evaluated with automatic differentiation, but with a profoundly reduced complexity compared to the time propagation. Thus, our approach eliminates the prohibitive memory and runtime overhead normally associated with automatic differentiation and facilitates further advancement in quantum control by enabling the direct optimization of non-analytic functionals for quantum information and quantum metrology, especially in open quantum systems. We illustrate and benchmark the use of semi-automatic differentiation for the optimization of perfectly entangling quantum gates on superconducting qubits coupled via a shared transmission line. This includes the first direct optimization of the non-analytic gate concurrence.
Quantum optimal control methods, such as gradient ascent pulse engineering (GRAPE), are used for precise manipulation of quantum states. Many of those methods were pioneered in magnetic resonance spectroscopy, where instrumental distortions are often negligible. However, that is not the case elsewhere: the usual jumble of cables, resonators, modulators, splitters, amplifiers, and filters can and would distort control signals. Those distortions may be non-linear; their inverse functions may be ill-defined and unstable; they may even vary from one day to the next and across the sample. Here we introduce the response-aware gradient ascent pulse engineering framework, which accounts for any cascade of differentiable distortions within the GRAPE optimization loop, does not require filter function inversion, and produces control sequences that are resilient to user-specified distortion cascades with user-specified parameter ensembles. The framework is implemented into the optimal control module supplied with versions 2.10 and later of the open-source Spinach library; the user needs to provide function handles returning the actions by the distortions and, optionally, parameter ensembles for those actions.
Quantum optimal control is a versatile, powerful method to tailor quantum experiments. In NMR, numerical quantum optimal control algorithms such as the gradient ascent pulse engineering (GRAPE) algorithm have sparked many developments in pulse shaping, pushing the limits of pulse selectivity and robustness. To provide an overview of its core principles and the many expansions it has undergone ever since its introduction, the most common quality functions are benchmarked in their ability to guide the spin state transfer for facilitating excitation, inversion, and maximum quantum coherence. Explicit derivations of gradient and Hessian formulas are given, both summarizing what is known from the literature and complementing it. The derivations also give due consideration to the fact that spin states can be represented as density operators or spin operators. Analogously, the most common penalties to guide optimization toward experimentally feasible controls are discussed along with their explicit gradient and Hessian formula derivations. The discussion is complemented by thorough benchmarking for the most commonly used optimization algorithms.
Abstract The GRadient Ascent Pulse Engineering (GRAPE) method is widely used for optimization in quantum control. GRAPE is gradient search method based on exact expressions for gradient of the control objective. It has been applied to various coherently controlled closed and open quantum systems. In this work, we adopt the GRAPE method for optimizing objective functionals in open quantum systems driven by both coherent and incoherent controls. In our case, a tailored or engineered environment acts on the controlled system as control via time-dependent decoherence rates γ i ( t ) or, equivalently, via spectral density n ω ( t ) of the environment . To develop the GRAPE approach for this problem, we compute gradient of various objectives for general N -level open quantum systems for the piecewise constant class of control. The case of a single qubit is considered in details and solved analytically. For this case, an explicit analytical expression for evolution and objective gradient is obtained via diagonalization of a 3 × 3 matrix determining the system’s dynamics in the Bloch ball. The diagonalization is obtained by solving a cubic equation via Cardano’s method. The efficiency of the algorithm is demonstrated through numerical simulations for the state-to-state transition problem and its complexity is estimated. Robustness of the optimal controls is also studied.