Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ parts:
- file: tutorials/creating_and_manipulating_qbits
- file: tutorials/generating_lattices
- file: tutorials/pulser-calc-example
- file: tutorials/finite-geometries
- caption: Use-Cases
chapters:
- file: use-cases/ssh_model
Expand All @@ -19,6 +20,7 @@ parts:
chapters:
- file: theory/spatial-correlation
- file: theory/blockade-radius
- file: theory/adiabatic_evolution
- caption: API Reference
chapters:
- file: autoapi/qse/index # This is where sphinx-autoapi dumps the docs
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ This project is under active development.

`Qbit` is the smallest class that represents just one qubits. `Qbits` is the primary class that represents a collection of qubits.
It can be instantiated by providing a list of coordinates, or as an empty class.
See the [Qbits examples](https://github/ICHEC/qse/docs/build/html/tutorials/creating_and_manipulating_qbits.html) for more details.
See the [Qbits examples](https://ichec.github.io/qse/tutorials/creating_and_manipulating_qbits.html) for more details.



Expand Down
161 changes: 161 additions & 0 deletions docs/theory/adiabatic_evolution.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Adiabatic Time Evolution"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Theory\n",
"\n",
"Suppose we have a Time-dependent Hamiltonian $H(t)$ then the Schrödinger equation is\n",
"$$\n",
"i\\hbar \\frac{d}{dt}|\\psi(t)\\rangle = H(t)|\\psi(t)\\rangle.\n",
"$$\n",
"We can write\n",
"$$\n",
"|\\psi(t)\\rangle = \\sum_n c_n(t)|n(t)\\rangle\n",
"$$\n",
"with \n",
"$$\n",
"H(t) |n(t)\\rangle = e_n(t) |n(t)\\rangle.\n",
"$$\n",
"\n",
"\n",
"The [Adiabatic Theorem](https://en.wikipedia.org/wiki/Adiabatic_theorem) states that if a system is evolved by a slowly varying time dependent Hamiltonian (i.e. $\\dot H(t) \\approx 0$) and as long as the eigenenergies don't become degenerate (i.e. $e_n(t) - e_m(t) \\ne 0$) then we will have\n",
"$$ |c_m(t)|^2 = |c_m(0)|^2.$$\n",
"Thus as a consequence if the system is initially in the ground state of the Hamiltonian, if the evolution is adiabatic, it will remain in the Hamiltonian's ground-state."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Single Qubit Example"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Consider the time dependent Hamiltonian\n",
"$$\n",
"\\begin{split}\n",
"H(t) &= - f_Z(t) Z - g_X(t) X \\\\\n",
"f_Z(t) &= 1-t/T \\\\\n",
"g_X(t) &= t/T \\\\\n",
"\\end{split}\n",
"$$\n",
"Note that at:\n",
"- $t=0$: $H(0) = -Z $ and $|0\\rangle$ is the groundstate. \n",
"- $t=T$: $H(T) = -X $ and $|+\\rangle$ is the groundstate. \n",
"\n",
"The adiabatic theorem assues us that if we vary the Hamiltonian slowly enough (i.e. for a large value of $T$), the final evolved state will be the ground state of $H(T)$ if we start in the ground state of $H(0)$. \n",
"Note that $\\dot H(t) = - (Z +X) /T$ which tends to zero for large values of $T$, thus for large $T$ the evolution will be adiabatic.\n",
"In the cells below we start in the state $|0\\rangle$ and evolving slowly we will evolve to the state $|+\\rangle$."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import qutip as qp\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"duration = 10.0\n",
"sample_times = np.linspace(0, duration, 100)\n",
"\n",
"pulse_up = lambda t: t / duration\n",
"pulse_dn = lambda t: 1.0 - t / duration\n",
"\n",
"\n",
"def get_ham(t):\n",
" return -pulse_dn(t) * qp.sigmaz() - pulse_up(t) * qp.sigmax()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.plot(sample_times, pulse_up(sample_times), label=\"$g_X$\")\n",
"plt.plot(sample_times, pulse_dn(sample_times), label=\"$f_Z$\")\n",
"plt.xlabel(\"Time\")\n",
"plt.ylabel(\"Value\")\n",
"plt.legend()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"initial_state = qp.fock(2)\n",
"states = qp.sesolve(\n",
" get_ham, initial_state, sample_times, e_ops=[qp.sigmaz(), qp.sigmax()]\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.plot(states.e_data[0], label=\"<Z>\")\n",
"plt.plot(states.e_data[1], label=\"<X>\")\n",
"plt.xlabel(\"Time\")\n",
"plt.ylabel(\"Expectation Value\")\n",
"\n",
"plt.legend()\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We see that initially $\\langle Z \\rangle=1$ (since we start in the state $|0\\rangle$) but after the evolution we have $\\langle x\\rangle=1$ which shows we have correctly evolved to the state $|+\\rangle$."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"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.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
2 changes: 1 addition & 1 deletion docs/use-cases/adiabatic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": [
"# Quantum Adiabatic Pulses\n",
"\n",
"Here we prepare a ground state of a Hamiltonian using an adiabatic pulse. See [...] for more details on the adiabatic theorem."
"Here we prepare a ground state of a Hamiltonian using an adiabatic pulse. See the [adiabatic theory notebook](https://ichec.github.io/qse/theory/adiabatic_evolution.html) for more details on the adiabatic theorem."
]
},
{
Expand Down
Loading