You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the luigi config, one specifies the parameter ModeSearchConfig.quality_threshold; usually in the range of 1e-6 to 1e-4. This parameters is used at two points in the overall code:
Both FindPassiveModes and FindThresholdModes call the function refine_mode_brownian_ratchet, where quality_threshold is a parameter that tells the algorithm when to stop the search.
Later on, in ComputeModeCompetitionMatrix, the function mode_on_nodes is called (see below). In there, some mode quality is calculated and compared against quality_threshold. If it exceeds the threshold, an exception is thrown.
For some runs, I get the exception mentioned in point 2. I initially tried those runs with ModeSearchConfig.quality_threshold = 1e-6 and got the exception that my quality was slightly above that – usually just by a factor not greater than 1.5 (which is quite small considering we are speaking about orders of magnitude here). Then I increased ModeSearchConfig.quality_threshold to 1e-5, but still get an exception:
Not a mode, as quality is too high: 1.0717457667280263e-05 > 1e-05, mode: (6.873399477319817-0.0033058189568381364j)
It seems that (for some reason) the actual quality always exceeds the target quality by a tiny bit. The easy solution would be to compare the actual quality in the function mode_on_nodes (see below) against 2 * quality_threshold . This way, all exceptions that I get would be removed.
However, to be honest, I don't understand the code deeply enough (yet) to judge whether this solution would be reasonable. This is why I would be glad about an opinion from the code authors here.
Update: The above solution worked good for me until suddenly, for certain networks, I got qualities that were a lot higher than the threshold. Sometimes, the threshold is surpassed by more than a factor of 100!
This seems like a bug to me – maybe in the implementation of the Brownian ratchet? Does somebody have an idea how to resolve this?
I finally found the problem: For my use case, I need to pixelate the networks, i.e. chop up the edges according to a 4-by-4 grid, for instance. This does not physically change the network, but it allows for more flexibility when defining a pump. What I did is to compute the passive modes using the original network and then compute the lasing modes using the pixelated networks. For some networks, this works well. However, for other networks, passive modes computed with the original network are somehow not "compatible" with the pixelated network. I assume, this is due to numerical effects.
In the luigi config, one specifies the parameter
ModeSearchConfig.quality_threshold
; usually in the range of1e-6
to1e-4
. This parameters is used at two points in the overall code:FindPassiveModes
andFindThresholdModes
call the functionrefine_mode_brownian_ratchet
, wherequality_threshold
is a parameter that tells the algorithm when to stop the search.ComputeModeCompetitionMatrix
, the functionmode_on_nodes
is called (see below). In there, some mode quality is calculated and compared againstquality_threshold
. If it exceeds the threshold, an exception is thrown.For some runs, I get the exception mentioned in point 2. I initially tried those runs with
ModeSearchConfig.quality_threshold = 1e-6
and got the exception that my quality was slightly above that – usually just by a factor not greater than1.5
(which is quite small considering we are speaking about orders of magnitude here). Then I increasedModeSearchConfig.quality_threshold
to1e-5
, but still get an exception:It seems that (for some reason) the actual quality always exceeds the target quality by a tiny bit. The easy solution would be to compare the actual quality in the function
mode_on_nodes
(see below) against2 * quality_threshold
. This way, all exceptions that I get would be removed.However, to be honest, I don't understand the code deeply enough (yet) to judge whether this solution would be reasonable. This is why I would be glad about an opinion from the code authors here.
netSALT/netsalt/modes.py
Lines 265 to 282 in 7729c76
The text was updated successfully, but these errors were encountered: