garrettj403 / QMix

Simulate the behavior of SIS junctions
https://garrettj403.github.io/QMix/
GNU General Public License v3.0
7 stars 2 forks source link

Problem in parameters.py file #3

Open dliupmo opened 4 years ago

dliupmo commented 4 years ago

The parameters "vgap_threshold" in parameters.py is 105e-6 now, so when using the _find_gap_voltage() function to calculate the gap voltage, Method 1 is always called, and Method 2 is never called. There will lead to incorrect calculation of gap voltage.

Please check it.

# Unpack keyword arguments
vgap_threshold = kw.get('vgap_threshold', PARAMS['vgap_threshold'])

# Method 1: current threshold
if vgap_threshold is not None:
    idx = np.abs(curr_a - vgap_threshold).argmin()
    vgap = volt_v[idx]
    return vgap

# Method 2: max derivative
vstep = volt_v[1] - volt_v[0]
mask = (1.5e-3 < volt_v) & (volt_v < 3.5e-3)
der = slope(volt_v[mask], curr_a[mask])
der = gauss_conv(der, sigma=0.2e-3 / vstep)
vgap = volt_v[mask][der.argmax()]
dliupmo commented 4 years ago

The parameters "vgap_threshold" in parameters.py should be "None"

garrettj403 commented 4 years ago

Hi @dliupmo,

Sorry for the late reply. I've changed the default value of vgap_threshold to None (see commit 26f61d0).

In the future, I think a better option would be to have a vgap_method argument that would allow you to specify which method that you would like to use explicitly. I'll try to do this in the next week or so.