Skip to content

IncoherentIrradiance indexes (y,x) in differentiable path #408

Description

@brambozz

Checklist

  • I have searched the existing issues and discussions for a similar question or problem.
  • I have read the documentation and tried to find an answer there.
  • I am using the latest version of Optiland (if not, please update and retry).
  • I have tried to reproduce or debug the issue myself before opening this.
  • I have included all necessary context, such as version info, error messages, or minimal reproducible examples.

Bug Report

Thanks for this great package, a real joy to work with it! I was running experiments where I use the IncoherentIrradiance class, both with and without using grad_mode for the torch backend. My results were different depending on whether grad_mode was on or off. I think I tracked down the source:

Describe the bug
In the differentiable path of the Irradiance class, the power map is indexed (y,x) here as opposed the (x,y) in the non-differentiable path here

I now fixed it myself by swapping the indices in the differentiable path. This gives consistent output between the two paths. I am not sure if this was somehow intended behaviour? If not, I can open a small PR with the changes!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions