{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Hyperfine Structure: Sech Pulse 2π, q=1 — Self-Induced Transparency\n", "\n", "$^{87}\\mathrm{Rb}$ driven on the $5S_{1/2} F=1 \\rightarrow 5p_{1/2} F=1$ transition." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from maxwellbloch import hyperfine\n", "\n", "Rb87_5s12_F1 = hyperfine.LevelF(I=1.5, J=0.5, F=1)\n", "Rb87_5s12_F2 = hyperfine.LevelF(I=1.5, J=0.5, F=2) # Needed for decay\n", "\n", "Rb87_5p12_F1 = hyperfine.LevelF(I=1.5, J=0.5, F=1)\n", "\n", "atom1e = hyperfine.Atom1e(element=\"Rb\", isotope=\"87\")\n", "\n", "atom1e.add_F_level(Rb87_5s12_F1)\n", "atom1e.add_F_level(Rb87_5s12_F2)\n", "atom1e.add_F_level(Rb87_5p12_F1)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "NUM_STATES = atom1e.get_num_mF_levels()\n", "print(NUM_STATES)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ENERGIES = atom1e.get_energies()\n", "print(ENERGIES)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Tune to be on resonance with the F1 -> F1 transition\n", "DETUNING = 0\n", "print(DETUNING)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "FIELD_CHANNELS = atom1e.get_coupled_levels(F_level_idxs_a=(0,), F_level_idxs_b=(2,))\n", "print(FIELD_CHANNELS)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "q = 1 # Field polarisation\n", "FIELD_FACTORS = atom1e.get_clebsch_hf_factors(\n", " F_level_idxs_a=(0,), F_level_idxs_b=(2,), q=q\n", ")\n", "print(FIELD_FACTORS)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "strength_factor = np.sum(FIELD_FACTORS**2)\n", "print(strength_factor)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1/6 is the strength factor S_11" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "hf_factor = np.max(FIELD_FACTORS)\n", "print(hf_factor)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "DECAY_CHANNELS = atom1e.get_coupled_levels(F_level_idxs_a=(0, 1), F_level_idxs_b=(2,))\n", "print(DECAY_CHANNELS)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "DECAY_FACTORS = atom1e.get_decay_factors(F_level_idxs_a=(0, 1), F_level_idxs_b=(2,))\n", "print(DECAY_FACTORS)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "INITIAL_STATE = (\n", " [1.0 / 3.0] * 3 # s12_F1\n", " + [0.0 / 5.0] * 5 # s12_F2\n", " + [0.0] * 3\n", ") # p12_F1\n", "print(INITIAL_STATE)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sech_fwhm_conv = 1.0 / 2.6339157938\n", "WIDTH = 1.0 * sech_fwhm_conv # [τ]\n", "print(\"WIDTH\", WIDTH)\n", "\n", "n = 2.0 # For a pulse area of nπ\n", "AMPL = n / WIDTH / (2 * np.pi) # Pulse amplitude [2π Γ]\n", "\n", "AMPL *= 1 / hf_factor\n", "\n", "print(\"ampl\", AMPL)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "mb_solve_json = \"\"\"\n", "{{\n", " \"atom\": {{\n", " \"decays\": [\n", " {{\n", " \"channels\": {decay_channels},\n", " \"rate\": 0.0,\n", " \"factors\": {decay_factors}\n", " }}\n", " ],\n", " \"energies\": {energies},\n", " \"fields\": [\n", " {{\n", " \"coupled_levels\": {field_channels},\n", " \"factors\": {field_factors},\n", " \"detuning\": {detuning},\n", " \"detuning_positive\": true,\n", " \"label\": \"probe\",\n", " \"rabi_freq\": 1.0,\n", " \"rabi_freq_t_args\": {{\n", " \"ampl\": {ampl},\n", " \"centre\": 0.0,\n", " \"width\": {width}\n", " }},\n", " \"rabi_freq_t_func\": \"sech\"\n", " }}\n", " ],\n", " \"num_states\": {num_states},\n", " \"initial_state\": {initial_state}\n", " }},\n", " \"t_min\": -2.0,\n", " \"t_max\": 10.0,\n", " \"t_steps\": 100,\n", " \"z_min\": -0.5,\n", " \"z_max\": 1.5,\n", " \"z_steps\": 100,\n", " \"z_steps_inner\": 1,\n", " \"num_density_z_func\": \"square\",\n", " \"num_density_z_args\": {{\n", " \"on\": 0.0,\n", " \"off\": 1.0,\n", " \"ampl\": 1.0\n", " }},\n", " \"interaction_strengths\": [\n", " 5.0e2\n", " ],\n", " \"velocity_classes\": null,\n", " \"method\": \"mesolve\",\n", " \"opts\": {{\n", " \"method\": \"bdf\", \n", " \"atol\": 1e-8, \n", " \"rtol\": 1e-6,\n", " \"nsteps\": 1e2\n", " }},\n", " \"savefile\": \"mbs-Rb87_5s12_5p12_F11_q1-sech-2pi\"\n", "}}\n", "\"\"\".format(\n", " num_states=NUM_STATES,\n", " energies=ENERGIES,\n", " initial_state=INITIAL_STATE,\n", " detuning=DETUNING,\n", " field_channels=FIELD_CHANNELS,\n", " field_factors=FIELD_FACTORS.tolist(),\n", " decay_channels=DECAY_CHANNELS,\n", " decay_factors=DECAY_FACTORS.tolist(),\n", " ampl=float(AMPL),\n", " width=WIDTH,\n", ")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from maxwellbloch import mb_solve\n", "\n", "mbs = mb_solve.MBSolve().from_json_str(mb_solve_json)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%time Omegas_zt, states_zt = mbs.mbsolve(recalc=True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "\n", "%matplotlib inline\n", "import seaborn as sns\n", "\n", "sns.set_style(\"darkgrid\")\n", "\n", "import numpy as np" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fig = plt.figure(1, figsize=(16, 6))\n", "ax = fig.add_subplot(111)\n", "# cmap_range = np.linspace(0.0, 12, 11)\n", "cf = ax.contourf(\n", " mbs.tlist,\n", " mbs.zlist,\n", " np.abs(mbs.Omegas_zt[0] / (2 * np.pi)),\n", " # cmap_range,\n", " cmap=plt.cm.Blues,\n", ")\n", "ax.set_title(r\"Rabi Frequency ($\\Gamma / 2\\pi $)\")\n", "ax.set_xlabel(r\"Time ($1/\\Gamma$)\")\n", "ax.set_ylabel(\"Distance ($L$)\")\n", "ax.grid(alpha=0.5)\n", "ax.set_axisbelow(False)\n", "for y in [0.0, 1.0]:\n", " ax.axhline(y, c=\"grey\", lw=1.0, ls=\"dotted\")\n", "plt.colorbar(cf);" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fig = plt.figure(1, figsize=(16, 6))\n", "ax = fig.add_subplot(111)\n", "# cmap_range = np.linspace(0.0, 1.0e-3, 11)\n", "cf = ax.contourf(\n", " mbs.tlist,\n", " mbs.zlist,\n", " np.abs(mbs.populations_field(0, upper=False)),\n", " # cmap_range,\n", " cmap=plt.cm.Reds,\n", ")\n", "ax.set_title(r\"Rabi Frequency ($\\Gamma / 2\\pi $)\")\n", "ax.set_xlabel(r\"Time ($1/\\Gamma$)\")\n", "ax.set_ylabel(\"Distance ($L$)\")\n", "for y in [0.0, 1.0]:\n", " ax.axhline(y, c=\"grey\", lw=1.0, ls=\"dotted\")\n", "plt.colorbar(cf);" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fig = plt.figure(1, figsize=(16, 6))\n", "ax = fig.add_subplot(111)\n", "# cmap_range = np.linspace(0.0, 1.0e-3, 11)\n", "cf = ax.contourf(\n", " mbs.tlist,\n", " mbs.zlist,\n", " np.imag(mbs.coherences_field(0)),\n", " # cmap_range,\n", " cmap=plt.cm.Greens,\n", ")\n", "ax.set_title(r\"Rabi Frequency ($\\Gamma / 2\\pi $)\")\n", "ax.set_xlabel(r\"Time ($1/\\Gamma$)\")\n", "ax.set_ylabel(\"Distance ($L$)\")\n", "for y in [0.0, 1.0]:\n", " ax.axhline(y, c=\"grey\", lw=1.0, ls=\"dotted\")\n", "plt.colorbar(cf);" ] } ], "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.3" } }, "nbformat": 4, "nbformat_minor": 2 }