-
Notifications
You must be signed in to change notification settings - Fork 97
Home
Within each exercise notebook, on the challenge portal, you will find guidelines to submit an answer. For example in the challenge 1 notebook, for exercise 1a:
# Submit your answer using following code
from qc_grader import grade_ex1a
grade_ex1a(qiskit_module_names)
Yes it is possible. But we strongly recommend you solve the exercises on the challenge portal. If you really want to run the exercises locally, you can download the notebooks from the challenge repository and run using Jupyter notebook. Please make sure you have installed the following Qiskit version:
- qiskit: 0.31.0
- qiskit-terra: 0.18.3
- qiskit-nature: 0.2.2
- qiskit-finance: 0.2.1
- qiskit-optimization: 0.2.3
- qiskit-machine-learning: 0.2.1
You can check Qiskit versions by running !pip freeze | grep qiskit
in a terminal or run the following code in a Jupyter notebook cell:
import qiskit.tools.jupyter
%qiskit_version_table
If you don't have the latest version installed. You can run pip install qiskit[all]
in a terminal to install all of the Qiskit packages.
Yes it is possible. But similar to the above question, we strongly recommend you solve the exercises and check answers on the challenge portal. If you really want to check answers on a local computer, you need to install the grading client in addition to downloading the notebooks.
For details on how to use the grader locally, Vishal Sharathchandra Bajpe - @mrvee-qC has created an awesome guide which you can check out here.
Please make sure you have installed the latest 0.8.8
version of the grader. You can verify the grader version using the following code in a Jupyter notebook cell:
import qc_grader
qc_grader.__version__
I encountered this error Failed: 400 Client Error: Bad Request for url: https://auth-dev.quantum-computing.ibm.com/api/users/loginWithToken
or Failed: 401 Client Error: Unauthorized for url: https://auth-dev.quantum-computing.ibm.com/api/users/loginWithToken
while running the notebook locally, I have installed Grader already, What should I do?
You can try to run the following code in your local Jupyter notebook cell.
%env QXToken=YOUR_IBM_QUANTUM_TOKEN
%env QC_GRADING_ENDPOINT=https://qac-grading.quantum-computing.ibm.com
%env QXAuthURL=https://auth.quantum-computing.ibm.com/api
%env QC_GRADE_ONLY=true
You can may need to run these again every time after restarting kernel. You can verify these environmental variables by running the following code:
import os
print((os.environ['QXToken'],
os.environ['QC_GRADING_ENDPOINT'],
os.environ['QXAuthURL']))
If you follow these steps to find your IBM Quantum token.
- Go to IBM Quantum account details.
- Copy API Token
- In a Jupyter notebook on your local machine, type the following code:
from qiskit import IBMQ
IBMQ.save_account('YOUR_TOKEN')
You can follow the steps below to verify that you have setup the account correctly and has the challenge provider linked to your account.
from qiskit import IBMQ
IBMQ.load_account()
IBMQ.providers()
You should see something like this in the output of the cell.
[<AccountProvider for IBMQ(hub='ibm-q', group='open', project='main')>,
<AccountProvider for IBMQ(hub='iqc-fall-21-2', group='challenge-1', project='recFaSKO8ka85JBot')>]
The first provider is the open provider for every registered user and the second one is the challenge provider used specifically for this challenge.
For circuit jobs (not runtime), you can find the list of jobs you have submitted here. Find the job id and provider information of the job that you want to retrieve. Job id is a 24-bit string that looks like this 618263437fa11e475d5ad196
under the Id
column on the Jobs page. Provider is shown in this format HUB_NAME/GROUP_NAME/PROJECT_NAME
. Use this information to retrieve jobs with the following code:
from qiskit import IBMQ
IBMQ.load_account()
provider = IBMQ.get_provider(hub='HUB_NAME', group='GROUP_NAME', project='PROJECT_NAME')
backend = provider.get_backend('ibmq_qasm_simulator')
job = backend.retrieve_job('JOB_ID')
For program jobs (runtime), you can find the list of jobs you have submitted here. Similar to retrieving ordinary circuit jobs, you will need the job id and provider information. The difference is that runtime job is retrieve on the provider level, not the backend level, with different method:
from qiskit import IBMQ
IBMQ.load_account()
provider = IBMQ.get_provider(hub='HUB_NAME', group='GROUP_NAME', project='PROJECT_NAME')
job = provider.runtime.job('JOB_ID')
No, you can run all exercises on the challenge portal itself.
We encourage you complete the exercises in the given order as this is the intended structure for the challenge. However, you may take the exercises in any order.
Yes, you'll need an IBMid associated with your IBM Quantum account in order to complete some of the challenges. If you don't already have one, please register a new IBMid using the SAME email address associated with your IBM Quantum account. If you have any questions or face any issues, please let us know in the #challenge-fall-2021 Slack channel.
We have a lot of participants at the moment. Please be patient, wait and try again.
I encountered this error 401 : Unauthorized You are not Authenticated to do this (1)
What should I do?
Please try the following on a notebook on Quantum Lab
import os
os.environ['QXToken'] = 'your token'
print(os.getenv('QXToken'))
You can find your token here: https://quantum-computing.ibm.com/account. Make sure the output matches the token you copied from the account page.
Run the code below to check if authentication is working. If you see a long string in the output, it means 401 error has been resolved.
from qc_grader.api import get_access_token
get_access_token()
You will receive the IBM Quantum Challenge Fall 2021 Achievement digital badge for participating in the IBM Quantum Challenge Fall 2021 and successfully completing all four of the challenges by the deadline of 5 Nov, 12:00 PM (EDT). More details will be shared once the challenge has completed.
We will have hosted YouTube Live lectures for four application modules prior to the challenge start.
- Part 1 - October 8 at 10:00 AM (EDT): Qiskit Optimization & Machine Learning Demo Session with Atsushi Matsuo & Anton Dekusar
- Part 2 - October 15 at 10:00 AM (EDT): Qiskit Nature & Finance Demo Session with Max Rossmannek & Julien Gacon
You can watch the replay here if you missed the livestream.
The challenge platform requires that you are logged in with a full IBMid, and not a social-media account like GitHub. If you are not using an IBMid to login, please register an account using the same email you registered with. This should resolve the above error.
This error is shown if you are logging in with a social-media account like GitHub. Please see the solution given for the above question, Why am I seeing the error "Failed: 401 Client Error: Unauthorized for URL"?.
Why am I seeing the error "Your request cannot be processed. The System cannot process your request."?
This error may occur if you have two accounts and one is logging in automatically. To resolve this, navigate to ibm.com, disable auto login, logout, close all IBM tabs except one, and re-login to the challenge website.
This is due to the grading process taking longer than the time-out limit of the grading server, which is 60 seconds. You can put Jupyter notebook line magic %%time
in a cell to check the time it takes for grading (this is an example for grading challenge 4c):
%%time
grade_ex4c(job)
If the time is longer than 60s, it will cause the error. You should review your answer to make it simpler.
The IBM Quantum Lab and IBM Quantum Challenge Fall 2021 teams may need to update the platform at certain points during the challenge. If you encounter this error, you should wait about 5-10 minutes before trying again. By that stage, the server should have successfully updated.
-
If you see this error for challenge-2.ipynb, remove/comment out the sections in the notebook that is related to the ProgressPlot python object.
-
If you see this error for challenge-3.ipynb you have two options to fix this issue:
Option 1: Go to Challenge 3b problem statement (green block) and replace normal quotation ('') with back quotations (``) forseed_simulator=1024
and `seed_transpiler=1024`.
Option 2: Rename your current notebook to `challenge-3-anythingyoulike` and then go to the challenge dashboard and reload the page. You should see a new `challenge-3.ipynb` created under the challenge-3 folder. Copy-paste any code you wrote in the old notebook to the new one to start from where you left off. Then you can delete the old notebook to stop the error messages to reappear.
Please let us know if you have any additional questions in the #challenge-fall-2021 in the Qiskit Slack workspace.