Boulder-Cryogenic-Quantum-Testbed / scresonators

Data analysis code for cryogenic resonator measurement
MIT License
28 stars 24 forks source link

Default parameters fixed in the user example file #115

Closed shengng closed 1 year ago

shengng commented 2 years ago

I just realized that there is a line making parameters be fixed in the user_example file (there is only a user_testing.py file left), and that would give a big error in the confidence intervals. Please rewrite the "MC_fix =[]" in the user_example.py file, which will give the most tunability and more accurate for the final result.

shengng commented 2 years ago

Another issue I found out is that the error of the internal will become insanely large even though we get more reasonable error for the resonator's frequency. On the other hand, if we fix the resonator's frequency w1 like the default user file did, we will get into the same issue mentioned above in this thread.

In order to figure out what makes the results so different, I compared the old-version code (right) and the latest-version code (left), one main paragraph of lines causing this issue is shown in this figure when it tries to define the initial condition for the fitting_S data. image In the old-version fit_S_data.py file, it assigns all parameters to be variable. It turns out to give reasonable error in my opinion with w1 being fixed in the user_example.py file. image In comparison, if we forced the w1 to be fixed in the line 1234 on the old-version code, we will get the similar error given by the current version of the fitting code with infinitely large error in the resonator frequency. image It is still not clear why this initial condition causes this huge difference in terms of error, and it should be studied in detail.

nmaterise commented 2 years ago

@shengng thanks for digging into this problem. I am assigned to address this problem in a separate issue (#98) that there is a bug in how the parameters are fixed in the Monte Carlo fitting loop. @nickkprice is working on a rewrite of the entire code, so that we can make changes like these to code in a more sustainable way.

crmcrae commented 1 year ago

Can this be closed?

scottito commented 1 year ago

It seems like the deeper issue is being handled on #98, but the user code has been changed not to fix w1, so I think this is safe to close.