Skip to content

Commit

Permalink
remove pip requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
splch committed Mar 13, 2024
1 parent 611df66 commit efaaa94
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 17 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/test_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,14 @@ jobs:
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test-env
activate-environment: myenv
environment-file: environment.yml
python-version: "3.11"
auto-activate-base: false

- name: Install dependencies
run: |
conda env create -f environment.yml
conda activate test-env
while read requirement; do conda install --yes $requirement || pip install $requirement; done < requirements.txt
- name: Run notebook tests
run: |
conda activate test-env
conda activate myenv
python tests/test_notebooks.py
env:
IONQ_API_KEY: ${{ secrets.IONQ_API_KEY }}
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ This repository contains Python samples exploring quantum computing on IonQ's pl

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](https://github.com/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](https://www.python.org/downloads/) installed, using a version between 3.8 and 3.11.
1. A [virtual environment](https://docs.python.org/3/library/venv.html) to help ensure your dependencies don't conflict with anything else you have installed.
1. An [IonQ API key](https://cloud.ionq.com/settings/keys), which optionally you can store as an environment variable for ease of use. Our notebooks expect to find it stored as `IONQ_API_KEY`.
1. An installation of the library you're wanting to run. To install all the libraries at once, run `pip install -r requirements.txt` from the root directory of this repository.
2. A [virtual environment](https://docs.python.org/3/library/venv.html) to help ensure your dependencies don't conflict with anything else you have installed.
3. An [IonQ API key](https://cloud.ionq.com/settings/keys), 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:

----
```shell
conda env create -f environment.yml
```

---

## Usage

Expand All @@ -27,21 +31,24 @@ If you're unfamiliar with Jupyter but you're used to a traditional IDE or code e

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

```shell
jupyter notebook
```
```shell
jupyter notebook
```

1. 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](http://localhost:8888)
1. 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.
1. 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.
1. 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](https://colab.research.google.com/assets/colab-badge.svg) badge located in each notebook. Or open this repository in [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ionq-samples/getting-started/HEAD)
----
---
## Support
Expand Down
21 changes: 21 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: myenv
channels:
- conda-forge
- defaults
dependencies:
- python=3.11
- matplotlib
- jupyter
# Add other dependencies here, for Conda packages.
- pip:
# Pip-only packages here, if any.
- qiskit
- qiskit-ionq
- cirq
- cirq-ionq
- pennylane
- pennylane-ionq
- projectq
- cuda-quantum
- pylatexenc
- requests

0 comments on commit efaaa94

Please sign in to comment.