tidy3d
tidy3d copied to clipboard
Fix pol vector
Related to https://github.com/flexcompute/tidy3d/issues/1683
It seems like our frontend polarization visualization was inconsistent with actual fields being injected. Frontend arrow was calculated sometimes based on summation and sometimes based on subtraction of angle_phi
and pol_angle
, while on backend it is always summation. That is, rotation for angle_phi
and pol_angle
are always with respect to the positive direction of injection axis. Moreover the visualization was discontinuous between theta < 0, theta = 0, and theta > 0.
Here's comparison between the visualized polarization vector (red) and extracted from actual fields (blue)
Now we just repeat the same steps for computing _pol_vector
as the backend does for field computations. This seems to resolve all inconsistencies
Thanks @dbochkov-flexcompute. Can you just add a changelog item under fixed and I think this is good to merge and also fixes #1683 as far as I can tell.