Closed pathfinder49 closed 4 years ago
Thanks, I'll give it a go in the lab.
Hm... the test case can't seem to load data from a file. will revert back to previous version.
If you're happy with this I'll merge.
I don't find the named detuned_pulse_area
very descriptive at all – physically, the fit corresponds to a detuning scan of a square pulse over a two-level transition, or mathematically a generalised sinc^2 shape. (If the pulse is not square, then the frequency response – the Fourier transform of the aperture – won't be of a sinc^2 type.)
Actually, from a (my) user's perspective, this is exactly the same as sinc_2 with one more parameter floated, and I don't expect to use bare sinc_2 much, as for already close-to-calibrated pulses, I'd use a two-point servo instead. Perhaps merging this into a single sinc_2 implementation for both cases would be worth it?
I agree this implementation is more likely to be used than sinc^2. However, sinc^2 fitting can make better initial guesses.
I agree detuned_square_pulse
would be a better name.
Test failure was unrelated; the test_sinusoid randomised tests fail too frequently (I've increased the acceptable delta).
I'm seeing degraded fit performance in some instances using method='trf'
and x_scale='jac'
. Are you sure this is not a symtom of the PR?
Hmm, true, might be – I've seen a similar failure once before, though.
I've updated the x_scale to be inferred from the initial guess. This improves reliability with the old sinusoid test cases. However the detuned_pulse area tests now fail. I'll look into making the detuned_square_pulse initialiser smarter.
I'll merge once someone has reviewed the FitBase changes.
As requested here.
Good fitting required modification of FitBase to automatically find the parameter scale.