Skip to content

Commit

Permalink
updated tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaJohnBritto committed Sep 19, 2024
1 parent 5c8090b commit 23c619c
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -13,11 +21,51 @@
},
{
"cell_type": "markdown",
"id": "a3d3c926",
"id": "5147cf90-36bb-4cf9-983b-626294bce527",
"metadata": {},
"source": [
"## <font>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$.</font>"
]
},
{
"cell_type": "markdown",
"id": "3f8e32d7-dda6-4d5b-9658-e9dfd70f83d6",
"metadata": {},
"source": [
"## <font>Definitions</font>"
]
},
{
"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. "
"## <font>Plots</font>"
]
},
{
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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": [
"## <font>Importing Packages</font>"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand All @@ -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"
"## <font>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</font>"
]
},
{
"cell_type": "markdown",
"id": "4eb10dfd-54ee-46c0-960c-8eedfa1d329d",
"metadata": {},
"source": [
"## <font>Definitions</font>"
]
},
{
Expand All @@ -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": [
"## <font>Plots</font>"
]
},
{
"cell_type": "code",
"execution_count": 3,
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 23c619c

Please sign in to comment.