Giter Club home page Giter Club logo

quantumcontrol.jl's Introduction

JuliaQuantumControl Dev Environment

The packages within the JuliaQuantumControl organization are tightly coupled. Development on any package should happen in conjunction with all other packages.

When developing on a Unix system (WSL is recommended on Windows), you should use this repository to set up a development environment:

git clone [email protected]:JuliaQuantumControl/JuliaQuantumControl.git
cd JuliaQuantumControl
make clone

This will clone all the active project repos within the JuliaQuantumControl organization into a subfolder of JuliaQuantumControl. You may then navigate into any of the project folders for development, e.g.

cd QuantumControlBase.jl
make test
make devrepl

The Makefile for each project is set up such that testing happens automatically against the current state of all sibling folders (the entire organization). Run just make within each project for available make-targets.

Org-level Makefile

You may also perform some development tasks across the entire organization by using make within the parent JuliaQuantumControl folder. E.g.,

make pull

will pull the current state of all org projects from Github,

make status

will show the state of all checkouts, and

make distclean testall

will run a complete set of tests for the entire organization.

You can also run

make devrepl

for a Julia REPL with the dev-version of all projects available. Note that this is in addition to the development REPL available for each individual project (make devrepl in the project folder), which also has access to the sibling projects.

Making Releases

If releases need to be made for multiple packages across the organization, they must be made in the order listed in the package table

For each package, for a release X.Y.Z, e.g. 1.0.0, do the following from the master branch:

  • git checkout -b release-1.0.0
  • Modify Project.toml to bump to the new version number, set compat for all dependencies in the JuliaQuantumControl org to the latest release (removing any >= specification)
  • Make a commit with message "Release 1.0.0"
  • git push -u origin release-1.0.0
  • Create a pull request
  • Apply the "no changelog" label
  • Wait for continuous integration to finish
  • Go to the main Github profile for the package
  • Select the release-1.0.0 branch in the top left
  • Click on the commit ID of the release commit in the table title row
  • Comment @JuliaRegistrator register on the commit
  • Wait for JuliaRegistrator and Tagbot to make and tag a release, wait for all CI to finish
  • In the terminal, switch to the master branch
  • git merge --no-ff --no-commit release-1.0.0
  • Edit Project.toml to append +dev to the version number (e.g., 1.0.0+dev), prepend >= to the compat specification of all dependencies in the JuliaQuantumControl organization.
  • git commit to make a merge commit, use "Bump version to 1.0.0+dev" as the commit message
  • git push to push the master

The QuantumControlRegistry

Working with unregistered packages in Julia is tricky.. Therefore, we have a QuantumControlRegistry to register any packages within the JuliaQuantumControl organization that should not be or are not ready yet for the Julia General Registry. Packages must be registered either in QuantumControlRegistry or in General: when a package gets added to General, it should be removed from QuantumControlRegistry.

To add the QuantumControlRegistry to your julia installation, run

pkg> registry add https://github.com/JuliaQuantumControl/QuantumControlRegistry.git

To add packages to QuantumControlRegistry, or create new releases for previously added packages, use the LocalRegistry.register command in the org-level REPL (make devrepl), e.g.,

using LocalRegistry
register("./GRAPELinesearchAnalysis.jl/", registry="QuantumControlRegistry")

See

help?> register

or the LocalRegistry documentation for details.

quantumcontrol.jl's People

Contributors

goerz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

quantumcontrol.jl's Issues

Simple example of optimization with dissipation.

@goerz I want to find ε1(t), but I am not understanding how to fit the examples to the following Hamiltonian:

H(t) = H0 + ε1(t)H1,

d/dt ρ(t) = -i[H(t), ρ(t)] + L ρ(t) L† - 0.5 L†L ρ(t) - 0.5 ρ(t) L†L

Where H0, H1, L are time independents. Do you or anyone else have any examples?

State-dependent running costs

In the article published on Quantum state-dependent running costs are taken into account. How can this be done using this (collection of) package?

:TDSE or :LvN?

Hi Goerz. When I solve a Liouville equation with dissipation, I use the convention :TDSE in liouvillian(H, c_ops; convention=:TDSE). Why can't I use the :LvN option? When I do, it doesn't seem to work. I have already done today's update.

How to use LockedAmplitude?

I noticed that there are ShapedAmplitude and LockedAmplitude described in the documentation. I happen to calculate a optimization problem in which there is one time-dependent parameter that I don't want to optimize. So I defined this parameter as

shape(t) = blackman(t, TimeList[1], TimeList[end]) * Omega
OmegaAmp = LockedAmplitude(shape, TimeList)

And I have another time-dependent parameter to be optimized

shape(t) = -cos(2pi * t / FinalTime) * 0.2 + 0.3
DeltaAmp = ShapedAmplitude(t -> Delta, TimeList; shape=shape)

The I throw them into the Hamiltonian which is

hamiltonian(HStatic, (HOmega, Omega), (HDelta, Delta))

When I defined the problem, there is a warning says that

┌ Warning: Collected amplitudes are of disparate types
└ @ QuantumPropagators.Generators C:\Users\mrs504aa\.julia\packages\QuantumPropagators\Ndzht\src\generators.jl:388

And when I run the optimization, an error message shows up

┌ Error: `get_control_derivs(generator, controls)` must be defined.
│   exception =
│    type LockedPulseAmplitude has no field control
│    Stacktrace:
│     [1] getproperty
│       @ .\Base.jl:37 [inlined]
│     [2] get_control_deriv(ampl::QuantumPropagators.Amplitudes.LockedPulseAmplitude, control::Vector{Float64})
│       @ QuantumControlBase C:\Users\mrs504aa\.julia\packages\QuantumControlBase\WEAnn\src\derivs.jl:101
│     [3] get_control_deriv(generator::QuantumPropagators.Generators.Generator{Matrix{ComplexF64}, Any}, control::Vector{Float64})
│       @ QuantumControlBase C:\Users\mrs504aa\.julia\packages\QuantumControlBase\WEAnn\src\derivs.jl:61
│     [4] get_control_derivs(generator::QuantumPropagators.Generators.Generator{Matrix{ComplexF64}, Any}, controls::Tuple{Vector{Float64}})
│       @ QuantumControlBase C:\Users\mrs504aa\.julia\packages\QuantumControlBase\WEAnn\src\derivs.jl:20
│     [5] check_generator(generator::QuantumPropagators.Generators.Generator{Matrix{ComplexF64}, Any}; state::Vector{ComplexF64}, tlist::Vector{Float64}, for_mutable_state::Bool, for_immutable_state::Bool, for_expval::Bool, for_gradient_optimization::Bool, atol::Float64, quiet::Bool, _message_prefix::String)
│       @ QuantumControlBase C:\Users\mrs504aa\.julia\packages\QuantumControlBase\WEAnn\src\check_generator.jl:75
└ @ QuantumControlBase C:\Users\mrs504aa\.julia\packages\QuantumControlBase\WEAnn\src\check_generator.jl:90

My question is that did I mis-understand the usage of LockedAmplitude?
Is there any way to put in a time-dependent parameter which should not be optimized?

`ParametrizedAmplitude` cannot be instantiated without shape

julia> using QuantumControl.PulseParametrizations: SquareParametrization, ParametrizedAmplitude
julia> a = ParametrizedAmplitude(t->1.0; parametrization=SquareParametrization())
ERROR: A ParametrizedAmplitude control must either be a vector of values or a callable

The cause is a typo in the code (control being confused with shape)

Releases

This is an ongoing issue to trigger package registration

Objectives penalizing e.g. the amplitude of the pulse

Hello, I have been really enjoying this package! I have what is probably a quick question. In addition to Objectives that ensure that the initial states reach the target states, I'd also like to use objectives that penalize the amplitude of the pulse, or penalize deviations of the pulse from zero amplitude at the beginning or the end, etc. I didn't see an example of such an Objective in your examples, and it wasn't immediately obvious to me how it would be implemented (fwiw I'm more interested in GRAPE than Krotov). Thanks!

How to set individual bounds for a GRAPE optimization problem

Hi, I'm working on an quantum gate optimization problem and I found this package very useful to me.

Now I have a problem with the constraints for the control sequences. In the document I noticed that one needs to work with pulse_options to set the boundary. However, there is no explanation about the type or how to assign values to upper_bounds properly.

More precisely, I have a Hamiltonian which is hamiltonian(Hamiltonian0, (HamiltonianDelta, DeltaAt), (HamiltonianOmega, OmegaAt)) in my codes.
I want to know how to set boundaries for control sequence DeltaAt and OmegaAt by passing values into optimize function or ControlProblem function. (I don't need global bounds and I want to set individual bounds for each sequence)

Optimizer options interface

Hey,

I would like to solve some quantum control problems via GRAPE but I need high precision with regard to stationarity. Unfortunately, I can't use Optim.jl because I have bounds on the control drives and it seems I am also not able to strengthen the convergence criteria in the L-BFGS-B default flexibly enough. I think that is the case at least? The GrapeResult object does not carry gradient information so I assume cannot use that to define my own convergence criterion and the corresponding LBFGSB.jl optionpgtol = 1e-5 appears to be hardcoded (see https://github.com/JuliaQuantumControl/GRAPE.jl/blob/83295ce48621430db739ce2cdee4afba5b9ee41e/src/backend_lbfgsb.jl#L8).

Am I missing a way to set the convergence criterion? If not, what's the better way to address that issue? Support bounds for Optim.jl optimizers, pass gradient information to the result object, or admit kwargs to set options for the default optimizer?

Thanks!
Flemming

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Can't Install Quantum Control Package

Hello,
I simply tried the following:
1)Press ]
2) add Quantum Control and I got the following error:
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package QuantumControl [8a270532]:
QuantumControl [8a270532] log:
├─possible versions are: [0.0.1-0.0.4, 0.1.0, 0.2.0] or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions [0.0.1-0.0.4, 0.1.0, 0.2.0]
└─restricted by julia compatibility requirements to versions: uninstalled — no versions left

My julia version is 1.4
I also tried the following method:
1)using Pkg
2)Pkg.add("QuantumControl")

How can I install QuantumControl package?
Thanks,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.