Skip to content
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

Diffractive detector & Multi frequency phasor #19

Merged
merged 2 commits into from
Mar 3, 2025

Conversation

txdai
Copy link
Contributor

@txdai txdai commented Feb 20, 2025

This pull request introduces significant updates to the fdtdx package, specifically enhancing the functionality of the diffractive and phasor detectors. The changes include the addition of a new DiffractiveDetector class and modifications to the PhasorDetector class to support multiple frequencies. Also, the "wavelength" parameter is changed to "frequency" due to wavelength being variable in mediums.

New Features:

  • Diffractive Detector:
    • Introduced a new DiffractiveDetector class for computing Fourier transforms of fields at specific frequencies and diffraction orders. This detector can measure diffraction in either positive or negative direction along the propagation axis.

Enhancements to Existing Features:

  • Phasor Detector:
    • Added support for analyzing multiple frequencies by introducing a frequencies attribute. This allows the PhasorDetector to compute phasor representations at specified frequencies, enabling more detailed frequency-domain analysis.
    • Removed the wavelength attribute and the frequency property, replacing them with precomputed angular frequencies for vectorized calculations. This simplifies the phasor computation process.
    • Updated the _shape_dtype_single_time_step method to account for the new frequencies attribute, ensuring the shape includes the number of frequencies.
    • Modified the update method to handle multiple frequencies, performing vectorized calculations for phasors at each frequency. This includes changes to the computation of phase angles and the application of complex exponentials. [1] [2] [3]

This detector functions as a monitor for the diffraction orders for the nearfield, treating periodic devices as a 2D grating. As wavelength is not well defined and can be varying, I modified to use frequency as the defining parameter. In addition, phasor now supports multiple frequencies
@ymahlau
Copy link
Owner

ymahlau commented Mar 3, 2025

Hi, I really like this implementation! Very well done! In the future, we should also add the option to support wavelengths and periods similar to the WavelengthDependentObject. I will write this on my todo list

@ymahlau ymahlau merged commit 39556b3 into ymahlau:main Mar 3, 2025
3 checks passed
@txdai txdai deleted the Diffractive-Detector branch March 5, 2025 22:25
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants