From 23c619ca4c7202c1269a8bf65223f34901cf3598 Mon Sep 17 00:00:00 2001 From: JessicaJohnBritto <79603974+JessicaJohnBritto@users.noreply.github.com> Date: Thu, 19 Sep 2024 17:42:34 +0530 Subject: [PATCH] updated tutorials --- ...or Interactions and External Fields.ipynb} | 73 +++++++++++------ ...b => Type-2 Long Range Interactions.ipynb} | 79 ++++++++++++++----- 2 files changed, 112 insertions(+), 40 deletions(-) rename Tutorial Notebooks/{SS+S_NN.ipynb => Type-1 Nearest Neighbor Interactions and External Fields.ipynb} (99%) rename Tutorial Notebooks/{WalshPSeq_XX+YY_LongRangeInteractions.ipynb => Type-2 Long Range Interactions.ipynb} (99%) diff --git a/Tutorial Notebooks/SS+S_NN.ipynb b/Tutorial Notebooks/Type-1 Nearest Neighbor Interactions and External Fields.ipynb similarity index 99% rename from Tutorial Notebooks/SS+S_NN.ipynb rename to Tutorial Notebooks/Type-1 Nearest Neighbor Interactions and External Fields.ipynb index c8c28b4..4535d04 100644 --- a/Tutorial Notebooks/SS+S_NN.ipynb +++ b/Tutorial Notebooks/Type-1 Nearest Neighbor Interactions and External Fields.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "1e6f4176-5bd9-49d2-9405-7d95fd749e58", + "metadata": {}, + "source": [ + "# Type-1 Nearest Neighbor Interactions and External Fields" + ] + }, { "cell_type": "code", "execution_count": 5, @@ -13,11 +21,51 @@ }, { "cell_type": "markdown", - "id": "a3d3c926", + "id": "5147cf90-36bb-4cf9-983b-626294bce527", + "metadata": {}, + "source": [ + "## Introduction\n", + "An example of SS+S Nearest Neighbor Interactions and External Fields is demonstrated to decouple these interactions using Pulse sequences.\n", + "\n", + "Plot of $\\log(|1 - F|)$ vs Time is plotted for different values of $\\tau$ (this is the time period after which the pulse sequences are repeated upto Time $T$) for different values of $\\alpha$." + ] + }, + { + "cell_type": "markdown", + "id": "3f8e32d7-dda6-4d5b-9658-e9dfd70f83d6", + "metadata": {}, + "source": [ + "## Definitions" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9dd2e333-7914-4910-a697-5c34e3e00b31", + "metadata": {}, + "outputs": [], + "source": [ + "params = {\n", + "'N' : 1,\n", + "'tau_list':[1, 0.5, 0.1, 0.05],\n", + "'tau': 0.1,\n", + "'n': 2,\n", + "'alpha': 1,\n", + "'T': 10,\n", + "'R':[],\n", + "'r':[],\n", + "'psi_nm':[],\n", + "'opH': [X, Y], # Need to change this specific to Model\n", + "'pulses': [I, Z] # Need to change this specific to Model\n", + "}" + ] + }, + { + "cell_type": "markdown", + "id": "b1b6e6f8-3463-4c8a-9491-a8914964977d", "metadata": {}, "source": [ - "##### Here an example for SS+S Type Hamiltonians with nearest neighbor (NN) interactions is demonstrated to decouple these interactions using Pulse sequences. This can be also done for SS with NN interactions.\n", - "##### Plot of Log(|1 - F|) vs Time is plotted for different values of tau (this is the time period after which the pulse sequences are repeated upto Time T) and number of qubits. " + "## Plots" ] }, { @@ -98,26 +146,8 @@ } ], "source": [ - "params = {\n", - "'N' : 1,\n", - "'tau_list':[1, 0.5, 0.1, 0.05],\n", - "'tau': 0.1,\n", - "'n': 2,\n", - "'alpha': 1,\n", - "'T': 10,\n", - "'R':[],\n", - "'r':[],\n", - "'psi_nm':[],\n", - "'opH': [X, Y], # Need to change this specific to Model\n", - "'pulses': [I, Z] # Need to change this specific to Model\n", - "}\n", - "\n", - "# print(r)\n", - "# print(R)\n", "mss=10\n", "\n", - "# print(params['tau_list'])\n", - "\n", "for i in range(1, 8, 1):\n", " params['N'] = i\n", " params['pulses'] = [I, Z, X, Y]\n", @@ -137,7 +167,6 @@ " uOp, t = TimeEvolOpForTFH(params, TFH = TogglingFrame_Ising(params)+TogglingFrameH(params)) \n", " psi_t = [normalizeWF(u@psi_nm) for i,u in enumerate(uOp)]\n", " F = [1-np.power(np.abs(np.vdot(psi_nm, pt)), 2) for pt in psi_t]\n", - " # print(F)\n", " plt.plot(t, F, \"--o\", label = f\"τ={tau}\", ms=mss)\n", " mss -=2\n", " plt.yscale(\"log\")\n", diff --git a/Tutorial Notebooks/WalshPSeq_XX+YY_LongRangeInteractions.ipynb b/Tutorial Notebooks/Type-2 Long Range Interactions.ipynb similarity index 99% rename from Tutorial Notebooks/WalshPSeq_XX+YY_LongRangeInteractions.ipynb rename to Tutorial Notebooks/Type-2 Long Range Interactions.ipynb index ae893c2..4529dfa 100644 --- a/Tutorial Notebooks/WalshPSeq_XX+YY_LongRangeInteractions.ipynb +++ b/Tutorial Notebooks/Type-2 Long Range Interactions.ipynb @@ -1,5 +1,21 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "957703ca-a702-4036-ad19-ef0d077815dd", + "metadata": {}, + "source": [ + "# Type-2 Long Range Interactions" + ] + }, + { + "cell_type": "markdown", + "id": "d09d3745-72a5-440e-9d94-63578b3d621b", + "metadata": {}, + "source": [ + "## Importing Packages" + ] + }, { "cell_type": "code", "execution_count": 1, @@ -13,12 +29,23 @@ }, { "cell_type": "markdown", - "id": "3a98fadb", + "id": "3fd2e73d-502c-4964-92da-c400d2d52968", "metadata": {}, "source": [ - "##### Here an example for XX+YY Long-range interacting Hamiltonians is demonstrated to decouple these interactions using Walsh Pulse sequences. \n", - "##### Plot of Log(|1 - F|) vs Time is plotted for different values of tau (this is the time period after which the pulse sequences are repeated upto Time T) for different values of α.\n", - "#### α = 0.5: Trapped Ion Systems, α = 3: Dipolar Systems" + "## Introduction\n", + "An example of XX+YY Long-range interacting Hamiltonians is demonstrated to decouple these interactions using Walsh Pulse sequences.\n", + "\n", + "Plot of $\\log(|1 - F|)$ vs Time is plotted for different values of $\\tau$ (this is the time period after which the pulse sequences are repeated upto Time $T$) for different values of $\\alpha$.\n", + "\n", + "$\\alpha = 0.5$: Trapped Ion Systems, $\\alpha = 3$: Dipolar Systems" + ] + }, + { + "cell_type": "markdown", + "id": "4eb10dfd-54ee-46c0-960c-8eedfa1d329d", + "metadata": {}, + "source": [ + "## Definitions" ] }, { @@ -42,6 +69,36 @@ "}" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "e3ce8b18-b190-4e44-bd45-a22c546d172d", + "metadata": {}, + "outputs": [], + "source": [ + "params['alpha_list'] = [0.5, 1, 2, 3, 6]\n", + "params['tau_list'] = [0.05, 0.1, 0.5, 1]\n", + "params['alpha'] = params['alpha_list'][0]\n", + "max_index = 8\n", + "Wx, Wy = list(range(0, max_index, 1)), list(range(0, max_index, 1))\n", + "# Wx, Wy = [3, 4], [3, 4]\n", + "params['N'] = len(Wx)\n", + "params['pulses'] = WF_WIList(params, Wx = Wx, Wy = Wy)\n", + "Pseq = params['pulses']\n", + "params['n'] = len(params['pulses'])\n", + "params['opH'] = [X, Y] \n", + "n, N, r, op, pulses, psi_nm, R, alpha = initialVals(params)\n", + "params['R'], params['r'] = R, r" + ] + }, + { + "cell_type": "markdown", + "id": "75e7745e-35fe-4f00-b5fb-11f32d7d1622", + "metadata": {}, + "source": [ + "## Plots" + ] + }, { "cell_type": "code", "execution_count": 3, @@ -100,20 +157,6 @@ } ], "source": [ - "params['alpha_list'] = [0.5, 1, 2, 3, 6]\n", - "params['tau_list'] = [0.05, 0.1, 0.5, 1]\n", - "params['alpha'] = params['alpha_list'][0]\n", - "max_index = 8\n", - "Wx, Wy = list(range(0, max_index, 1)), list(range(0, max_index, 1))\n", - "# Wx, Wy = [3, 4], [3, 4]\n", - "params['N'] = len(Wx)\n", - "params['pulses'] = WF_WIList(params, Wx = Wx, Wy = Wy)\n", - "Pseq = params['pulses']\n", - "params['n'] = len(params['pulses'])\n", - "params['opH'] = [X, Y] \n", - "n, N, r, op, pulses, psi_nm, R, alpha = initialVals(params)\n", - "params['R'], params['r'] = R, r\n", - "\n", "for alpha in params['alpha_list']:\n", " params['alpha'] = alpha\n", "\n",