rydiqule.slicing.slicing.get_slice_num¶
- rydiqule.slicing.slicing.get_slice_num(n: int, stack_shape: Tuple[int, ...], doppler_shape: Tuple[int, ...], sum_doppler: bool, weight_doppler: bool, n_slices: int | None = None, debug: bool = False) Tuple[int, Tuple[int, ...]] [source]¶
Estimates the memory required for the desired steady state solve.
Estimates are fairly accurate, but not guaranteed. Goal is to err on allowing edge case solves to proceed.
- 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.
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 there isn’t enough memory to solve the system:
RydiquleError – If
sum_doppler=False
and full solution does not fit in memory.: