-
Notifications
You must be signed in to change notification settings - Fork 88
Home
Here you shall find answers to some of the common queries and issues that arise! Please feel free to refer to this section before approaching mentors for assistance on technical issues!
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.challenges.fall_2022 import grade_lab1_ex1
grade_lab1_ex1(bernstein_vazirani)
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-terra
: >=0.22.2
-
qiskit-ibm-runtime
: >=0.8.0
-
qiskit-nature
: >=0.4.0
-
qiskit-optimization
: >=0.4.0
-
qiskit-machine-learning
: >=0.4.0
-
prototype-zne
: >=1.0.0
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.
As mentioned in the notebooks, the VQE run may take about 5-10 minutes to complete due to the huge number of jobs required to be sent on cloud solve the problem. Noisy simulation of VQE runs will take even longer due to the noise model applied in the simulators. Please be patient as the runs are complete! Feel free to head over to https://quantum-computing.ibm.com/jobs to check if there are jobs being sent on the portal!
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 setup the grader locally:
- Make sure you install all the libraries above in your environment
- Install the qc grader by running
pip install git+https://github.com/qiskit-community/Quantum-Challenge-Grader.git
- Set your environment variables
- %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
- Set your token from the dashboard Do not add any quotes and DO NOT share this key with anyone
- Test out to see if it works by running a grading cell
Please make sure you have installed the latest 0.13.6 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: / Failed: 401 Client Error: Unauthorized for url:
For 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, 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
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 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-22-2', group='challenge-1', project='recFaSKO8ka85JBot')>]
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-2022 Slack channel.
We have a lot of participants at the moment. Please try again a while later! :)
- 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 an IBM Quantum Challenge Fall 2022 Achievement digital Credly acclaimed badge for participating in the IBM Quantum Challenge Fall 2022 and successfully completing all four or partial completion of the labs by the deadline of 18 Nov, 09:00 AM (EDT).
You will receive a Foundational Badge for completing upto Lab 1, Intermediate Badge for completing upto Lab 2 and Lab 3 and an Advanced badge for completing upto Lab 4. More details will be shared once the challenge has completed.
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 2022 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.
Please let us know if you have any additional questions in the #challenge-fall-2022 in the Qiskit Slack workspace.