In [6]:
import numpy as np
import matplotlib as plt
from scipy.optimize import leastsq

Program to fit Rabi oscilations


In [7]:
def Rabi_fit(t,par):
    """ Program to fit Rabi Oscillation
    par : A,B,C,D,E
    """
    A,B,C,D,E = par
    F = A + B*np.exp(-t/C)*np.cos(2*np.pi*t/D + E)
    return F
def residual(data, t , par):
    """ Minimize function
    """
    diff = Rabi_fit(t,par) - dat
    return  diff

In [10]:
ls


Device  Estimation .ipynb
Program Recover IQ from pulsed data.ipynb
Rabi Fit.ipynb
Simulation cavity qubit filter.ipynb
data/

In [ ]:


In [ ]:
A =
B =
C =
D =
E =

In [9]:
par_init = A, B, C, D, E


best, cov, info, message, ier = leastsq(residual, par_init, args=(Data),\
                                        full_output=True,ftol=1e-15,xtol=1e-15,gtol=1e-12, maxfev=100000 )


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-9-69730c8fa6c3> in <module>()
      1 
----> 2 par_init = A,B, C, D, E
      3 
      4 
      5 best, cov, info, message, ier = leastsq(residual, par_init, args=(Data),                                        full_output=True,ftol=1e-15,xtol=1e-15,gtol=1e-12, maxfev=100000 )

NameError: name 'A' is not defined

In [ ]: