OxfordIonTrapGroup / oitg

Python package of helper routines (result loading, fitting, etc) for the Oxford Ion-Trap Group (OITG).
https://oxfordiontrapgroup.github.io/oitg/
13 stars 9 forks source link

Rabi-oscillation detuning scan with a floated pulse area. #21

Closed pathfinder49 closed 4 years ago

pathfinder49 commented 5 years ago

As requested here.

Good fitting required modification of FitBase to automatically find the parameter scale.

dnadlinger commented 5 years ago

Thanks, I'll give it a go in the lab.

pathfinder49 commented 5 years ago

Hm... the test case can't seem to load data from a file. will revert back to previous version.

pathfinder49 commented 5 years ago

If you're happy with this I'll merge.

dnadlinger commented 5 years ago

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?

pathfinder49 commented 5 years ago

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.

dnadlinger commented 4 years ago

Test failure was unrelated; the test_sinusoid randomised tests fail too frequently (I've increased the acceptable delta).

pathfinder49 commented 4 years ago

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?

dnadlinger commented 4 years ago

Hmm, true, might be – I've seen a similar failure once before, though.

pathfinder49 commented 4 years ago

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.

pathfinder49 commented 4 years ago

I'll merge once someone has reviewed the FitBase changes.