t_funcs
Named time-function factories for use with the time-dependent solver.
Each function takes an integer index and returns a callable with signature
f(t, args) where args is a dict of named parameters suffixed by the
index. For example, square(1) returns a function that reads
{'on_1', 'off_1', 'ampl_1'} from args.
- maxwellbloch.t_funcs.gaussian(index: int) Callable[[float | ndarray, dict[str, Any]], float | ndarray][source]
Return a Gaussian pulse time function.
- Parameters:
index – Integer suffix used to look up parameters in args.
- Returns:
Callable
f(t, args)readingfwhm_{index},centre_{index}, and eitherampl_{index}orn_pi_{index}from args. RaisesKeyErrorif both or neither amplitude parameters are present.
Notes
The amplitude can be set directly via
ampl_{index}or indirectly vian_pi_{index}(desired pulse area in multiples of π).
- maxwellbloch.t_funcs.intp(index: int) Callable[[float | ndarray, dict[str, Any]], float | ndarray][source]
Return an interpolated time function.
Linearly interpolates a user-supplied
(tlist, ylist)pair, returning zero outside the supplied range.- Parameters:
index – Integer suffix used to look up parameters in args.
- Returns:
Callable
f(t, args)readingtlist_{index}andylist_{index}from args. Returns a Python complex scalar when called with scalart(as required by QuTiP 5), or an array when called with arrayt.
- maxwellbloch.t_funcs.ramp_off(index: int) Callable[[float | ndarray, dict[str, Any]], float | ndarray][source]
Return a ramp-off time function.
The pulse holds at
ampluntil the turn-off timeoff, then falls smoothly to zero using a half-Gaussian.- Parameters:
index – Integer suffix used to look up parameters in args.
- Returns:
Callable
f(t, args)readingampl_{index},fwhm_{index}, andoff_{index}from args.
- maxwellbloch.t_funcs.ramp_offon(index: int) Callable[[float | ndarray, dict[str, Any]], float | ndarray][source]
Return a ramp-off / ramp-on time function.
The pulse starts at
ampl, dips smoothly to zero, then rises back toampl. Built by composingramp_on()andramp_off().- Parameters:
index – Integer suffix used to look up parameters in args.
- Returns:
Callable
f(t, args)readingampl_{index},fwhm_{index},off_{index}, andon_{index}from args.
- maxwellbloch.t_funcs.ramp_on(index: int) Callable[[float | ndarray, dict[str, Any]], float | ndarray][source]
Return a ramp-on time function.
The pulse rises smoothly from zero using a half-Gaussian, then holds at
amplafter the turn-on timeon.- Parameters:
index – Integer suffix used to look up parameters in args.
- Returns:
Callable
f(t, args)readingampl_{index},fwhm_{index}, andon_{index}from args.
- maxwellbloch.t_funcs.ramp_onoff(index: int) Callable[[float | ndarray, dict[str, Any]], float | ndarray][source]
Return a ramp-on / ramp-off time function.
The pulse rises smoothly, holds at
ampl, then falls smoothly. Built by composingramp_on()andramp_off().- Parameters:
index – Integer suffix used to look up parameters in args.
- Returns:
Callable
f(t, args)readingampl_{index},fwhm_{index},on_{index}, andoff_{index}from args.
- maxwellbloch.t_funcs.sech(index: int) Callable[[float | ndarray, dict[str, Any]], float | ndarray][source]
Return a sech pulse time function.
- Parameters:
index – Integer suffix used to look up parameters in args.
- Returns:
Callable
f(t, args)readingcentre_{index}, eitherampl_{index}orn_pi_{index}, and eitherwidth_{index}orfwhm_{index}from args. RaisesKeyErrorif conflicting or missing parameters are found.
Notes
The amplitude can be set directly via
ampl_{index}or indirectly vian_pi_{index}(desired pulse area in multiples of π).The width can be set directly via
width_{index}or indirectly viafwhm_{index}(full-width at half maximum).
- maxwellbloch.t_funcs.sinc(index: int) Callable[[float | ndarray, dict[str, Any]], float | ndarray][source]
Return a sinc pulse time function.
- Parameters:
index – Integer suffix used to look up parameters in args.
- Returns:
Callable
f(t, args)readingampl_{index}andwidth_{index}from args.
- maxwellbloch.t_funcs.square(index: int) Callable[[float | ndarray, dict[str, Any]], float | ndarray][source]
Return a square (top-hat) pulse time function.
- Parameters:
index – Integer suffix used to look up parameters in args.
- Returns:
Callable
f(t, args)readingampl_{index},on_{index},off_{index}from args. Returnsamplbetweenonandoff, zero outside.