Added test for two-stream instability growth rate optimization #135
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.
This PR did the following:
e2from the 10th to 200th timestep. Measuring the growth rate by adiff-style metric may be too sensitive to numerical instabilities and fp64 precisionnumpyoperations tojax.numpyto the vlasov1d helpers file for differentiability__call__function in theBaseVlasov1Dmodule so that the inputs to be differentiated (i.e., state and cfg) are explicit (ope -- reverted this so it doesn't break other scripts)When ran, the script creates an mlflow experiment "twostream-optimize" with child runs of "opt-iter-x".
Efforts were made to make the optimization appear functional-like despite the OOP paradigm. To Jax, it shouldn't make a difference whether
self.stateis exploited or not because the function to be differentiated is still a pure function: the__call__takes inparamsand returns the simulation results. Nevertheless the optimization target and mutable parameters should be clear.