From 74a7e65eb938e0ea05bd63ad707ddff2af956f65 Mon Sep 17 00:00:00 2001 From: David Meyer Date: Wed, 21 Jan 2026 09:08:52 -0500 Subject: [PATCH 1/2] Add note to intro notebook discussing trading memory for speed in core design --- docs/source/intro_nbs/Introduction_To_Rydiqule.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/intro_nbs/Introduction_To_Rydiqule.ipynb b/docs/source/intro_nbs/Introduction_To_Rydiqule.ipynb index 5b43c61..f923ea2 100644 --- a/docs/source/intro_nbs/Introduction_To_Rydiqule.ipynb +++ b/docs/source/intro_nbs/Introduction_To_Rydiqule.ipynb @@ -33,7 +33,9 @@ "## Limitations\n", "While we have worked hard to make Rydiqule as good as possible, there are some areas that can cause issues:\n", "\n", - "1. **Memory** - For systems with many laser parameter values, many levels, doppler averaging in several dimensions, or especially a combination of these, the equations of motion generated by rydiqule simply have to be very large, often requiring more memory than is in a typical laptop or simple desktop. For very large systems, the memory footprint may even outpace a powerful workstation. Rydiqule has built-in functionality to handle this, but it is not fully general and it will lead to slower solves.\n", + "1. **Memory** - `rydiqule`'s speed primarily comes at the cost of increased memory footprint.\n", + "In order to avoid Python interpreter overhead and fully leverage the speed of Numpy broadcasting and C-level for-looping when solving multiple sets of parameters, we have to pass all equations of motion as a single tensor object to the low-level C functions (such as those backing `numpy.linalg.solve` used by the steady-state solver).\n", + "For systems with many laser parameter values, many levels, doppler averaging in several dimensions, or especially a combination of these, the equations of motion generated by rydiqule are very large, often requiring more memory than is in a typical laptop or simple desktop. For very large systems, the memory footprint may even outpace a powerful workstation. Rydiqule has built-in functionality to handle this, but it is not fully general and it will lead to slower solves.\n", "2. **Speed** - While huge improvements have been made in the speed of `rydiqule` since its alpha stages, there are certain situations that can still cause slowdowns. For longer time-dependent simulations with large detunings, in particular for the poorly-conditioned equations produced with large doppler width, solving can still be slow. However, there is room for future improvement in rydiqule's time-solver implementation.\n", "4. **Quantum Back-action** - We treat the optical fields as static, and do not include them explicitly in the semi-classical equations of motion. Rydiqule does not account for atom-field back-action effects. This approximation is valid for low optical depth samples, and is known to give valid results for SNR in moderate optical depth samples. However, for quantitative analysis of quantum noise in high optical depth samples, Rydiqule may not be accurate. By extension, rydiqule is also not presently suitable for simulations involving single-photon-level fields.\n", "5. **Device Modelling** - Rydiqule is a physics solver, and does not currently have user-friendly support for device-level modelling. Put another way, rydiqule requires a certain level of atomic physics understanding to ensure results are physically meaningful/correct." From 5564ca71d7d824a0f4a132727b2914c52a7c1669 Mon Sep 17 00:00:00 2001 From: David Meyer Date: Wed, 21 Jan 2026 09:11:44 -0500 Subject: [PATCH 2/2] Update Analytic Doppler Example notebook memory comparisons to use minimum required footprint instead of full. Note: doesn't actually change the answer, but is more true to the spirit of the comparison. --- docs/source/examples/Analytical Doppler Demo.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/examples/Analytical Doppler Demo.ipynb b/docs/source/examples/Analytical Doppler Demo.ipynb index 78f5027..d8f4cf3 100644 --- a/docs/source/examples/Analytical Doppler Demo.ipynb +++ b/docs/source/examples/Analytical Doppler Demo.ipynb @@ -716,7 +716,7 @@ ], "source": [ "print(f'Wall time reduced by x{3*60/5:.0f}')\n", - "print(f'Solve memory requirement reduced by x{137.94/2.16:.0f}')" + "print(f'Solve memory requirement reduced by x{0.68633/0.01075:.0f}')" ] }, { @@ -1018,7 +1018,7 @@ } ], "source": [ - "print(f'Solve memory requirement reduced by x{41863/690.6:.0f}')" + "print(f'Solve memory requirement reduced by x{820.85/13.54:.0f}')" ] }, {