Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to external examples #37

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ jobs:
version: '1'
arch: x64
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: julia-actions/cache@v1
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- run: |
# Instantiate Pkg
wget https://raw.githubusercontent.com/JuliaQuantumControl/JuliaQuantumControl/master/scripts/installorg.jl
Expand All @@ -49,7 +49,8 @@ jobs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: julia-actions/cache@v1
- uses: julia-actions/setup-julia@v1
with:
version: '1'
Expand Down Expand Up @@ -90,7 +91,7 @@ jobs:
name: Codestyle
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1'
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Michael Goerz <[email protected]> and contributors
Copyright (c) 2024 Michael Goerz <[email protected]> and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 0 additions & 1 deletion docs/data/.gitignore

This file was deleted.

36 changes: 0 additions & 36 deletions docs/generate.jl

This file was deleted.

51 changes: 29 additions & 22 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using QuantumControlBase
using QuantumPropagators
using Krotov
using Documenter
using DocumenterCitations
Expand All @@ -9,25 +10,44 @@ using Plots
gr()
ENV["GKSwstype"] = "100"

include(joinpath("..", "test", "download_dumps.jl"))

# Generate examples
include("generate.jl")

DocMeta.setdocmeta!(Krotov, :DocTestSetup, :(using Krotov); recursive=true)

PROJECT_TOML = Pkg.TOML.parsefile(joinpath(@__DIR__, "..", "Project.toml"))
VERSION = PROJECT_TOML["version"]
NAME = PROJECT_TOML["name"]
AUTHORS = join(PROJECT_TOML["authors"], ", ") * " and contributors"
GITHUB = "https://github.com/JuliaQuantumControl/Krotov.jl"

DEV_OR_STABLE = "stable/"
if endswith(VERSION, "dev")
DEV_OR_STABLE = "dev/"
end

links = InterLinks(
"TimerOutputs" => (
"https://github.com/KristofferC/TimerOutputs.jl",
joinpath(@__DIR__, "src", "inventories", "TimerOutputs.toml")
),
"QuantumPropagators" => "https://juliaquantumcontrol.github.io/QuantumPropagators.jl/$DEV_OR_STABLE",
"QuantumControl" => "https://juliaquantumcontrol.github.io/QuantumControl.jl/$DEV_OR_STABLE",
"GRAPE" => "https://juliaquantumcontrol.github.io/GRAPE.jl/$DEV_OR_STABLE",
"Examples" => "https://juliaquantumcontrol.github.io/QuantumControlExamples.jl/$DEV_OR_STABLE",
)

println("Starting makedocs")

bib = CitationBibliography(joinpath(@__DIR__, "src", "refs.bib"); style=:numeric)

PAGES = [
"Home" => "index.md",
"Overview" => "overview.md",
"Examples" => "examples.md",
"API" => "api.md",
"References" => "references.md",
hide("externals.md"),
]

makedocs(;
plugins=[bib],
plugins=[bib, links],
modules=[Krotov],
authors=AUTHORS,
sitename="Krotov.jl",
Expand All @@ -43,27 +63,14 @@ makedocs(;
"https://juliaquantumcontrol.github.io/QuantumControl.jl/dev/assets/topbar/topbar.js"
),
],
size_threshold_ignore=["externals.md"],
mathengine=KaTeX(),
footer="[$NAME.jl]($GITHUB) v$VERSION docs powered by [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl).",
),
pages=[
"Home" => "index.md",
"Overview" => "overview.md",
"Examples" => [
"List of Examples" => "examples/index.md",
"Example 1 (TLS)" => "examples/simple_state_to_state.md",
"Example 2 (Diss. Gate)" => "examples/rho_3states.md",
"Example 3 (Parametrization)" => "examples/state_to_state_parametrizations.md",
"Example 4 (PE)" => "examples/perfect_entanglers.md",
],
"API" => "api.md",
"References" => "references.md",
],
pages=PAGES,
warnonly=true,
)

println("Finished makedocs")

rm(joinpath(@__DIR__, "build", "examples", ".gitignore"))

deploydocs(; repo="github.com/JuliaQuantumControl/Krotov.jl", devbranch="master")
1 change: 1 addition & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# API

```@index
Pages = ["api.md"]
```

