Skip to content

Commit

Permalink
Fix links in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
goerz committed Mar 25, 2024
1 parent 025f529 commit 9b2ffc5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
14 changes: 10 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
using Pkg

DOCUMENTER_VERSION = [p for (uuid, p) in Pkg.dependencies() if p.name == "Documenter"][1].version
if DOCUMENTER_VERSION <= v"1.3.0"
Pkg.develop("Documenter")
end

using Documenter
using QuantumPropagators
using QuantumPropagators: AbstractPropagator, set_t!, set_state!
using Documenter
using Pkg
import OrdinaryDiffEq # ensure ODE extension is loaded
using DocumenterCitations
using DocumenterInterLinks
Expand Down Expand Up @@ -46,8 +52,8 @@ links = InterLinks(
)

externals = ExternalFallbacks(
"Trajectory" => "@extref QuantumControlBase.Trajectory",
"ParameterizedFunction" => "@extref `QuantumPropagators.Controls.ParameterizedFunction`"
"QuantumControlBase.Trajectory" => "@extref QuantumControlBase :jl:type:`QuantumControlBase.Trajectory`",
"QuantumControlBase.ControlProblem" => "@extref QuantumControlBase :jl:type:`QuantumControlBase.ControlProblem`",
)

println("Starting makedocs")
Expand Down
2 changes: 1 addition & 1 deletion docs/src/howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,4 @@ get_parameters(gaussian) = (A = 2.0, t0 = 5.0, sigma = 0.5)
gaussian(4.5) = 1.213
```

The [`QuantumPropagators.Interfaces.check_parameterized_function`](@ref) can be used to verify the implementation of a [`ParameterizedFunction`](@ref).
The [`QuantumPropagators.Interfaces.check_parameterized_function`](@ref) can be used to verify the implementation of a [`ParameterizedFunction`](@ref QuantumPropagators.Controls.ParameterizedFunction).
15 changes: 10 additions & 5 deletions src/controls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ Note that the `control` must be an object specifically designed to have
analytic parameters. Typically, it should be implemented as a subtype of
[`ParameterizedFunction`](@ref). For a simple function `ϵ(t)` or a vector of
pulse values, which are the default types of controls discussed in the
documentation of [`hamiltonian`](#QuantumPropagators.Generators.hamiltonian),
documentation of
[`hamiltonian`](@ref QuantumPropagators.Generators.hamiltonian),
the `get_parameters` function will return an empty vector.
More generally,
Expand All @@ -515,7 +516,10 @@ parameters = get_parameters(object)
```
collects and combines all unique parameter arrays from the controls inside the
`object`. The `object` may be `Generator`, `Trajectory`, `ControlProblem`, or
`object`. The `object` may be a
[`Generator`](@ref QuantumPropagators.Generators.Generator),
[`Trajectory`](@ref QuantumControlBase.Trajectory),
[`ControlProblem`](@ref QuantumControlBase.ControlProblem), or
any other object for which [`get_controls(object)`](@ref get_controls) is
defined. If there are multiple controls with different parameter arrays, these
are combined in a [`RecursiveArrayTools.ArrayPartition`](@extref).
Expand All @@ -540,7 +544,6 @@ the mid-points of the time grid, as obtained by
[`discretize_on_midpoints`](@ref), and `get_parameters` is ignored.
"""
function get_parameters(object)
# TODO: in docstring, link `Generator`, `Trajectory`, `hamiltonian`.
parameter_arrays = []
seen_parameter_array = IdDict{Any,Bool}()
seen_control = IdDict{Any,Bool}()
Expand Down Expand Up @@ -601,10 +604,12 @@ The `parameters` field of any `ParameterizedFunction` can be accessed via
[`get_parameters`](@ref).
See [How to define a parameterized control](@ref howto_parameterized)
for an example.
for an example. You may use the
[`QuantumPropagators.Interfaces.check_parameterized_function`](@ref) to check
the implementation of a `ParameterizedFunction` subtype.
"""
abstract type ParameterizedFunction <: Function end
# TODO: document interface test


function get_parameters(control::ParameterizedFunction)
return getfield(control, :parameters)
Expand Down

0 comments on commit 9b2ffc5

Please sign in to comment.