Skip to content

Commit

Permalink
Address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
a-corni committed Jan 15, 2025
1 parent c7fa7d2 commit fde7b8b
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions tutorials/creating_sequences.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This tutorial demonstrates how to use Pulser to program the evolution of a quantum system. In a first part, we excite one atom from its ground state to its excited state using a constant pulse. In a second part, we show how to prepare a quantum system of 9 atoms in an anti-ferromagnetic state using time-dependent pulses.\n",
"This tutorial demonstrates how to use Pulser to program the evolution of a quantum system. Two programs are presented:\n",
"\n",
"- [In a first part](#preparing-an-atom-in-the-rydberg-state), we excite one atom from its ground state to its excited state using a constant pulse. \n",
"- [In a second part](#adiabatic-preparation-of-an-anti-ferromagnetic-state), we show how to prepare a quantum system of 9 atoms in an anti-ferromagnetic state using time-dependent pulses.\n",
"\n",
"This tutorial follows the step-py-step guide on how to create a quantum program using Pulser that is provided in the [programming page](../programming.md). For more information regarding the steps followed and the mathematical objects at stake, please refer to this page."
]
Expand All @@ -38,11 +41,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"As presented in [\"Programming a neutral-atom QPU\"](../programming.md), Pulser enables you to program [an Hamiltonian](../programming.md) composed of an [interaction Hamiltonian](../programming.md) and a [drive Hamiltonian](../programming.md).\n",
"As presented in [\"Programming a neutral-atom QPU\"](../programming.md), Pulser enables you to program [an Hamiltonian](../programming.md#2-hamiltonian-evolves-the-state) composed of an [interaction Hamiltonian](../programming.md#22-interaction-hamiltonian) and a [drive Hamiltonian](../programming.md#21-driving-hamiltonian).\n",
"\n",
"Let's program this Hamiltonian $H$ such that an atom initially in the ground state $\\left|g\\right>$ is measured in the Rydberg state $\\left|r\\right>$ after a time $\\Delta t$.\n",
"\n",
"Since we are working with a single atom, there is no [interaction Hamiltonian](../programming.md). In this specific example, $H=H^D$. For a simple pulse having a duration $\\Delta t$, a constant amplitude along time $\\Omega$, detuning $\\delta=0$ and phase $\\phi=0$ [the Hamiltonian between 0 and Δt is](../programming.md):\n",
"Since we are working with a single atom, there is no [interaction Hamiltonian](../programming.md#22-interaction-hamiltonian). In this specific example, $H=H^D$. For a simple pulse having a duration $\\Delta t$, a constant amplitude along time $\\Omega$, detuning $\\delta=0$ and phase $\\phi=0$ [the Hamiltonian between 0 and Δt is](../programming.md#2-hamiltonian-evolves-the-state):\n",
"\n",
"$$ H(t) = \\hbar\\frac{\\Omega}{2} (|g\\rangle\\langle r| + |r\\rangle\\langle g|)$$"
]
Expand Down Expand Up @@ -71,7 +74,7 @@
"\n",
"- We can compute the final state knowing the initial state\n",
"\n",
" The initial state being the ground state and the Hamiltonian $H$ being constant along time, [the final state is](../programming.md):\n",
" The initial state being the ground state and the Hamiltonian $H$ being constant along time, [the final state is](../programming.md#2-hamiltonian-evolves-the-state):\n",
"\n",
" $$\n",
" \\begin{align}\n",
Expand Down Expand Up @@ -274,11 +277,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's now program the [Ising Hamiltonian](../programming.md) such that a set of 9 atoms initially in the ground state $\\left|ggggggggg\\right>$ are prepared in an antiferromagnetic state $\\left|rgrgrgrgr\\right>$.\n",
"Let's now program the [Ising Hamiltonian](../programming.md#ising-hamiltonian) such that a set of 9 atoms initially in the ground state $\\left|ggggggggg\\right>$ are prepared in an antiferromagnetic state $\\left|rgrgrgrgr\\right>$.\n",
"\n",
"To reach the desired antiferromagentic state, we can take advantage of the [adiabatic theorem](https://en.wikipedia.org/wiki/Adiabatic_theorem). The idea is to use a time-dependent Hamiltonian that changes slowly so that the system stays in its ground state. Therefore, we must choose a final Hamiltonian that has the antiferromagnetic state as its ground state.\n",
"\n",
"This final Hamiltonian should simultaneously favor having the largest number of atoms in the $\\left|r\\right>$ state (by having $\\delta > 0$) and discourage nearest neighbors from being both in $\\left|r\\right>$ (via the [interaction Hamiltonian](../programming.md)). When these contributions are appropriately balanced, we get an Hamiltonian with $\\left|rgrgrgrgr\\right>$ as its ground state.\n",
"This final Hamiltonian should simultaneously favor having the largest number of atoms in the $\\left|r\\right>$ state (by having $\\delta > 0$) and discourage nearest neighbors from being both in $\\left|r\\right>$ (via the [interaction Hamiltonian](../programming.md#ising-hamiltonian)). When these contributions are appropriately balanced, we get an Hamiltonian with $\\left|rgrgrgrgr\\right>$ as its ground state.\n",
"\n",
"Let's follow the protocol from [this paper](https://journals.aps.org/prx/abstract/10.1103/PhysRevX.8.021070), where we define the parameters with respect to the interaction strength between nearest neighbours, $U$ (see Table 1 of the paper):\n",
"\n",
Expand Down Expand Up @@ -365,9 +368,7 @@
"metadata": {},
"outputs": [],
"source": [
"R_interatomic = (device.interaction_coeff / U) ** (\n",
" 1 / 6\n",
") # interaction coeff is C_6/hbar\n",
"R_interatomic = (device.interaction_coeff / U) ** (1 / 6)\n",
"N_side = 3\n",
"register = pulser.Register.square(N_side, R_interatomic, prefix=\"q\")\n",
"print(f\"Interatomic Radius is: {R_interatomic}µm.\")\n",
Expand All @@ -378,6 +379,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Note: In Pulser, we can access the interaction coefficient $\\frac{C_6}{\\hbar}$ with `device.interaction_coeff`\n",
"\n",
"Let's now initialize our quantum program, the `Sequence`, and check that the created `Register` matches the parameters set by the `Device` we picked: "
]
},
Expand Down Expand Up @@ -432,16 +435,6 @@
"### 4. Adding the pulses"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's now define the driving Hamiltonian at each nanosecond between $0$ and $t_{tot}=t_{rise}+t_{sweep}+t_{fall}$. We follow the program that we described above. The `Sequence` will be composed of three pulses:\n",
"- A first \"rise\" pulse of duration $t_{rise}$ during which the amplitude ramps from 0 to $\\Omega_{max}$, while the detuning is equal to $\\delta_0$ and the phase is constant and equal to $0$.\n",
"- A second \"sweep\" pulse of duration $t_{sweep}$ during which the amplitude is constant equal to $\\Omega_{max}$, the detuning ramps from $\\delta_0$ to $\\delta_{final}$, and the phase is constant and equal to $0$.\n",
"- A third \"fall\" pulse of duration $t_{fall}$ during which the amplitude ramps down from $\\Omega_{max}$ to $0$, the detuning is constant equal to $\\delta_{final}$ and the phase is constant and equal to $0$. "
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit fde7b8b

Please sign in to comment.