chromatix-team / chromatix

Differentiable wave optics using JAX! Documentation can be found at https://chromatix.readthedocs.io
MIT License
77 stars 13 forks source link

Field property getter and setters #40

Closed hosseybposh closed 1 year ago

hosseybposh commented 1 year ago

At the moment field phase and intensity are defined as properties. It's very helpful and common to have property setters but you only have getters.

The replace method requires you to reconstruct the entire field.u and often times in holography and displays you want to keep either phase or amplitude and replace the other. Property setters will make the code much more clean.

GJBoth commented 1 year ago

Property setters aren't allowed since everything is functional and the dataclass is frozen - so we can't do anything with this.