Skip to content

Commit

Permalink
Merge 3271c72 into 81df362
Browse files Browse the repository at this point in the history
  • Loading branch information
QFer committed May 9, 2023
2 parents 81df362 + 3271c72 commit eae0672
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
run: |
python ./docs/examples/example_qiskit_entangle.py
python ./docs/examples/example_qiskit_conditional.py
python ./docs/examples/delete_projects.py
env:
QI_TOKEN: ${{ secrets.QI_TOKEN }}
API_URL: https://api.quantum-inspire.com
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ script:
jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=300 docs/examples/example_projectq.ipynb;
jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=300 docs/examples/grover_algorithm_qi.ipynb;
jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=300 docs/examples/qi-performance-test.ipynb;
python ./docs/examples/delete_projects.py;
fi
after_success:
- coveralls
Expand Down
22 changes: 22 additions & 0 deletions docs/examples/delete_projects.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""Example usage of the Quantum Inspire API.
A simple example that demonstrates how to use the SDK API to delete
all projects registered for the authenticated user in Quantum Inspire.
Specific to Quantum Inspire is the creation of the QI instance, which is used to set the authentication
of the user.
Copyright 2018-2023 QuTech Delft. Licensed under the Apache License, Version 2.0.
"""
from quantuminspire.credentials import get_token_authentication, load_account
from quantuminspire.qiskit import QI

token = load_account()
if token is not None:
qi_authentication = get_token_authentication(token)
QI.set_authentication(qi_authentication)
api = QI.get_api()

projects = api.get_projects()
for project in projects:
api.delete_project(project["id"])

0 comments on commit eae0672

Please sign in to comment.