```@autodocs
Expand Down
7 changes: 7 additions & 0 deletions docs/src/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Examples

The following examples illustrate the use of Krotov's method:

* Example: [Entangling quantum gates for coupled transmon qubits](@extref Examples). Written for [GRAPE](@extref GRAPE :doc:`index`), but could use Krotov's method interchangeably.
* Example: [Optimization of a Dissipative Quantum Gate](@extref Examples)
* Tutorial: [Pulse Parametrization for Krotov's Method](@extref Examples)
4 changes: 0 additions & 4 deletions docs/src/examples/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions docs/src/examples/index.md

This file was deleted.

39 changes: 39 additions & 0 deletions docs/src/externals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
```@autodocs
Modules = [QuantumControlBase]
```

```@autodocs
Modules = [QuantumPropagators]
```

```@autodocs
Modules = [QuantumPropagators.Generators]
```

```@autodocs
Modules = [QuantumPropagators.Arnoldi]
```

```@autodocs
Modules = [QuantumPropagators.Interfaces]
```

```@autodocs
Modules = [QuantumPropagators.Controls]
```

```@autodocs
Modules = [QuantumPropagators.Storage]
```

```@autodocs
Modules = [QuantumPropagators.SpectralRange]
```

```@autodocs
Modules = [QuantumPropagators.Newton]
```

```@autodocs
Modules = [QuantumPropagators.Cheby]
```
38 changes: 3 additions & 35 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ version_badge = "![v$VERSION](https://img.shields.io/badge/version-v$VERSION-gre
Markdown.parse("$github_badge $version_badge")
```

Implementation of [Krotov's method of optimal control](https://arxiv.org/abs/1008.5126) enhanced with automatic differentiation.
Implementation of Krotov's method of optimal control [Krotov1996,SomloiCP1993,BartanaJCP1997,PalaoPRA2003,ReichJCP2012,GoerzSPP2019](@cite) enhanced with automatic differentiation [GoerzQ2022](@cite).

Part of [`QuantumControl.jl`](https://github.com/JuliaQuantumControl/QuantumControl.jl#readme) and the [JuliaQuantumControl](https://github.com/JuliaQuantumControl) organization.

Expand All @@ -26,44 +26,12 @@ Part of [`QuantumControl.jl`](https://github.com/JuliaQuantumControl/QuantumCont

## Contents

### Overview

```@contents
Pages = [
"overview.md",
]
Depth = 1
Depth = 2
Pages = [pair[2] for pair in Main.PAGES[2:end-1]]
```

### Examples

```@contents
Pages = [
"examples/simple_state_to_state.md",
"examples/rho_3states.md",
"examples/state_to_state_parametrizations.md",
"examples/perfect_entanglers.md",
]
Depth = 1
```

See also the [general examples](https://juliaquantumcontrol.github.io/QuantumControl.jl/stable/examples/) of the [QuantumControl](https://juliaquantumcontrol.github.io/QuantumControl.jl/stable/) package.


### API

```@contents
Pages = [
"api.md",
]
Depth = 1
```

## History

See the [Releases](https://github.com/JuliaQuantumControl/Krotov.jl/releases) on Github.

## References

```@bibliography
```
84 changes: 84 additions & 0 deletions docs/src/inventories/TimerOutputs.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[Inventory]
format = "DocInventories v0"
project = "TimerOutputs.jl"
version = "0.5.23"

[[std.doc]]
name = "readme"
uri = ""
dispname = "TimerOutputs"

[[std.label]]
name = "timeroutputs"
uri = "#$"
dispname = "TimerOutputs"
[[std.label]]
name = "example-output"
uri = "#$"
dispname = "Example output"
[[std.label]]
name = "usage"
uri = "#$"
dispname = "Usage"
[[std.label]]
name = "settings-for-printing"
uri = "#$"
dispname = "Settings for printing"
[[std.label]]
name = "flattening"
uri = "#$"
dispname = "Flattening"
[[std.label]]
name = "merging"
uri = "#$"
dispname = "Merging"
[[std.label]]
name = "resetting"
uri = "#$"
dispname = "Resetting"
[[std.label]]
name = "indexing-into-a-table"
uri = "#$"
dispname = "Indexing into a table"
[[std.label]]
name = "querying-data"
uri = "#$"
dispname = "Querying data"
[[std.label]]
name = "default-timer"
uri = "#$"
dispname = "Default Timer"
[[std.label]]
name = "measuring-time-consumed-outside-timeit-blocks"
uri = "#$"
dispname = "Measuring time consumed outside @timeit blocks"
[[std.label]]
name = "shared-timers"
uri = "#$"
dispname = "Shared Timers"
[[std.label]]
name = "serialization"
uri = "#$"
dispname = "Serialization"
[[std.label]]
name = "overhead"
uri = "#$"
dispname = "Overhead"
[[std.label]]
name = "author"
uri = "#$"
dispname = "Autor"
[[std.label]]
name = "acknowledgments"
uri = "#$"
dispname = "Acknowledgments"

[[jl.type]]
name = "TimerOutputs.TimerOutput"
uri = "#usage"
[[jl.function]]
name = "TimerOutputs.print_timer"
uri = "#settings-for-printing"
[[jl.function]]
name = "TimerOutputs.reset_timer!"
uri = "#resetting"
Loading
Loading