-
Notifications
You must be signed in to change notification settings - Fork 52
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
Convenience function to add charge perturbations with Nedeljkovic Soref Mashanovich model #2312
Conversation
ea65ba8
to
effee69
Compare
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.
not sure what would be the best organization of this kind of model, given it so specific to a single material. I guess, one alternative I see is to simply have something like IndexPerturbation.from_nsm_si_model(f: float)
class method instead of a new class. One concern, neither that nor the current implementation easily allow to include heat perturbations too
I agree this model is very specific. That's why I made it derive from a more generic base class. This base class, in principle would allow to implement other models for other use cases. It would also allow users to create their own and use them with def from_perturbation_delta_model(cls, deltas_model: AbstractDeltaModel) -> IndexPerturbation:
"""Create an IndexPerturbation from a DeltaPerturbationModel."""
return IndexPerturbation(delta_n=deltas_model.delta_n, delta_k=deltas_model.delta_k) Precisely because of it being so specific I'm not super keen on having something like |
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 think I agree with @marc-flex here, @dbochkov-flexcompute if you find a quick moment to give final thoughts if we can merge this as is?
yeah, sounds good! |
… Nedeljkovic Soref Mashanovich
40fd6fe
to
1c795a6
Compare
This PR adds a convenience class that allows to easily specify medium perturbation using the model in here. It addresses issue https://github.com/flexcompute/tidy3d-core/issues/846
For instance, in the Charge notebook one can now define the perturbation medium like this
The class
NedeljkovicSorefMashanovich
derives from a new classAbstractDeltaModel
so potentially more perturbation models could be implemented following this approach (or used as template).