Grading client for the IBM Quantum Challenge grading service.
Follow one of these steps to install the grading client.
Pre-requisites:
The grader comes pre-installed in Quantum Lab and does not need to be installed.
Pre-requisites:
- IBM Quantum account
- Docker installed
To install the dockerized grader client environment:
-
Create an
env
setting the following parameters. All parameters are optional and can be changed laterQXToken
- IBM Quantum API Token (can be found in Account Details)QC_GH_REPO
- the org/repo name where exercise notebooks can be downloaded (e.g.,qiskit-community/ibm-quantum-challenge-2021
)QC_GH_BRANCH
- the branch in the repo to download notebooks (e.g.,main
)
Note: All parameters are optional and can be updated later
Example
env
file:QC_GH_REPO=qiskit-community/ibm-quantum-challenge-2021 QC_GH_BRANCH=main QXToken=1df75f29d97a46caa689bae3e3f05f477376c81b7a1157b7fe413811f6cb13c0c032f3
-
From a command prompt, run
docker run -it -p 8888:8888 --env-file=<env_file> qiskitcommunity/qc-grader
where
<env_file>
is the path to theenv
created in step (1).
Once running open a browser and go to http://localhost:8888/lab
to access the Jupyter environment. Additional information is available in the README.md
in the Jupyter environment.
Pre-requisites:
- IBM Quantum account
- Python (3.7 or later) environment with
- Classic Jupyter Notebook interface or JupyterLab
- Qiskit
pip install qiskit[all]
- qiskit_textbook package
pip install git+https://github.com/qiskit-community/qiskit-textbook.git#subdirectory=qiskit-textbook-src
To install the grader locally:
-
In the Python environment, install the grading client
pip install -I git+https://github.com/qiskit-community/Quantum-Challenge-Grader.git
-
Configure the following environment variables
QC_GRADING_ENDPOINT
- the URL to the grading serverQXAuthURL
- IBM Quantum Authentication API URLQXToken
- IBM Quantum API Token (can be found in Account Details)
-
Open an exercise notebook
- In IBM Quantum Lab, the notebooks can be found in the
quantum-challenge
folder in the Lab files panel - For local install, download the notebooks (from IBM Quantum Lab or specific challenge repo) and import into local Jupyter environment
- In IBM Quantum Lab, the notebooks can be found in the
-
Run the notebook cells, answering the exercises and submitting solution for grading. For example
from qc_grader import grade_lab1_ex1 grade_lab1_ex1(qc_1)
from qc_grader import grade_lab1_ex2 grade_lab1_ex2(qc_2)