bleykauf / aisim

Simulations for light-pulse atom interferometry
GNU General Public License v3.0
8 stars 5 forks source link

Propagator class for spatial superposition in z direction #44

Closed savowe closed 4 years ago

savowe commented 4 years ago

closes #35

working example:

import numpy as np
import matplotlib.pyplot as plt
import aisim as ais

pos_params = {
    'mean_x': 0.0,
    'std_x': 3.0e-3,  # cloud radius in m
    'mean_y': 0.0,
    'std_y': 3.0e-3,  # cloud radius in m
    'mean_z': 0.0,
    'std_z': 0,        # ignore z dimension, its not relevant here
}
vel_params = {
    'mean_vx': 0.0,
    # cloud velocity spread in m/s at tempearture of 3 uK
    'std_vx': ais.convert.vel_from_temp(3.0e-6),
    'mean_vy': 0.0,
    # cloud velocity spread in m/s at tempearture of 3 uK
    'std_vy': ais.convert.vel_from_temp(3.0e-6),
    'mean_vz': 0.0,
    'std_vz': ais.convert.vel_from_temp(0),
}

atoms = ais.create_random_ensemble_from_gaussian_distribution(
    pos_params, vel_params, int(1e4), state_kets=[0, 0, 0, 0, 1, 0])

center_Rabi_freq = 2*np.pi*12.5e3
r_beam = 29.5e3 / 2  # 1/e^2 beam radius in m
intensity_profile = ais.IntensityProfile(r_beam, center_Rabi_freq)
wave_vectors = ais.Wavevectors(k1=8.052945514e6, k2=-8.052802263e6)

BS = ais.SpatialSuperpositionTransitionPropagator(
    20e-6, intensity_profile=intensity_profile, wave_vectors=wave_vectors,
    n_pulses=3)
FP = ais.SpatialSuperpositionFreePropagator(230e-3, n_pulses=3)
M = ais.SpatialSuperpositionTransitionPropagator(
    40e-6, intensity_profile=intensity_profile, wave_vectors=wave_vectors,
    n_pulses=3)

atoms = BS.propagate(atoms)
atoms = FP.propagate(atoms)
atoms = M.propagate(atoms)
atoms = FP.propagate(atoms)
atoms = BS.propagate(atoms)
coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling c545979b989393a42266e9eed03f57643ad7084f on 35-superposition-z into 3e186208d59be49e3dcbe25c954299cb3477ddf6 on master.

bleykauf commented 4 years ago

Flake8 complaints will now cause failed builds in Travis CI, see output for details. Also works for violations of docstring conventions.

bleykauf commented 4 years ago

The tests still fail when setting the rabi frequency too low, i.e. realistic physical values, even after making the propagator symmetric. I made the tests for the propagator a little bit more convient to work with (pi_half_time can be used to change the Rabi frequency and the time step for the propagator).

@savowe: any ideas?

savowe commented 4 years ago

The tests still fail when setting the rabi frequency too low, i.e. realistic physical values, even after making the propagator symmetric. I made the tests for the propagator a little bit more convient to work with (pi_half_time can be used to change the Rabi frequency and the time step for the propagator).

@savowe: any ideas?

fixed with dd8b25f