{ "cells": [ { "cell_type": "markdown", "id": "ea0c6247-b962-4857-b14b-ba05e31d067b", "metadata": {}, "source": [ "# Time dependence - create detuning" ] }, { "cell_type": "code", "execution_count": 1, "id": "674ccb7a-bb6c-42bc-b4ea-9d2ed67f9e52", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[-400. -399.6 -399.2 ... 398.8 399.2 399.6]\n" ] } ], "source": [ "import nexus as nx\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "# define a phase jump function\n", "class PhaseJump(nx.FunctionTime):\n", "\n", " def __init__(self, t0):\n", " super().__init__(\"phase jump\")\n", " self.t0 = t0\n", "\n", " def Function(self, time):\n", " phase = 0\n", " if time > self.t0:\n", " phase = np.pi\n", " return phase\n", "\n", "func = PhaseJump(20)\n", "\n", "# get the special detuning grid needed for calculations in the energy domain\n", "detuning = func.CreateDetuning(400, 2000)\n", "\n", "print(detuning)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.12.0" } }, "nbformat": 4, "nbformat_minor": 5 }