Skip to content

Releases: CompPhysLab/SVETlANNa

v2.0.1

16 Apr 10:42

Choose a tag to compare

What's Changed

  • SLM forward/reverse methods fixed to ensure correct gradient propagation by @antoshkabest in #7

long-awaited v2.0

09 Apr 09:53
f081cf1

Choose a tag to compare

This release includes many breaking changes aimed at a better API and long-term support

Breaking changes:

  • new SimulationParameters API (thanks to @ChS23)
  • Renamed axes from (H, W) to (y, x) (W and H can still be used but with warnings)
  • Removed tensor_dot and mul across the library and replaced them with SimulationParameters.cast
  • Replaced sim_params.axes.x with sim_params.x
  • ConstrainedParameter was refactored, it can break old checkpoints if used
  • Redesigned SpatialLightModulator API:
    • mask_function argument replaced with lut_function
    • Added QuantizerFromStepFunction with one_step_tanh and one_step_cos
  • Removed response_parameters argument from NonlinearElement; users must now use PartialWithParameters
  • Removed BoundedParameter alias, now it is ConstrainedParameter
  • fresnel propagator has been removed
  • Renamed propagator from AS, RS to ASM, RSC (AS and RS can still be used but with warnings)
  • Removed clerk module

Known issues

  • phase_retrieval_problem will not work, as the new free space is under heavy development

New features

  • Added PartialWithParameters, removed internal FunctionModule
  • Added Hermite–Gaussian modes (thanks to @antoshkabest)
  • Added THz and as_ (attoseconds) to units.ureg
  • Advanced free-space propagation methods with zero-padding: zpASM and zpRSC
  • Updated colors in show_stepwise_forward

Simulation Parameters:

  • Added API for creating SimulationParameters without a dictionary: SimulationParameters(x=..., y=..., wavelength=..., …)
  • Methods similar to torch.Tensor were added: clone() and equal()
  • Now each element has its own instance of SimulationParameters (cloned on init to prevent unintended sharing)
  • Added cast() method with shape validation and LRU caching
  • SimulationParameters now inherits from nn.Module, enabling automatic device transfer via PyTorch's module tree
  • Added comprehensive axes management: add_axis(), remove_axis(), reorder()

Elements:

  • Elements rewritten to use the new SimulationParameters API (using cast)
  • Lenses, apertures, and diffractive layers now share a unified API: property transmission_function instead of a mix of methods and properties
  • Added support for svetlanna.Parameter in NonlinearElement

Dev Tools & Quality:

  • black, Flake8, mypy added to the pipeline
  • Created dedicated test folders: tests/elements, tests/wavefront
  • Added global fixtures in tests:
    • sim_params_simple, which generates different SimulationParameters
    • device_simple, which iterates over devices (cpu, mps, cuda) and skips if a device is not available (see conftest.py)

v1.0.4

21 Sep 14:45

Choose a tag to compare

Undo removal of BoundedParameter

v1.0.3

30 Jul 08:45

Choose a tag to compare

  • Fix bug in specs_writer by explicitly setting utf-8 as the default encoding.

v1.0.2

18 Jun 13:54

Choose a tag to compare

Add GitHub Actions for publishing package

Subfolder bug fix

11 Jun 15:58
b7b64af

Choose a tag to compare

v1.0.1

Update README.md

First release

10 Jun 14:54
496046c

Choose a tag to compare

Update README.md

Add online documentation link