Skip to content

Commit

Permalink
Fix type annotation in run() method of Simulation() class. (#423)
Browse files Browse the repository at this point in the history
* Fix type annotation in run() method of Simulation() class.

* Update type annotation to adhere to **kwargs annotation style. Add info to docstring.

* Keep linter happy.

* Add QuTiP docs for simulation options to docstring.

* Use shortened URL for QuTiP link.

* Fix rendering issue of hyperlink by including newline.
  • Loading branch information
dehond authored Nov 29, 2022
1 parent c437beb commit 50f952f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pulser-simulation/pulser_simulation/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ def get_hamiltonian(self, time: float) -> qutip.Qobj:
def run(
self,
progress_bar: Optional[bool] = False,
**options: qutip.solver.Options,
**options: Any,
) -> SimulationResults:
"""Simulates the sequence using QuTiP's solvers.
Expand All @@ -829,10 +829,14 @@ def run(
Args:
progress_bar: If True, the progress bar of QuTiP's
solver will be shown. If None or False, no text appears.
options: If specified, will override
SimConfig solver_options. If no `max_step` value is provided,
an automatic one is calculated from the `Sequence`'s schedule
(half of the shortest duration among pulses and delays).
options: Used as arguments for qutip.Options(). If specified, will
override SimConfig solver_options. If no `max_step` value is
provided, an automatic one is calculated from the `Sequence`'s
schedule (half of the shortest duration among pulses and
delays).
Refer to the QuTiP docs_ for an overview of the parameters.
.. _docs: https://bit.ly/3il9A2u
"""
if "max_step" in options.keys():
solv_ops = qutip.Options(**options)
Expand Down

0 comments on commit 50f952f

Please sign in to comment.