Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
same as #1179 but rebased against 2.5, squashed, and polished up.
Note: works fine on version 2.4.2 but fails with version 2.5.0rc1 for some reason, looking into this.
Also note: there are two added tests (
_test_adjoint_broadband ...
) that should go in core.Summary of changes:
output_monitors
and also differentoutput_monitors
can have different frequencies.freqs_adjoint
corresponding to these monitors, which become thefreq0
s of our adjoint sources.JaxSimulation.fwidth_adjoint
, thefwidth
of the adjoint sources is chosen to be smaller than some factor (0.1) times the minimum difference between thefreqs_adjoint
. This was chosen empirically to be small enough to have low error, but not be too small. When this is set, a warning is displayed to the user outlining that anfwidth
was chosen automatically, which could lead to largerun_time
and some mitigation approaches for tightly packed frequencies.JaxSimulation.run_time_adjoint
, therun_time
of the adjointJaxSimulation
, will be some factor (100) divided by the adjointfwidth
. Again chosen empirically to avoid early shutoff in the adjoint sims, while not being too long.source_time
spectrum atfwidths_adjoint
. This is because we need to apply a different normalization frequency-by-frequency depending on thefreq0
andfwidth
of the adjoint sources, which may introduce amplitude or phase differences.Corresponding notebook changes: flexcompute-readthedocs/tidy3d-docs#296
I think that covers it, thanks in advance for the review!