Skip to content

Reflection operation for geometries #2157

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
tomflexcompute opened this issue Jan 13, 2025 · 6 comments
Open

Reflection operation for geometries #2157

tomflexcompute opened this issue Jan 13, 2025 · 6 comments

Comments

@tomflexcompute
Copy link
Contributor

Currently we already support transformations including rotation, translation, and scaling. Another operation that users request is reflection off a plane or point. Would if be possible to add this transformation?

@lucas-flexcompute
Copy link
Collaborator

Hi Tom, if I'm not mistaken, reflection is just scaling with a negative factor. The original implementation supported that, but I'm not sure autograd does. @yaugenst thoughts?

@yaugenst-flex
Copy link
Collaborator

Yeah we are working on autograd support for geometric transformations, shouldn't take too long. I guess reflection is mostly a question about API, since yeah scaling is more general. But it might make sense to introduce a reflected method that just uses scaled under the hood?

@lucas-flexcompute
Copy link
Collaborator

Sure, I see no problem there. Do you think Rahul could tacke that together with his work on autograf support? With PhotonForge close to release, I just don't have the bandwidth to work on it.

@yaugenst-flex
Copy link
Collaborator

Sounds good!

@momchil-flex
Copy link
Collaborator

Another operation that users request is reflection off a plane or point

Just a quick note for future reference, reflection off a point doesn't make sense I think, but yeah I think usually the general way to define this is w.r.t. a plane passing through the origin, similar to how we define rotations around an axis passing through the origin. The reflection matrix is orthogonal like the rotation matrix but with determinant -1. It's only in the special case of reflecting w.r.t. a plane normal to one of the x, y, or z axes that we get a scaling. But more generally we could handle it similarly to rotation where an axis is provided, which defines the plane as passing through the origin and normal to the axis. The corresponding orthogonal matrix is defined here. https://en.wikipedia.org/wiki/Reflection_(mathematics)#Reflection_through_a_hyperplane_in_n_dimensions

@momchil-flex
Copy link
Collaborator

momchil-flex commented Apr 24, 2025

Relevant code for other supported transformations, plus anywhere those are used, an addition for the reflection case might be needed.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants