loganbvh/superscreen: v0.9.0
Description
SuperScreen v0.9.0 is a significant update indented to improve the CPU/memory efficiency and ergonomics of the package. The major upgrades are contained in the following Pull Requests: https://github.com/loganbvh/superscreen/pull/96, https://github.com/loganbvh/superscreen/pull/99.
Rather than creating a single mesh containing all films in a device, each film now gets its own mesh and finite element operators.
- This approach avoids meshing large vacuum regions between films, which is costly.
- This approach also means that films with transport terminals can exist in the same
superscreen.Deviceas films without terminals. As a result, thesuperscreen.TransportDeviceclass is no longer needed and has been removed. - It is no longer necessary to explicitly define a bounding box around the film(s) being modeled. A suitable bounding box is automatically generated for each film within
superscreen.Device.make_mesh().
Reduced memory footprint and improved performance using
numbaJIT compiled functions.- Several costly numerical operations have been migrated from
numpy/scipyto customnumbajust-in-time (JIT) compiled functions. In particular,scipy.spatial.distance.cdist(), which computes a matrix of pairwise distances between points in space, has been replaced withsuperscreen.distance.cdist(), written usingnumba. Thenumbaimplementation is automatically performed in parallel on multiple CPU cores and avoids the allocation of large intermediate arrays, which can cause significant memory usage innumpy/scipy. - For devices with multiple films, the inductive coupling between films is now calculated using the supercurrent density and a
numbaimplementation of the Biot-Savart law, rather than the stream function and Ampere's law. The new approach is both more robust for closely-stacked films and avoids storage of large temporary arrays. - The default for
superscreen.Device.solve_dtypehas been changed fromfloat64tofloat32.
- Several costly numerical operations have been migrated from
The linear system describing the magnetic response of each film is now LU factored only once per call to
superscreen.solve().- This dramatically speeds up self-consistent simulations involving multiple films and makes the solver code more modular.
- The portions of the model that are independent of the applied field can be pre-factorized using
superscreen.factorize_model(), which returns asuperscreen.FactorizedModelobject that can be saved for future use. Asuperscreen.FactorizedModelinstance can be passed directly tosuperscreen.solve().
As a result of the above optimizations, GPU support using
jaxand parallel processing with shared memory usingrayno longer seem to add much value to the package, so they have been removed.- The
gpuargument tosuperscreen.solve()has been removed, as has the (optional) dependency onjax superscreen.solve_many()has been removed, as has the dependency onray
- The
All IO operations, including writing
superscreen.Deviceandsuperscreen.Solutionobjects to disk, are now performed using the HDF5 file format viah5py.- All objects within
superscreenthat can be serialized to disk now have.to_hdf5()and.from_hdf5()methods.
- All objects within
SuperScreenhas dropped support for Python 3.7, which will reach end-of-life in June 2023.- Added support for Python 3.11, which was being blocked by the dependency on
ray.
- Added support for Python 3.11, which was being blocked by the dependency on
Files
loganbvh/superscreen-v0.9.0.zip
Files
(17.5 MB)
| Name | Size | Download all |
|---|---|---|
|
md5:879f8773b25c78707c13c2a09dafaf24
|
17.5 MB | Preview Download |
Additional details
Related works
- Is supplement to
- https://github.com/loganbvh/superscreen/tree/v0.9.0 (URL)