-
Notifications
You must be signed in to change notification settings - Fork 644
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 Evaluations #475
Medium Evaluations #475
Conversation
src/susceptibility.cpp
Outdated
double lorentzian_susceptibility::chi1(double freq, double sigma) { | ||
if (no_omega_0_denominator){ | ||
// Drude model | ||
return sigma * omega_0*omega_0 / ( -freq*freq - sqrt(-1)*gamma*freq); |
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 would do std::complex<double>(-freq*freq, gamma*freq)
here rather than sqrt(-1)
.
Merge conflict. Can we have a test? |
Fixed the merge conflict. A test might be tricky to implement before we have a higher-level interface that gets ε(x,ω) or similar. |
…tibility_eval Updating materials library bug from master
Thanks for the conflict fix. I agree, it makes more sense to implement a test with slightly more functionality. On that note, which direction would you like to go from here? From a python perspective, it would be great to be able to do the following:
where If we develop some simple C++ functions to do this and simply wrap them, I'm hoping we can use the same C++ functions to build mode sources and perform eigenmode decomposition with dispersive materials. |
I agree that it would be nice to have this higher-level functionality. We might end up having to copy these χ(ω) formulas to more than one place, however, because when you have a |
As suggested, I copied the formulas over directly to the Python interface. I compared the MEEP output with the corresponding refractiveindex.info database, and they appear to align really well. Loading the refractive index data is as easy as the following:
I've attached the script and data used to generate the above plot. |
My latest commit modifies the In order to enable all materials, including metals, MPB's eigenmodemode solver would need to change slightly. I'm working on a number of tests to verify: Test 1 Test 2 I'm working on extracting the S parameters of a silicon photonic device from the SIEPIC toolbox (like the DC tutorial) and comparing them to the previously calculated results. This is my ultimate goal, and should attract the attention of several PIC designers. I'm debugging some weird issues that arise with higher resolutions. |
In the short term, can we at least pull out the Python portion of this PR as a separate PR that we can merge? |
Working on C implementation in a separate pull request. Will update with more details. |
A first attempt at adding medium evaluation functionality (see #415).
Added the function,
chi1
, that evaluates a susceptibility at a given frequency point. An optional conductivity term can be passed (defaults to 1).Once we add more features, I'll work on a SWIG interface.