qkitgroup / qkit

Qkit framework
GNU General Public License v2.0
43 stars 46 forks source link

Bugfix to circle version selected #87

Closed DaBiebs closed 2 years ago

DaBiebs commented 3 years ago

Addressing a bug in resonator.py.

image

Schneider1 commented 3 years ago

Thank you for this bug report. The underlying problem is apparently that v1 and v2 of the circle fit do not have the exact same return values which resonator.py expects. @DennisRieger could you maybe have a look at it and fix it in the resonator.py?

@DaBiebs I think it makes much more sense to have both versions of the fit working as expected instead of simply ignoring the error on v1. In the mean time, you can simply use the following code to circumvent this issue without touching the config file:

import qkit
qkit.cfg['circle_fit_version'] = 2
qkit.start()
....
DaBiebs commented 2 years ago

Yeah I can take a look!

Edit: I misread your above comment and thought you asked me to look. Thanks for the workaround! If @DennisRieger doesn't have time I can look as well, but unless told otherwise I will sit tight. From about 10 minutes of looking, it appears that circle_fit_version == 1 implied that the author wanted to use circle_fit_classic.circuit instead of circle_fit_2019.circuit.... Since the classic version doesn't have an autofit it won't be very plug and play.

Probably the best solution is to either:

  1. delete the "classic" and assume that people will/should use the newer version, or
  2. write an autofit for circle_fit_classic so that the two can swap, import both classes at the top, and then instantiate the correct class depending on the specified config
DennisRieger commented 2 years ago

The bug occured because the result keys were correctly chosen depending on the circle fit version but the imported (and therefore used) circle fit was hardcoded to the 2019 version 😃 Should be fixed by 7a02c202cec1b315634dd928193d28025daff86e.