Skip to content
Open
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
200 changes: 200 additions & 0 deletions docs/tutorials/01_classically_estimate_expectation_values.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"id": "df27beb5-e42d-4fa8-a47b-cbd4b7fd61a4",
"metadata": {},
"source": [
"### Simulating quantum systems with Pauli propagation\n",
"### Simulating 127-qubit kicked-Ising model\n",
"\n",
"In this tutorial we will use the ``pauli-prop`` package to classically simulate the time dynamics of a 127-qubit kicked Ising model on a heavy-hex lattice and approximate the single-site magnetization, $\\langle Z_{62} \\rangle$. The Hamiltonian considered is:\n",
"\n",
"$H = -J\\sum\\limits_{\\langle i,j \\rangle} Z_iZ_j + h\\sum\\limits_iX_i$\n",
"\n",
"where $J>0$ describes the coupling of nearest-neighbor spins, $i<j$, and $h$ is the global transverse field. A first-order Trotter decomposition of the time-evolved operator will be implemented as a quantum circuit, $U$, over $20$ Trotter steps. The coupling constant, $J$, will be fixed at $J=-\\frac{\\pi}{2}$ such that $U$ is Clifford any time $h\\mod\\frac{\\pi}{2}=0$.\n",
"\n",
"In this tutorial, we will:\n",
"Workflow:\n",
"\n",
"- Create quantum circuits implementing the Trotterized Ising model\n",
" - Vary $h$ between Clifford points, $0.0$ and $\\frac{\\pi}{2}$.\n",
Expand Down Expand Up @@ -107,7 +107,7 @@
"approx_evs = []\n",
"for circuit in circuits:\n",
" st = time.time()\n",
" propagated_obs, _ = propagate_through_circuit(observable, circuit, 100_000, 1e-5, frame=\"h\")\n",
" propagated_obs = propagate_through_circuit(observable, circuit, 100_000, 1e-5, frame=\"h\")[0]\n",
" times.append(time.time() - st)\n",
" approx_evs.append(float(propagated_obs.coeffs[~propagated_obs.paulis.x.any(axis=1)].sum()))\n",
"print(f\"Finshed {len(circuits)} simulations in {sum(times):.0f}s\")"
Expand Down
Loading