-
Notifications
You must be signed in to change notification settings - Fork 40
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
Medium perturbation #996
Medium perturbation #996
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Daniil, this is a ton of work and I think it is really well organized and covers everything I can think of very well. Most of my comments are just refining it for public consumption. The notebook is also extremely useful and will be invaluable. There were a few spelling issues, I recommend this https://pypi.org/project/jupyterlab-spellchecker/ to catch some of them before we do a more thorough proofread.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks quite good! A few small comments.
9747108
to
4dc682f
Compare
big cleanup, added many docstrings, added tests, and fixed many loose ends. I am considering adding rest of dispersive models |
allowed_imag_range=[None], | ||
allowed_complex=False, | ||
) | ||
_conductivity_perturbation_validator = validate_parameter_perturbation( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If allow_gain=True
, conductivity can be < 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, these validators only warn if conductivity/permittivity can potentially go out of bounds (within the provided/calculated temperature_range
, electron_range
, and hole_range
). The strict validation is left to the corresponding CustomMedium
. So perhaps it's still ok to warn the user about potentially negative conductivity even if allow_gain=True
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, so it will warn and then error. In that regard, there seems to be missing allow_gain
in the return of
return CustomMedium(
permittivity=permittivity_field,
conductivity=conductivity_field,
name=self.name,
subpixel=True,
)
and it seems better to add subpixel
as a field of PerturbedMedium so that one can choose to apply subpixel or not. But warn that for a uniform medium, supixel parameter will be ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you're right, thanks for catching that. Actually, frequency_range
should also be passed. Fixed it.
Agree, as long as we can have a good heat example in the current stage. |
4dc682f
to
dee1dd4
Compare
9ec7e3a
to
b448927
Compare
if there are no other comments at this point, is it ok to merge this into pre/2.4? |
Yea I've given all of my comments. I think it's ok if everyone else does |
Green light from me. |
b448927
to
76e260e
Compare
Heat and charge perturbation functionality. Currently, implemented for
Medium
andPoleResidue
, but this is ready for an initial "big picture" review, to check if anything seems bad/needs a rework. Here's a notebook with demonstrations and explanations to help the review https://github.com/flexcompute-readthedocs/tidy3d-docs/blob/daniil/perturbation-medium/docs/source/notebooks/PerturbationMedium.ipynb. If everything looks more or less alright, I will go ahead and finish some remaining to-do's:PerturbationDebye
,PerturbationLorentz
, etctagging @momchil-flex just in case