Set up Jupyter Notebook

Jupyter Notebooks are convenient workbooks to organize Python code, text and the results of running code all in one place. This book illustrates all the Python focused examples within a Jupyter Notebook although, in principle, you can execute the Python code in any Python interpreter you choose. If you want to run a Jupyter Notebook within a Python virtual environment, run within that environment: pip install ipykernel and ipython kernel install --user --name=bookkernel. Then after launching Jupyter Notebook, navigate to Kernel | bookkernel in the notebook's UI. To test out your Jupyter Notebook setup, run the following command:

jupyter notebook

Now open the notebook Hello Quantum World.ipynb by navigating to it from the Jupyter Notebook GUI. Run the example line. If you have trouble at any step, consider an online tutorial or consulting Jupyter's documentation at https://jupyter-notebook.readthedocs.io/en/stable/.