Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Frequency-dependent rotation to constant in-plane k beam #2272

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

momchil-flex
Copy link
Collaborator

@momchil-flex momchil-flex commented Feb 25, 2025

Another fix to how we get the beam fields. Now, points has been extended to have shape [3, Npoints, Nfreqs], and in the case of constant in-plane k wave the points are rotated with the actual theta at every frequency. This made things cleaner and actually allowed me to clean up all of the np.outer and [:, None] type of handling we had in the scalar field functions, as everything just works with regular broadcasting. And of course the main reason for this was to fix the plane wave injection with backward direction, which indeed is now fixed.

One last thing that I don't understand about fixed angle is why we don't rotate the points, but then we rotate the fields? That's not super intuitive to me and ideally I would like to generalize things so that the points are always rotated (propagation direction is always z). I actually can understand why we don't rotate the points - in some sense the "actual angle" is zero (and we just modify the kz). But why do we rotate the fields by angle_theta?

@momchil-flex momchil-flex added the 2.8 will go into version 2.8.* label Feb 25, 2025
Copy link
Contributor

@dbochkov-flexcompute dbochkov-flexcompute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! When I was looking at it also thought that maybe we need to make points frequency dependent.

Regarding rotation of fields for fixed angle case, I think we could give the following explanantion:

What we would like to model is injection of $\vec{A} \exp(j \vec{r}\cdot \vec{k})$, where information about angle sits both in $\vec{A}$ and $\vec{k}$. The fixed angle treatment only modifies $\exp(j \vec{r}\cdot \vec{k})$ part, while $\vec{A}$ remains rotated. Maybe it's not the best way to think about it in terms of not rotating points but rotating fields, but it provides the desired outcome

@momchil-flex momchil-flex merged commit 1e7a89b into develop Feb 27, 2025
15 checks passed
@momchil-flex momchil-flex deleted the momchil/beam_fix branch February 27, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.8 will go into version 2.8.*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants