rydiqule.stack_solvers.scipy_solver.scipy_solve

rydiqule.stack_solvers.scipy_solver.scipy_solve(eoms_base: ndarray, const: ndarray, eom_time_r: ndarray, const_r: ndarray, eom_time_i: ndarray, const_i: ndarray, time_inputs: Sequence[Callable[[float], complex]], t_eval: ndarray, init_cond: ndarray, eqns: Literal['loop', 'comp'] = 'loop', **kwargs) ndarray[source]

Solve a set of Optical Bloch Equations (OBEs) with rydiqule’s time solving convention using scipy’s solve_ivp.

Uses matrix components of the equations of motion provided by the methods of a Sensor(). Designed to be used as a wrapped function within solve_time(). Builds and solves equations of motion according rydiqule’s time solving conventions. Sets up and solves dx/dt = A(t)x + b(t)

Parameters:
  • eoms_base (numpy.ndarray) – The matrix of shape (*l,n,n) representing the non time-varying portion of the matrix A in the equations of motion.

  • const (numpy.ndarray) – The array of shape (*l, n) representing the non time-varying portion of the vector b in the equations of motion.

  • eoms_time_r (numpy.ndarraynumpy) – The matrix of shape (n_t, *l, n, n) representing the real time-varying portion of the matrix A, where n_t is the length of time_inputs. The ith slice along the first axis should be multiplied by the real part of the ith entry in time_inputs.

  • const_r (numpy.nd_array) – The matrix of shape (n_t, *l, n) representing the real time-varying portion of the vector b, where n_t is the length of time_inputs. The ith slice along the first axis should be multiplied by the real part of the ith entry in time_inputs.

  • eoms_time_i (numpy.ndarray) – The matrix of shape (n_t, *l, n, n) representing the imaginary time-varying portion of the matrix A, where n_t is the length of time_inputs. The ith slice along the first axis should be multiplied by the imaginary part of the ith entry in time_inputs.

  • const_i (numpy.nd_array) – The matrix of shape (n_t, *l, n) representing the imaginary time-varying portion of the vector b, where n_t is the length of time_inputs. The ith slice along the first axis should be multiplied by the imaginary part of the ith entry in time_inputs.

  • time_inputs (list(callable)) – List of callable functions of length n_t. The functions should take a single floating point as an input representing the time in microseconds, and return a real or complex floating point value represent an electric field in V/m at that time.

  • t_eval (numpy.ndarray) – Array of times to sample the integration at.

  • init_cond ((numpy.ndarray)) – Matrix of shape (*l, n) representing the initial state of the system.

  • eqns ({"loop", "comp"}) – Function used of generating equations of motion. One of “loop” or “comp”, corresponding to defining time-dependent equations of motion as a loop over time-dependent components or with a list comprehension. List comprehensions are preferred for longer solves and loops are preferred for shorter solves.

  • **kwargs (dict) – Additional keyword arguments passed to the nbkode solver constructor.

Returns:

The matrix solution of shape (*l,n,n_t) representing the density matrix of the system at each time t.

Return type:

numpy.ndarray