Skip to content

A collection of Python samples demonstrating how to get started with IonQ using various quantum frameworks

License

Notifications You must be signed in to change notification settings

ionq-samples/getting-started

Repository files navigation

IonQ Quantum Computing Samples

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.


Prerequisites

There are a wide variety of ways to run these notebooks, but for starters you'll need:

  1. Python installed, using a version between 3.8 and 3.11.

  2. A virtual environment to help ensure your dependencies don't conflict with anything else you have installed.

  3. 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.

  4. 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

Usage

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.

Jupyter Notebooks

  1. From your terminal, navigate to this repository and run the following command from within this directory:

    jupyter notebook
  2. 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

  3. Navigate to the location of a .ipynb file and open it. If you don't have a particular SDK in mind, we recommend starting with qiskit, as its the most commonly used library today.

VS Code

  1. Open the folder in VS Code and navigate to a .ipynb file and open it.
  2. 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.
  3. At the top-right of the screen, click on Select Kernel and choose an appropriate Python runtime to run the notebook in.

Cloud

  1. Open the notebook by clicking on the Open in Colab badge located in each notebook. Or open this repository in Binder

Support

For support, you can submit issues or PRs in this repository. Alternatively, you can contact us at [email protected].

About

A collection of Python samples demonstrating how to get started with IonQ using various quantum frameworks

Topics

Resources

License

Stars

Watchers

Forks

Languages