Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Gradient Ascent Pulse Engineering in Julia

License

NotificationsYou must be signed in to change notification settings

JuliaQuantumControl/GRAPE.jl

VersionStableDevJOSSBuild StatusREUSECoverage

Implementation of GRadient Ascent Pulse Engineering (GRAPE)

Installation

As usual for a registered Julia package,GRAPE can be installed by typing

] add GRAPE

in the Julia REPL.

Usage Example

A minimal working example optimizing a state-to-state transition|0⟩ → |1⟩ in a two-level quantum system:

using GRAPEusing QuantumPropagators: hamiltonian# data structure for `H = H₀ + ϵ(t) H₁`using QuantumControl.Functionals: J_T_sm# square-modulus functionalusing QuantumPropagators: ExpProp# propagation method: matrix exponentiationϵ(t)=0.2# guess pulseH=hamiltonian([10;0-1], ([01;10], ϵ))# time-dependent Hamiltonianket_0, ket_1= ComplexF64[1,0], ComplexF64[0,1]# basis states |0⟩, |1⟩tlist=collect(range(0,5, length=501));# time grid; final time T = 5.0# Optimization functionals depend on states |Ψ(T)⟩, described by a "trajectory"traj= GRAPE.Trajectory(    initial_state= ket_0,    generator= H,    target_state= ket_1);result= GRAPE.optimize(    [traj], tlist;    prop_method= ExpProp,# suitable for small systems only!    J_T= J_T_sm,#  J_T = 1 - |⟨Ψ(T)|1⟩|²# without convergence check, stop after 5000 iterations    check_convergence=(res-> ((res.J_T<1e-3)&&"J_T < 10⁻³")),)ϵ_opt= result.optimized_controls[1]# Or, using the QuantumControl API (recommended)using QuantumControl: ControlProblem, optimize,@optimize_or_loadproblem=ControlProblem(    [traj], tlist,    prop_method= ExpProp,    J_T= J_T_sm,    check_convergence=(res-> ((res.J_T<1e-3)&&"J_T < 10⁻³")),)result=optimize(problem; method=GRAPE)# This dumps the optimization result in `tls_opt.jld2`result=@optimize_or_load("tls_opt.jld2", problem; method= GRAPE)

See theTutorial andUsage section in the documentation for more details.

Documentation

The documentation ofGRAPE.jl is available athttps://juliaquantumcontrol.github.io/GRAPE.jl.

Contributing

SeeCONTRIBUTING.md and theorganization development notes.

History

See theCHANGELOG.md and theRelease Notes.

Citing

If you are using this software please cite it as (bib):

  • M. H. Goerz, S. C. Carrasco, A. Marshall, and V. S. Malinovsky,GRAPE.jl: Gradient Ascent Pulse Engineeringin Julia, J. Open Source Softw.10, 8813 (2025).

License

The source code of this project is licensed under theMIT License. The documentation is licensed underCreative Commons (CC-BY-4.0). License information for all files isautomatically tracked according toREUSE and can be verified using thereuse tool, e.g., by runningreuse spdx.

About

Gradient Ascent Pulse Engineering in Julia

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors6


[8]ページ先頭

©2009-2025 Movatter.jp