From 4cd54a299cbfc7a308437cd910e672f7d5d1a8c1 Mon Sep 17 00:00:00 2001 From: lhoenen Date: Tue, 6 May 2025 14:44:13 +0200 Subject: [PATCH] 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. --- common.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/common.py b/common.py index a206edd..2d9fa98 100644 --- a/common.py +++ b/common.py @@ -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)