Skip to content

Commit

Permalink
Add recirq imports. (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
fdmalone authored Jul 25, 2024
1 parent 9d0b7ac commit 3f68692
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
21 changes: 21 additions & 0 deletions docs/qcqmc/experimental_wavefunctions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@
"for download from [zenodo](https://zenodo.org/records/10141262)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Setup\n",
"\n",
"First install recirq:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"try:\n",
" import recirq\n",
"except ImportError:\n",
" %pip install git+https://github.com/quantumlib/ReCirq"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
21 changes: 21 additions & 0 deletions docs/qcqmc/full_workflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@
"We learned in the [high-level](high-level.ipynb) notebook how to setup the quantum side of the calculation, which involves specifying a Hamiltonian, defining a trial wavefunction ansatz before performing shadow tomography to extract the AFQMC trial wavefunction. In this example, we will repeat these steps again for the case of H4 which was studied in the [paper](https://arxiv.org/pdf/2106.16235.pdf). Then we will outline how to interface the output of the quantum half of the calculation with [ipie](https://github.com/JoonhoLee-Group/ipie/) to perform AFQMC with the quantum trial wavefunction."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Setup\n",
"\n",
"First install recirq:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"try:\n",
" import recirq\n",
"except ImportError:\n",
" %pip install git+https://github.com/quantumlib/ReCirq"
]
},
{
"attachments": {},
"cell_type": "markdown",
Expand Down
25 changes: 24 additions & 1 deletion docs/qcqmc/high_level.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,29 @@
"The code is organized into five steps, where the input of each step is specified by one or more `[Name]Params` dataclasses and the output of each step is an `attrs` dataclass named `[Name]Data` with a factory method `build_...`. Each of the steps are demonstrated below."
]
},
{
"cell_type": "markdown",
"id": "5463daa8",
"metadata": {},
"source": [
"# Setup\n",
"\n",
"First install recirq:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2c790a14",
"metadata": {},
"outputs": [],
"source": [
"try:\n",
" import recirq\n",
"except ImportError:\n",
" %pip install git+https://github.com/quantumlib/ReCirq"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -20,7 +43,7 @@
"outputs": [],
"source": [
"import attrs\n",
"\n",
"# Helper function to inspect the classes. \n",
"def print_fields(x):\n",
" \"\"\"Helper function to inspect returned objects' fields.\"\"\"\n",
" for k, v in attrs.asdict(x).items():\n",
Expand Down

0 comments on commit 3f68692

Please sign in to comment.