Updated Version, patching the mass of the atoms.

This is rather a dirty fix. The mass gained a factor 2pi now everything is consistent. But this is rather a dirty fix, the 2pi factor should be included elsewhere.
This commit is contained in:
lhoenen 2025-05-06 14:44:13 +02:00
parent a1cd30886d
commit 4cd54a299c

View File

@ -343,7 +343,7 @@ def calc_force_profile_Single_Beam(Isotope_name, params, resolution_x, resolutio
muB = 1
k = k_lab*x0
gamma = gamma_lab*t0
mass = Isotope.mass*(x0/100)**2/(cts.h * t0)
mass = Isotope.mass*(x0/100)**2/(cts.h *2*np.pi* t0)
det = params["det"]
s = params["s"]
@ -443,7 +443,7 @@ def calc_force_field_and_trajectories_Single_Beam(Isotope_name, params, resoluti
muB = 1
k = k_lab*x0
gamma = gamma_lab*t0
mass = Isotope.mass*(x0/100)**2/(cts.h * t0)
mass = Isotope.mass*(x0/100)**2/(cts.h *2*np.pi *t0)
det = params["det"]
s = params["s"]
@ -538,8 +538,10 @@ def calc_force_field_and_trajectories_Single_Beam(Isotope_name, params, resoluti
check2, path2 = get_data_filepath_and_check('Solutions', 'sol'+Isotope_name+basename+str(round(v0*(x0/(100*t0))))+'mps', '.pkl')
Rateeq.set_initial_position_and_velocity(np.array([initial_position, 0., 0.]), np.array([v0, 0, 0]))
if isinstance(Rateeq, pylcp.rateeq):
Rateeq.set_initial_pop(np.ones(len(basis_e)+len(basis_g))/(len(basis_e)+len(basis_g)))
initial_pop = np.zeros(len(basis_g)+len(basis_e))
initial_pop[0] = 1
print("WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! You've changed the population.")
Rateeq.set_initial_pop(initial_pop)#np.concatenate([np.ones(len(basis_g))/len(basis_g), np.zeros(len(basis_e))]))
print("Calculating Trajectory:", i+1, "out of ", len(v0s))
Rateeq.evolve_motion([0., t_max/t0], max_step=1e-4/t0, boundary=boundary, progress_bar=True)
@ -563,11 +565,11 @@ def calc_force_field_and_trajectories_angled_2DMOT(Isotope_name, params, resolut
muB = 1
k = k_lab*x0
gamma = gamma_lab*t0
mass = Isotope.mass*(x0/100)**2/(cts.h * t0)
mass = Isotope.mass*(x0/100)**2/(cts.h * t0*2*np.pi) #"artificial" 2pi factor is to "correct" units
det = params["det"]
s = params["s"]
field_mag = params["field_mag_Gauss_cm"]*1e-4
field_mag = params["field_mag_Gauss_cm"]*1e-4 #in Tesla/cm
field_type = params["field_type"]
waist = params["waist_m"]/(x0/100)
@ -596,7 +598,7 @@ def calc_force_field_and_trajectories_angled_2DMOT(Isotope_name, params, resolut
LaserBeams = init_LaserBeams2DMOT(detuning=det_L, saturation=s, beam_waist=waist, aperture=aperture, k=k)
if field_type == "2DMOT":
alpha_2DMOT = field_mag * cts.value('Bohr magneton') * x0 * t0 / cts.h #field mag is given as Gauss/cm
alpha_2DMOT = field_mag * cts.value('Bohr magneton') * x0 * t0 / cts.h #field mag is given as Tesla/cm
magField = pylcp.fields.magField(lambda R: [-alpha_2DMOT*R[1],-alpha_2DMOT*R[0],0])
else:
raise ValueError("Error: Unrecognised field type. Field Type has to be '2DMOT'.")
@ -668,8 +670,7 @@ def calc_force_field_and_trajectories_angled_2DMOT(Isotope_name, params, resolut
check2, path2 = get_data_filepath_and_check('Solutions', 'sol'+Isotope_name+basename+str(round(v0*(x0/(100*t0))))+'mps', '.pkl')
Rateeq.set_initial_position_and_velocity(np.array([initial_position, 0., 0.]), np.array([v0, 0, 0]))
if isinstance(Rateeq, pylcp.rateeq):
Rateeq.set_initial_pop(np.ones(len(basis_e)+len(basis_g))/(len(basis_e)+len(basis_g)))
Rateeq.set_initial_pop(np.concatenate([np.ones(len(basis_g))/len(basis_g), np.zeros(len(basis_e))]))
print("Calculating Trajectory:", i+1, "out of ", len(v0s))
Rateeq.evolve_motion([0., t_max/t0], max_step=1e-4/t0, boundary=boundary, MOTradius=MOTradius, MOTvelocity=MOTvelocity, progress_bar=True)