Skip to content

Commit

Permalink
update docs for OptimizerOptions refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dkweiss31 committed Dec 13, 2024
1 parent e356215 commit 789f80e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,18 @@ parameters = seed_amplitude * jnp.ones((len(H1s), ntimes - 1))
target_states = [-1j * dq.basis(n, 1), 1j * dq.basis(n, 0)]
cost = ql.cost.coherent_infidelity(target_states=target_states, target_cost=0.001)
optimizer = optax.adam(learning_rate=0.0001)
options = ql.OptimizerOptions(
save_states=False, progress_meter=None, verbose=False, plot=True, plot_period=5
)
opt_options = {"verbose": False, "plot": True, "plot_period": 5}
dq_options = dq.Options(save_states=False, progress_meter=None)

# run optimization
opt_params = ql.optimize(parameters, cost, model, optimizer=optimizer, options=options)
opt_params = ql.optimize(
parameters,
cost,
model,
optimizer=optimizer,
opt_options=opt_options,
dq_options=dq_options,
)
```
You should see the following oputput, tracking the cost function values, pulse, pulse fft and expectation
values over the course of the optimization
Expand Down
6 changes: 0 additions & 6 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ and classes that help to define an optimization routine (cost functions, file in
options:
show_source: false

## Options

::: qontrol.options
options:
show_source: false

## File utilities

::: qontrol.utils.file_io
Expand Down
14 changes: 10 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,18 @@ parameters = seed_amplitude * jnp.ones((len(H1s), ntimes - 1))
target_states = [-1j * dq.basis(n, 1), 1j * dq.basis(n, 0)]
cost = ql.cost.coherent_infidelity(target_states=target_states, target_cost=0.001)
optimizer = optax.adam(learning_rate=0.0001)
options = ql.OptimizerOptions(
save_states=False, progress_meter=None, verbose=False, plot=True, plot_period=5
)
opt_options = {"verbose": False, "plot": True, "plot_period": 5}
dq_options = dq.Options(save_states=False, progress_meter=None)

# run optimization
opt_params = ql.optimize(parameters, cost, model, optimizer=optimizer, options=options)
opt_params = ql.optimize(
parameters,
cost,
model,
optimizer=optimizer,
opt_options=opt_options,
dq_options=dq_options,
)
```
You should see the following oputput, tracking the cost function values, pulse, pulse fft and expectation
values over the course of the optimization
Expand Down

0 comments on commit 789f80e

Please sign in to comment.