diff --git a/exercise_1-atomic_clocks/Ramsey_Fringes-students.ipynb b/exercise_1-atomic_clocks/Ramsey_Fringes-students.ipynb new file mode 100644 index 0000000..e8d6b9e --- /dev/null +++ b/exercise_1-atomic_clocks/Ramsey_Fringes-students.ipynb @@ -0,0 +1,222 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from scipy.spatial.transform import Rotation as R\n", + "import scipy.integrate as integrate" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"\n", + "Parameters of the experiment.\n", + "To write greek letters in Jupyter, type for example \\gamma + Tab\n", + "\"\"\"\n", + "\n", + "Ω = 2*np.pi*14\n", + "τ = np.pi/2./Ω\n", + "T0 = 0.3" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"\n", + "Here, δ will be expressed directly in Hz and corresponds to δ/2π in the exercise sheet.\n", + "So whebn we use it as a hamiltonian parameter, it needs to be multiplied back by 2π\n", + "Equivalently, Ω is still an angular frequency and has to be defined as 2π x a frequency in Hz\n", + "\"\"\"\n", + "def interaction(Ω,δ) :\n", + " \"\"\"\n", + " rotation matrix for the interaction region :\n", + " the argument of this function is the rotation vector (norm and direction)\n", + " τ defines the interaction as π/2-pulse\n", + " \"\"\"\n", + " τ = np.pi/2./Ω\n", + " return R.from_rotvec(τ*np.array([Ω, 0.,2*np.pi*δ]))\n", + "\n", + "def free_evolution(δ,T0) :\n", + " \"\"\"\n", + " rotation matrix for the free-evolution ------- FILL IN\n", + " \"\"\"\n", + " return R.from_rotvec( )\n", + "\n", + "def sigma_expect(Ω,δ,T0) :\n", + " \"\"\"\n", + " expectation value for the Pauli operators (as a vector) ------- FILL IN\n", + " \n", + " the syntax for applying a rotation to a vector is for example :\n", + " interaction(Ω,δ).apply(initial_state)\n", + " \"\"\"\n", + " initial_state = np.array([0.,0.,1.])\n", + " return \n", + "\n", + "def proba_1(Ω,δ,T0) :\n", + " \"\"\"\n", + " Probability of detecting the atom in state |1> ------- FILL IN\n", + " \n", + " To take the z component of vector initial_state, the syntax would be initial_state[2]\n", + " \"\"\"\n", + " return " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "δ_array = np.arange(-50,50,0.1) ### values of δ where we want to evaluate our function proba_1\n", + "\n", + "result = np.array([proba_1(Ω,δ,T0) for δ in δ_array])\n", + "\n", + "plt.figure(figsize=(8,5))\n", + "plt.plot(δ_array,result)\n", + "plt.title('Ideal Ramsey fringes',fontsize=15)\n", + "plt.xlabel(r'detuning $δ$ (Hz)',fontsize=12)\n", + "plt.ylabel(r'$\\mathcal{P}_1$',fontsize=15)\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"\n", + "Parameters and constants for velocity distribution\n", + "\"\"\"\n", + "m = 2.2e-25 ; kb= 1.38e-23 ; g=9.8\n", + "\n", + "mean_velocity = 1.4\n", + "temperature = 1e-5\n", + "\n", + "def n(v,vbar,temp) :\n", + " \"\"\"\n", + " Probability to find an atom at velocity v, gievn the mean velocity vbar and temperature temp of the distribution ------- FILL IN\n", + " to take the square-root of a variable x , the syntax is np.sqrt(x)\n", + " \"\"\"\n", + " return \n", + "\n", + "def transit_time(v) :\n", + " \"\"\"\n", + " Time for an atom to cross the free-evolution region as a function of its velocity\n", + " \"\"\"\n", + " return 2*v/g\n", + "\n", + "def proba1_velocity (v,Ω,δ) :\n", + " \"\"\"\n", + " fringe signal for an atom at velocity v\n", + " \"\"\"\n", + " return proba_1(Ω,δ,transit_time(v))\n", + "\n", + "def proba1_integrand (v,Ω,δ,vbar,temp) :\n", + " \"\"\"\n", + " fringe signal for one velocity class v ------ FILL IN\n", + " will depend on temperature through the Blotzmann distribution n(v,vbar,temp)\n", + " \"\"\"\n", + " return \n", + "\n", + "def proba1_temperature (Ω,δ,vbar,temp) :\n", + " \"\"\"\n", + " integration of the fringe signal for all velocities - parameters are optimized\n", + " \"\"\"\n", + " return integrate.quad(proba1_integrand,-10.,10.,args=(Ω,δ,vbar,temp),points=np.linspace(-10.,10.,num=15))\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"\n", + "Evaluation of the Ramsey fringes at a a temperature of 10 μK\n", + "The integration takes a long time (a few minutes)\n", + "You can test your code by changing δ_array = np.arange(-50,50,0.1) to δ_array = np.arange(-50,50,5)\n", + "\"\"\"\n", + "\n", + "δ_array = np.arange(-50,50,0.1)\n", + "temp=1e-5\n", + "\n", + "result_temp = np.array([proba1_temperature(Ω,δ,mean_velocity,temp) for δ in δ_array])\n", + "\n", + "plt.figure(figsize=(8,5))\n", + "plt.plot(δ_array,result_temp[:,0])\n", + "\n", + "plt.title(f'Ramsey fringes at temperature T = {temp*1e6:.0f} μK',fontsize=15)\n", + "plt.xlabel(r'detuning $δ$ (Hz)',fontsize=12)\n", + "plt.ylabel(r'$\\mathcal{P}_1$',fontsize=15)\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"\n", + "Evaluation of the Ramsey fringes at a a temperature of 1 mK\n", + "The integration takes a long time (a few minutes)\n", + "You can test your code by changing δ_array = np.arange(-50,50,0.1) to δ_array = np.arange(-50,50,5)\n", + "\"\"\"\n", + "\n", + "δ_array = np.arange(-50,50,0.1)\n", + "temp=1e-3\n", + "\n", + "result_temp = np.array([proba1_temperature(Ω,δ,mean_velocity,temp) for δ in δ_array])\n", + "\n", + "plt.figure(figsize=(8,5))\n", + "plt.plot(δ_array,result_temp[:,0])\n", + "\n", + "plt.title(f'Ramsey fringes at temperature T = {temp*1e3:.0f} mK',fontsize=15)\n", + "plt.xlabel(r'detuning $δ$ (Hz)',fontsize=12)\n", + "plt.ylabel(r'$\\mathcal{P}_1$',fontsize=15)\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.0" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/exercise_1-atomic_clocks/ideal_ramsey.pdf b/exercise_1-atomic_clocks/ideal_ramsey.pdf new file mode 100644 index 0000000..6c907ed Binary files /dev/null and b/exercise_1-atomic_clocks/ideal_ramsey.pdf differ diff --git a/exercise_1-atomic_clocks/ramsey_10uK.pdf b/exercise_1-atomic_clocks/ramsey_10uK.pdf new file mode 100644 index 0000000..3100623 Binary files /dev/null and b/exercise_1-atomic_clocks/ramsey_10uK.pdf differ diff --git a/exercise_1-atomic_clocks/ramsey_1mK.pdf b/exercise_1-atomic_clocks/ramsey_1mK.pdf new file mode 100644 index 0000000..48ff197 Binary files /dev/null and b/exercise_1-atomic_clocks/ramsey_1mK.pdf differ