def getTTF(fitObject): if fitObject.fitFunction == FIT_FUNCTIONS.index('Fermi-Dirac'): TTF = (6.0 * polylog.fermi_poly3(fitObject.fitData[6]))**(-1.0 / 3.0) TTFErr = 0.5 * ((6.0 * polylog.fermi_poly3( fitObject.fitData[6] - fitObject.fitDataConf[6]))**(-1.0 / 3.0) - (6.0 * polylog.fermi_poly3(fitObject.fitData[6] + fitObject.fitDataConf[6]))** (-1.0 / 3.0)) return TTF, TTFErr else: print('T/TF only available for Fermi-Dirac fit.') return -1, -1
def cloudsize(ToverTF, N, tof, wr, wz): """Calculate the cloud size of an ideal Fermi gas **Inputs** * ToverTF: float, temperature in units of the Fermi temperature T_F * N: float, number of atoms * tof: float, time-of-flight in seconds * wr: float, radial trap frequency in Hz * wz: float, axial trap frequency in Hz **Outputs** * bprime: the size of the cloud in meters [1], (p.69, there called Ri) **References** [1] "Making, probing and understanding ultracold Fermi gases", W. Ketterle and M. Zwierlein, arXiv:cond-mat/0801.2500 (2008) """ a = fugacity(ToverTF) fa = np.log(1+np.e**a)*(1+np.e**a)/np.e**a TF = hbar/kb*(6*N*wr**2*wz)**(1./3) T = TF*(6*fermi_poly3(a))**(-1./3) mass = 6*mp bprime = expansionfactor(tof, wr)*fa*np.sqrt(2*kb*T/(mass*wr**2)) return bprime
def fugacity(ToverTF): """Calculate the log of the fugacity e^{\beta\mu}""" minpoly3 = lambda x, num: fermi_poly3(x) - num a = sp.optimize.brentq(minpoly3, -1e3, 1e3, args=(ToverTF**(-3)/6)) return a
def cloudsize(ToverTF, N, tof, wr, wz): """Calculate the cloud size of an ideal Fermi gas **Inputs** * ToverTF: float, temperature in units of the Fermi temperature T_F * N: float, number of atoms * tof: float, time-of-flight in seconds * wr: float, radial trap frequency in Hz * wz: float, axial trap frequency in Hz **Outputs** * bprime: the size of the cloud in meters [1], (p.69, there called Ri) **References** [1] "Making, probing and understanding ultracold Fermi gases", W. Ketterle and M. Zwierlein, arXiv:cond-mat/0801.2500 (2008) """ a = fugacity(ToverTF) fa = np.log(1 + np.e**a) * (1 + np.e**a) / np.e**a TF = hbar / kb * (6 * N * wr**2 * wz)**(1. / 3) T = TF * (6 * fermi_poly3(a))**(-1. / 3) mass = 6 * mp bprime = expansionfactor(tof, wr) * fa * np.sqrt(2 * kb * T / (mass * wr**2)) return bprime
def ideal_fermi_numbers(fitparams, pixcal, sigma=None): """Determine T/T_F and N for an ideal Fermi gas. **Inputs** * fitparams: the result of fitting the image with ideal_fermi_radial fitparams is a list containing the central optical density, logarithm of the fugacity and thermal radius of the cloud in pixels * pixcal: calibration for the camera in meters per pixel **Outputs** * ToverTF: temperature of the Fermi gas T/T_F * N: number of atoms **Optional inputs** * sigma: photon absorption cross-section the default value is the resonant cross-section for 6Li """ if sigma==None: sigma = 3*671e-9**2/(2*np.pi) mubeta = fitparams[1] ToverTF = (6*fermi_poly3(mubeta))**(-1./3) N = pixcal**2*sp.integrate.quad(n2D_radial, 0, np.infty,\ args=(ideal_fermi_radial, fitparams))[0]/sigma return ToverTF, N
def fugacity(ToverTF): """Calculate the log of the fugacity e^{\beta\mu}""" minpoly3 = lambda x, num: fermi_poly3(x) - num a = sp.optimize.brentq(minpoly3, -1e3, 1e3, args=(ToverTF**(-3) / 6)) return a
def ideal_fermi_numbers_2D_angled(fitparams, pixcal, sigma=None): """Determine T/T_F and N for an ideal Fermi gas. **Inputs** * fitparams: array_like An array containing the central optical density, logarithm of the fugacity and thermal radius of the cloud in pixels. * pixcal: float, Calibration for the camera in meters per pixel. **Outputs** * ToverTF: temperature of the Fermi gas T/T_F * N: number of atoms **Optional inputs** * sigma: photon absorption cross-section The default value is the resonant cross-section for 6Li. """ if sigma == None: sigma = 3 * 671e-9**2 / (2 * np.pi) mubeta = fitparams[5] ToverTF = (6 * fermi_poly3(mubeta))**(-1. / 3) x, y, sx, sy = fitparams[0:4] sx = max(sx, 5) sy = max(sy, 5) [X, Y] = np.mgrid[x - 5 * sx:x + 5 * sx, y - 5 * sy:y + 5 * sy] newparams = [ fitparams[0], fitparams[1], fitparams[2], fitparams[3], fitparams[4], fitparams[5], 0., 0., 0. ] odimg_fitted = idealfermi_2D(newparams, X, Y) N = odimg_fitted.sum() * pixcal**2 / sigma return ToverTF, N
def ideal_fermi_numbers_2D_angled(fitparams, pixcal, sigma=None): """Determine T/T_F and N for an ideal Fermi gas. **Inputs** * fitparams: array_like An array containing the central optical density, logarithm of the fugacity and thermal radius of the cloud in pixels. * pixcal: float, Calibration for the camera in meters per pixel. **Outputs** * ToverTF: temperature of the Fermi gas T/T_F * N: number of atoms **Optional inputs** * sigma: photon absorption cross-section The default value is the resonant cross-section for 6Li. """ if sigma==None: sigma = 3*671e-9**2/(2*np.pi) mubeta = fitparams[5] ToverTF = (6*fermi_poly3(mubeta))**(-1./3) x, y, sx, sy = fitparams[0:4] sx=max(sx,5) sy=max(sy,5) [X, Y] = np.mgrid[x-5*sx:x+5*sx, y-5*sy:y+5*sy] newparams=[fitparams[0],fitparams[1],fitparams[2],fitparams[3],fitparams[4],fitparams[5],0.,0.,0.] odimg_fitted = idealfermi_2D(newparams, X, Y) N = odimg_fitted.sum() * pixcal**2 / sigma return ToverTF, N
def test_fermi_poly3_float(self): testfloat = 1. assert_approx_equal(- lerch.Li(3, -np.exp(testfloat)), \ polylog.fermi_poly3(testfloat), significant=7)
def test_fermi_poly3_array(self): fp_approx1 = polylog.fermi_poly3(self.xx1) # the polynomial approximation should be good to 1e-7, fails for # higher precision test assert_array_almost_equal(self.exact1, fp_approx1, decimal=7)
def best_fugacity(logfugacity): return abs(ToverTF - (6*fermi_poly3(logfugacity))**(-1./3))