From 2d3ac86c7fc9a96a1dd1e7ae6cee1901c4eb20ae Mon Sep 17 00:00:00 2001 From: Nick Rubin Date: Wed, 20 Oct 2021 12:59:16 -0700 Subject: [PATCH] notebook test import --- ...an_time_evolution_and_expectation_estimation.ipynb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/hamiltonian_time_evolution_and_expectation_estimation.ipynb b/docs/tutorials/hamiltonian_time_evolution_and_expectation_estimation.ipynb index 905ecf3..b116907 100644 --- a/docs/tutorials/hamiltonian_time_evolution_and_expectation_estimation.ipynb +++ b/docs/tutorials/hamiltonian_time_evolution_and_expectation_estimation.ipynb @@ -83,11 +83,16 @@ "outputs": [], "source": [ "Print = True\n", + "import os\n", + "import sys\n", "from openfermion import FermionOperator, MolecularData\n", "from openfermion.utils import hermitian_conjugated\n", "import numpy\n", "import fqe\n", - "from fqe.unittest_data import build_lih_data\n", + "\n", + "top_dir = os.path.abspath(fqe.__file__).replace('src/fqe/__init__.py','')\n", + "sys.path.append(os.path.join(top_dir, 'tests'))\n", + "from unittest_data import build_lih_data\n", "numpy.set_printoptions(floatmode='fixed', precision=6, linewidth=80, suppress=True)\n", "numpy.random.seed(seed=409)\n", "\n", @@ -505,7 +510,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -519,7 +524,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.8.12" } }, "nbformat": 4,