Open oskooi opened 3 years ago
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.
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
andnonlinear_ex
ofsymmetry.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 :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