rydiqule.slicing.slicing.get_slice_num_t

rydiqule.slicing.slicing.get_slice_num_t(n: int, stack_shape: Tuple[int, ...], doppler_shape: Tuple[int, ...], time_points: int, sum_doppler: bool, weight_doppler: bool, n_slices: int | None, debug: bool = False) Tuple[int, Tuple[int, ...]][source]

Estimates the memory required for the desired time solve.

Note that the time solver used (scipy.solve_ivp) is an adaptive solver, so the internal number of time steps used is problem dependent and not controlled by the requested number of time points. Generally, the number of points is proportional to the highest frequency in the problem and the length of the time to solve. To estimate a lower bound on the memory needed to time solve, we use a fudge factor of 4 on the requested time points. This is unlikely to be accurate even in a general case.

Parameters:
  • n (int) – Size of the system basis

  • stack_shape (tuple of int) – Tuple of sizes for the hamiltonian stack to be solved

  • doppler_shape (tuple of int) – Tuple of sizes for the doppler axes. Pass an empty tuple if no doppler averaging.

  • time_points (int) – Number of time steps requested from the time solver. This sets the output solution shape. An internal fudge factor of 4 is applied for memory estimation purposes.

  • sum_doppler (bool) – Whether solution will be summing the doppler average

  • weight_doppler (bool) – Whether the solution will apply weights to the doppler averaging

  • n_slices (int, default=1) – Manually override the minimum number of hamiltonian slices to use.

  • debug (bool, default=False) – Print debug information about the memory calculations.

Returns:

  • n_ham_slices (int) – Number of slices to use when solving the stacked hamiltonian

  • out_sol_shape (tuple of int) – Shape of the resulting solution for this calculation.

Raises:

RydiquleError – If sum_doppler=False and full solution does not fit in memory.:

Warns:

RydiquleWarning (If there is unlikely to be enough memory to solve the system.)