This repository contains Python samples exploring quantum computing on IonQ's platform using various quantum programming libraries. These examples are a great place to start if you're interested in quantum computation, but aren't familiar with any of the libraries out there.
If you're looking for advanced and in-depth examples for a given library that implement a specific algorithm, check out some of the other projects in the ionq-samples organization on GitHub.
There are a wide variety of ways to run these notebooks, but for starters you'll need:
-
Python installed, using a version between 3.8 and 3.11.
-
A virtual environment to help ensure your dependencies don't conflict with anything else you have installed.
-
An IonQ API key, which optionally you can store as an environment variable for ease of use. Our notebooks expect to find it stored as
IONQ_API_KEY
. -
An installation of the library you're wanting to run. To install all the libraries at once using Conda, run the following command from the root directory of this repository:
conda env create -f environment.yml
The samples are in the form of Jupyter notebooks, and you can view and run them using a local Jupyter installation, VS Code (using the built-in Jupyter plugin), or Google Colab.
If you're unfamiliar with Jupyter but you're used to a traditional IDE or code editor, VS Code is probably the right choice for you.
-
From your terminal, navigate to this repository and run the following command from within this directory:
jupyter notebook
-
Once the server is started, it should automatically open your browser. In case it doesn't, you can navigate directly to it by pointing your browser at http://localhost:8888
-
Navigate to the location of a
.ipynb
file and open it. If you don't have a particular SDK in mind, we recommend starting withqiskit
, as its the most commonly used library today.
- Open the folder in VS Code and navigate to a
.ipynb
file and open it. - If it's your first time using it, it will suggest a number of plugins that you may need to install before the notebook will be fully functional.
- At the top-right of the screen, click on
Select Kernel
and choose an appropriate Python runtime to run the notebook in.
For support, you can submit issues or PRs in this repository. Alternatively, you can contact us at support@ionq.com.