Skip to content
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

single-precision floating point for the fields arrays exacerbates chaotic behavior for Maxwell-Bloch simulation? #1700

Open
oskooi opened this issue Jul 25, 2021 · 1 comment
Labels

Comments

@oskooi
Copy link
Collaborator

oskooi commented Jul 25, 2021

Compiling Meep with --enable-single switches the floating-point precision of the time-domain and DFT fields arrays from double to single precision (#1544, #1675). However, two of the unit tests involving nonlinearities (test_multilevel_atom.py and nonlinear_ex of symmetry.cpp) produce significantly different results (i.e., several orders of magnitude) for single precision compared to double precision that they had to be disabled (#1698). One possible explanation for this effect was proposed by @stevengj :

Maybe we are entering some sort of chaotic regime, in which the precise details (phase etcetera) are extremely sensitive to initial conditions and small calculational errors.

It would be useful to look into this more carefully to verify whether this is true or not. Specifically, why would a Maxwell-Bloch simulation be overly sensitive to floating-point roundoff error?

cc @acerjan

@acerjan
Copy link
Contributor

acerjan commented Jul 27, 2021

Sorry for the slow response time here. I think there are a few things that could be occurring, depending on what exactly the nonlinear checks are doing physically. If the nonlinear checker isn't running long enough to reach a steady-state lasing solution, and is instead just running some amount of amplification for a short time on a cavity that is only a few pixels wide, for example, yeah, this could be exceptionally sensitive to the initial conditions as well as the exact step sizes.

Also, if the cavity is completely closed, without any PML, the energy in the system should just slosh back and forth (Rabi oscillations) between the atomic medium and the electromagnetic field. This process would also probably be dependent on the initial conditions.

Anyway, if we want to get to the bottom of this, we'd need to dig into exactly what the check are doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants