Skip to content

Commit

Permalink
Lint passes now
Browse files Browse the repository at this point in the history
  • Loading branch information
garrison committed Dec 17, 2024
1 parent 78407c8 commit dedb7a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions templates/hamiltonian-simulation/hamsim_template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"metadata": {},
"outputs": [],
"source": [
"# mypy: ignore-errors\n",
"from qiskit_serverless import get_arguments, save_result, is_running_in_serverless\n",
"\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
# coding: utf-8
# mypy: ignore-errors

# # Reducing the Trotter error of Hamiltonian dynamics with <span style="color:black">approximate quantum compilation</span>
#
Expand Down
9 changes: 7 additions & 2 deletions templates/hamiltonian-simulation/hamsim_template0.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -792,14 +792,19 @@
"ref_expval = -0.5887\n",
"print(f\"Exact:\\t\\t{ref_expval:.4f}\")\n",
"\n",
"print(f\"With AQC:\\t{hw_expvals[0]:.4f} ± {hw_results_dicts[0][\"stds\"].item():.4f}, |∆| = {np.abs(ref_expval - hw_expvals[0]):.4f}\")\n",
"std = hw_results_dicts[0][\"stds\"].item()\n",
"print(\n",
" f\"With AQC:\\t{hw_expvals[0]:.4f} ± {std:.4f}, |∆| = {np.abs(ref_expval - hw_expvals[0]):.4f}\"\n",
")\n",
"\n",
"with open(\"hw_results_comparison.pkl\", \"rb\") as f:\n",
" hw_results_dicts_0, _ = dill.load(f)\n",
"\n",
"comparison_expval = hw_results_dicts_0[0][\"evs\"].item()\n",
"comparison_std = hw_results_dicts_0[0][\"stds\"].item()\n",
"print(f\"Without AQC:\\t{comparison_expval:.4f} ± {comparison_std:.4f}, |∆| = {np.abs(ref_expval - comparison_expval):.4f}\")"
"print(\n",
" f\"Without AQC:\\t{comparison_expval:.4f} ± {comparison_std:.4f}, |∆| = {np.abs(ref_expval - comparison_expval):.4f}\"\n",
")"
]
},
{
Expand Down

0 comments on commit dedb7a1

Please sign in to comment.