From 3f68692cefd7f972e7711c9bcbf58e5965f21398 Mon Sep 17 00:00:00 2001 From: Fionn Malone Date: Thu, 25 Jul 2024 09:40:11 -0700 Subject: [PATCH] Add recirq imports. (#360) --- docs/qcqmc/experimental_wavefunctions.ipynb | 21 +++++++++++++++++ docs/qcqmc/full_workflow.ipynb | 21 +++++++++++++++++ docs/qcqmc/high_level.ipynb | 25 ++++++++++++++++++++- 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/docs/qcqmc/experimental_wavefunctions.ipynb b/docs/qcqmc/experimental_wavefunctions.ipynb index a1a5bf6a..7ecd171c 100644 --- a/docs/qcqmc/experimental_wavefunctions.ipynb +++ b/docs/qcqmc/experimental_wavefunctions.ipynb @@ -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, diff --git a/docs/qcqmc/full_workflow.ipynb b/docs/qcqmc/full_workflow.ipynb index 5a6410b6..34ea08fe 100644 --- a/docs/qcqmc/full_workflow.ipynb +++ b/docs/qcqmc/full_workflow.ipynb @@ -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", diff --git a/docs/qcqmc/high_level.ipynb b/docs/qcqmc/high_level.ipynb index 0e581a59..39e1154b 100644 --- a/docs/qcqmc/high_level.ipynb +++ b/docs/qcqmc/high_level.ipynb @@ -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, @@ -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",