ob_solve.OBSolve
ob_solve.OBSolve(
atom=None,
t_min=0.0,
t_max=1.0,
t_steps=100,
method='mesolve',
opts=None,
savefile=None,
)Time-domain master equation solver for a single spatial point.
Wraps :func:qutip.mesolve to evolve an atomic density matrix described by an :class:~clerq.ob_atom.OBAtom over a user-defined time grid. Supports Doppler broadening via velocity classes and can save/load results to avoid recomputation.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| atom | dict | None | Dict (or empty dict for defaults) describing the atomic system; passed to :class:~clerq.ob_atom.OBAtom. |
None |
| t_min | float | Start time of the simulation. | 0.0 |
| t_max | float | End time of the simulation. | 1.0 |
| t_steps | int | Number of time steps. | 100 |
| method | str | Solver method — 'mesolve' (Lindblad master equation) is the only supported value. |
'mesolve' |
| opts | dict | None | Dict of QuTiP solver options passed to qutip.Options. |
None |
| savefile | str | None | Path prefix for caching solved results ('.qu' extension appended automatically). Pass None to disable caching. |
None |
Methods
| Name | Description |
|---|---|
| build_opts | Build the options dict to be passed into the QuTiP solver. |
| from_json | Initialise OBSolve from JSON file. |
| from_json_str | Initialise OBSolve from JSON string. |
| savefile_exists | Returns true if savefile (with appended extension .qu) exists. |
| set_field_rabi_freq_t_args | Set the Rabi frequency time function arguments. To be used with |
| set_field_rabi_freq_t_func | Set the Rabi frequency time function of a field to a new time |
build_opts
ob_solve.OBSolve.build_opts(opts=None)Build the options dict to be passed into the QuTiP solver.
Any option available to the QuTiP solver is available here, we provide defaults for solving the optical Bloch equations. See 0 for details of all the available options.
Notes
- For a stiff problem, it may help to set ‘method’ to ‘bdf’ instead of ‘adams’.
- If the solver times out, try more ‘nsteps’, though this will take longer.
- To speed up the solver, reduce atol and rtol, though this will reduce accuracy.
Warning
There is no validation checking here. If you pass in an option which is not known to QuTiP it will throw an exception.
from_json
ob_solve.OBSolve.from_json(file_path)Initialise OBSolve from JSON file.
from_json_str
ob_solve.OBSolve.from_json_str(json_str)Initialise OBSolve from JSON string.
savefile_exists
ob_solve.OBSolve.savefile_exists()Returns true if savefile (with appended extension .qu) exists.
set_field_rabi_freq_t_args
ob_solve.OBSolve.set_field_rabi_freq_t_args(field_idx, t_args)Set the Rabi frequency time function arguments. To be used with set_field_rabi_freq_t_func
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| field_idx | int | The field for which to set the Rabi frequency t_args | required |
| t_args | dict | A dict representing the args to go with the t_func. | required |
set_field_rabi_freq_t_func
ob_solve.OBSolve.set_field_rabi_freq_t_func(field_idx, t_func)Set the Rabi frequency time function of a field to a new time function. This is useful when you want to set a custom function, not one available in t_funcs.py
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| field_idx | int | The field for which to set the Rabi frequency t_func | required |
| t_func | Any | Rabi frequency as a function of time, f(t, args) | required |