Coder Social home page Coder Social logo

qiskit-community / ibm-quantum-challenge-2024 Goto Github PK

View Code? Open in Web Editor NEW
142.0 10.0 237.0 25.53 MB

For IBM Quantum Challenge 2024 (5-14 June 2024)

Home Page: https://challenges.quantum.ibm.com/2024

License: Apache License 2.0

Jupyter Notebook 99.93% Python 0.07%

ibm-quantum-challenge-2024's Introduction

IBM Quantum Challenge 2024

LicenseLast updated

This year’s challenge starts on 5 June, and is about Qiskit SDK 1.0 and working toward utility-scale quantum experiments.

Registration

Registration is open until the end of the challenge (14 June): https://challenges.quantum.ibm.com/2024

Introduction

Earlier this year, we debuted the first stable release of the Qiskit SDK, the IBM software for programming utility-scale quantum computers. Now, we challenge you to put it to work.

We’re excited to introduce the 2024 IBM Quantum Challenge. This annual coding challenge is an educational event focused on teaching the world how quantum computational scientists use Qiskit. This year’s challenge is about Qiskit 1.0 and working toward utility-scale quantum experiments.

As with previous challenges, the 2024 IBM Quantum Challenge is tailored for anyone to join, regardless of their experience — whether you’re a newcomer or a seasoned veteran, there is something here for you. It consists of a series of Jupyter notebooks that contain tutorial material, code examples, and auto-graded coding challenges. We call each of these notebooks a “lab.” While the first lab can be completed by beginners, the final labs will test your Qiskit knowledge. This is, after all, a challenge!

This year’s challenge will showcase the new features of Qiskit 1.0, while demonstrating the differences from previous versions. We hope it will help you better understand what it means to do utility-scale experiments with Qiskit — those with 100 or more qubits — and practice the steps to get there.

This challenge is also an opportunity to get a sneak peek at some of the new cutting-edge features and developments in the quantum stack. That includes new integrations with AI — the Qiskit code assistant powered by IBM watsonx™.

Challenge content

English Español 日本語 한국어 Português brasileiro
Lab 0 lab-0 lab-0-es lab-0-ja lab-0-ko lab-0-ptbr
Lab 1 lab-1 lab-1-es lab-1-ja lab-1-ko
Lab 2 lab-2 lab-2-es lab-2-ja lab-2-ko
Lab 3 lab-3 lab-3-ja lab-3-ko
Lab 4 lab-4 lab-4-es lab-4-ja
Bonus Lab lab-bonus lab-bonus-es lab-bonus-ja

Collaborators

Thank you to everyone who helped make this challenge possible and a great success.

IBM Team

Abby Cross, Abdón Rodríguez, Ahmed Al-Qatatsheh, Annaliese Estes, Astri Cornish, Blake Johnson, Borja Peropadre Lopez, Boseong Kim, Brian Ingmanson, David Garcia, David Kremer, Haimeng Zhang, Fabio Scafirimuto, James Weaver, Jennifer Glick, Jessie Yu, Joana Fraxanet Morales, Juan Cruz, Junye Huang, Kifumi Numata, Leron Gil, Marcel Pfaffhauser, Marco Facchini, Maria Gragera Garces, Mira L. Wolf-Bauwens, Natalie Taylor, Paul Nation, Pedro Rivero, Pingal Nath, Radha Pyari Sandhir, Ryan Mandelbaum, Samantha Barron, Sanjay Kumar Lalta Prasad Vishwakarma, Sanket Panda, Sara Ayman Metwalli, Serena Godwin, Siddharth Golecha, Sophy Shin, Sumit Suresh Kale, Tim Huynh, Thembelihle Dlamini, Tushar Mittal, Va Barbosa, Vishal Bajpe, and Yuri Kobayashi

Qiskit Advocates

Abbas Hassasfar, Abhay Kamble, Akash Reddy, Alan Leung Shek Lun, Alberto Maldonado Romo, Alex Pozas-Kerstjens, Alfaxad Eyembe, Alireza Ghasemi, Andre Alves, Anisha Bopardikar, Anton Simen, Anuj Mehrotra, Ashish Panigrahi, Bao Bach, Bram Dobbelaar, Christophe Pere, Claudia Zendejas-Morales, Constantin Drabo, Cristian Emiliano Godinez Ramirez, Daiki Murata, Daisaku Yokomatsu, David Liu, Dibakar Sigdel, Dimple Mevada, Divyanshu Singh, Dmitrii Khitrin, Dr S Gayathri Devi, Eniola Sobimpe, Fatema Elgebali, Fiona Fröhler, Gabriele Agliardi, Gayathree M Vinod, Gayatri Vadaparty, Gerhard Hellstern, Glauco Reis, Grishma Prasad, Guncha Malik, Hamza Kamel, Hemavathi Santhanam, Hirmay Sandesara, Hitanshu Gedam, Husayn Gokal, Inho Choi, Jaewon Jung, Jason Saroni, Jayakumar Vaithiyashankar, Jayesh Parashar, Jose Bento Ferreira Montenegro, José Fernando Velazquez Hernández, Ka Wa Yip, Karthik Mekala, Kavitha S S, Kazuki Tsuoka, Khadija Ech-challaouy, Louis Chen, Manjula Gandhi S, Marc Maußner, Marcel Bornemann, Marcelo Romaniuc, Marco Antonio Guimarães Auad Barroca, Mauricio Gómez Viloria, Michael Rollin, Mohsinuddin Ansari, Morgan Cameron, Mostafa Atallah, MOZAMMIL HASSAN, Muhsin Tamturk, Natalie Hawkins, Pablo Viñas Martínez, Parmeet Chani, Patrick Downing, Payal Solanki, Prajjwal Vijaywargiya, Prakhar Bhatnagar, Pranshi Saxena, Prateek Jain, Pulkit Sinha, QiaoYi Lin, R K Rupesh, Ran-Yu Chang, Ritu Thombre, Robert Loredo, Saksham Hassanandani, Samantha Lang, Shilpa Mahato, Shivam Sawarn, Shraddha S Aangiras, Siddhant Dutta, Siyuan Niu, Soham Bopardikar, Sorin Bolos, Sumit Puri, Urbano Franca, Utkarsh Singh, Ved Dharkar, Wenyang Qian, Wladimir Silva, Yi-Kai Lee, Zhixin(Jack) Song, Zhiyong Zhang, and Zina Efchary

ibm-quantum-challenge-2024's People

Contributors

0sophy1 avatar brianingmanson avatar bstar14 avatar chrisamirani avatar davikky avatar glanzz avatar guillermoabadlopez avatar gustavopetronilo avatar huangjunye avatar kifumi avatar mgg39 avatar mrvee-qc-bee avatar tigriscallidus avatar zakespley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ibm-quantum-challenge-2024's Issues

Auth error code 3445 in Lab3 [Solved: need to use account created with IBM ID instead of 3rd parties]

Hi there,
I'm getting the following error while trying to connect to QiskitRuntimeService in Lab3 'AI-Powered Transpilation':

Login with some authorized provider required., Error code: 3445.

As far I understand from docs, that relates to the fact I'm using IBM account made with Google Sign-in, rather than IBM ID. But there seems to be no options to re-connect IBM ID somehow to an existing account. Is there any way to proceed with the challenge?

Grading Lab Exercises says not defined

I am in Lab 2 Exercise 5, and it suddenly said NameError: name 'grade_lab2_ex4' is not defined, Then I executed the ode again.

# Setup the grader
from qc_grader.challenges.iqc_2024 import (
    grade_lab2_ex1,
    grade_lab2_ex2,
    grade_lab2_ex3,
    grade_lab2_ex4,
    grade_lab2_ex5
)

But it returns output error like this :

ModuleNotFoundError: No module named 'qiskit_serverless'

Should I install qiskit_severless?

Suggestions for Lab 1

I found the function requirements difficult to interpret in Part 2 of this lab. The callback_dict is referenced in the cost_func function, but it was not explained or defined until after the cost_func function was graded.

One might reasonably argue that I should have read the whole notebook first, rather than struggling through one cell at a time. However, I would suggest moving the following text immediately before the "Exercise 6" box:

Callback functions are a standard way for users to obtain additional information about the status of an iterative algorithm (such as VQE). However, it is possible to do much more than this. Here, we use a mutable object (dictionary), to store resulting vector at each iteration of our algorithm, in case we need to restart the routine due to failure or return the another iteration number.

callback_dict = {
"prev_vector": None,
"iters": 0,
"cost_history": [],
}

QC Grader Version

I started lab 3 and realized that for the qc_grader.version it said it needs to be 0.18.11 (or higher), but the download I got from github for the grader is only 0.18.10. I tried to uninstall and reinstall the grader, but I am now getting the following errors.

ERROR: Could not find a version that satisfies the requirement ray<3,>=2.9.3 (from qiskit-serverless) (from versions: none)
ERROR: No matching distribution found for ray<3,>=2.9.3

and I am getting this error when running the import statements.:

"to fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict.

ERROR: Cannot install qiskit-serverless==0.11.0 and qiskit-serverless==0.12.0 because these package versions have conflicting dependencies."
Except, any way I have tried to fix this error has just made it worse.
What do I do?

Missing token for lab3

The TranspilerService requires a different token than the one used for the lab grading: QXToken.

Adding this environment variable fixes it:
%set_env QISKIT_IBM_TOKEN=deleteThisAndPasteYourTokenHere

(It also works by adding the token directly inside .qiskit/qiskit-ibm.json)

The step 3 definition with QiskitRuntimeService is also missing a channel and a token (not as environment variable) to work out of the box.

JSON serializable error

when i m submitting the option_0 and option_1 to the grade_lab4_ex7 ... it is giving the error

TypeError: Object of type UnsetType is not JSON serializable

"The QPY format version being read, 12, isn't supported by this Qiskit version. Please upgrade your version of Qiskit to load this QPY payload"

Qiskit version: 1.1.0

Hi I'm a new comer to the IBM quantum challenge and I run into this problem while verifying exercise 1 in lab 1. While running the code grade_lab1_ex1(qc) the grader returned the error "The QPY format version being read, 12, isn't supported by this Qiskit version. Please upgrade your version of Qiskit to load this QPY payload".

I saw in another post that this problem may come from the mismatch between the QPY and the qiskit-ibm-runtime versions, but the error in the post I read said 10 instead of 12, as in my error, and the solution given in that post didn't work for me.

post: Qiskit/qiskit-ibm-runtime#1332 (comment)

Im running on a MacBook Pro with an M1 pro apple silicon and another colleague with an M2 MacBook Air is also running into this problem so there may be some compatibility problems too.

Any suggestions on how to fix this?

Can't run lab 0 locally: ImportError: cannot import name 'ValidationInfo' from 'pydantic'

Steps to Repro

clone this repo. I cloned today, and am at: 1041d44
cd ibm-quantum-challenge-2024/content/lab_0
ipython lab-0.ipynb

Tried on an M1 Mac with Python 3.11.5

Actual behavior

The line from qiskit_ibm_runtime import EstimatorV2 as Estimator
fails with ImportError: cannot import name 'ValidationInfo' from 'pydantic'.
This is the same error message as in Qiskit/qiskit-ibm-runtime#1577

Full error message:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 5
      3 from qiskit import QuantumCircuit
      4 from qiskit.quantum_info import SparsePauliOp
----> 5 from qiskit_ibm_runtime import EstimatorV2 as Estimator
      6 from qiskit_aer import AerSimulator
      7 import matplotlib.pyplot as plt

File ~/anaconda3/lib/python3.11/site-packages/qiskit_ibm_runtime/__init__.py:220
    217 from .utils.utils import setup_logger
    218 from .version import __version__
--> 220 from .estimator import (  # pylint: disable=reimported
    221     EstimatorV2,
    222     EstimatorV1,
    223     EstimatorV1 as Estimator,
    224 )
    225 from .sampler import (  # pylint: disable=reimported
    226     SamplerV2,
    227     SamplerV1,
    228     SamplerV1 as Sampler,
    229 )
    230 from .options import Options, EstimatorOptions, SamplerOptions, OptionsV2

File ~/anaconda3/lib/python3.11/site-packages/qiskit_ibm_runtime/estimator.py:30
     28 from .runtime_job_v2 import RuntimeJobV2
     29 from .ibm_backend import IBMBackend
---> 30 from .options import Options
     31 from .options.estimator_options import EstimatorOptions
     32 from .base_primitive import BasePrimitiveV1, BasePrimitiveV2

File ~/anaconda3/lib/python3.11/site-packages/qiskit_ibm_runtime/options/__init__.py:98
      1 # This code is part of Qiskit.
      2 #
      3 # (C) Copyright IBM 2022, 2024
   (...)
     10 # copyright notice, and modified files need to carry a notice indicating
     11 # that they have been altered from the originals.
     13 """
     14 =====================================================
     15 Primitive options (:mod:`qiskit_ibm_runtime.options`)
   (...)
     95
     96 """
---> 98 from .environment_options import EnvironmentOptions
     99 from .execution_options import ExecutionOptions
    100 from .execution_options import ExecutionOptionsV2

File ~/anaconda3/lib/python3.11/site-packages/qiskit_ibm_runtime/options/environment_options.py:17
     13 """Options related to the execution environment."""
     15 from typing import Optional, Callable, List, Literal
---> 17 from .utils import primitive_dataclass
     19 LogLevelType = Literal[
     20     "DEBUG",
     21     "INFO",
   (...)
     24     "CRITICAL",
     25 ]
     28 @primitive_dataclass
     29 class EnvironmentOptions:

File ~/anaconda3/lib/python3.11/site-packages/qiskit_ibm_runtime/options/utils.py:23
     20 from dataclasses import is_dataclass, asdict
     21 from numbers import Real
---> 23 from pydantic import ConfigDict, ValidationInfo, field_validator
     24 from pydantic.dataclasses import dataclass
     26 from qiskit.providers.backend import Backend

ImportError: cannot import name 'ValidationInfo' from 'pydantic' (/Users/mheiber/anaconda3/lib/python3.11/site-packages/pydantic/__init__.cpython-311-darwin.so)

Expected behavior

Runs without import errors

thanks for your work on the Quantum Challenge

Lab 1

why Can't i build a bell state circuit with single z and x and cnot gate but it's possible with H gate... (Lab1)
any help is greatly appreciated

Issues submitting ex_5, lab1

I have built the response for lab_1_ex_5, but when I submit the answer for grading, the grader returns that the response is incorrect. I have used the correct backend (Sherbrooke), the optimization, I have tried 0,1,2 and 3. I also set the circuit in the ISA as in the previous exercise, ansatz. There is not much place to make a mistake, but the grader does not accept the answer.

I ran the next instruction, and I got the ISA representation of the ansatz circuit.

Any help will be greatly appreciated.

grade_lab0_ex1

In Challenge 2024... I could fase some error while doing my exercise in qiskit which shows like "grade_lab0_ex1 is not defined".... Also I couldn't install version: 1.0 instead version 1.1 how should I upgrade it.(I'm a pretty beginner)

Can't run lab 0 on Google Collab: 401 even though I refreshed the API key several times

The line:

grade_lab0_ex1(observables) is failing with:

Failed: 401 Client Error: Unauthorized for url: https://auth.quantum.ibm.com/api/users/loginWithToken

even though I set an API key and confirmed that the environment variable is set. I also tried generating a new API key and re-running several times. I see there was a recent issue (https://docs.quantum.ibm.com/announcements/service-alerts/2024-06-05-api-token-refresh) that required a token refresh, but several refreshes didn't solve the problem.

Thanks for your work on the June challenge and cool platform and learning materials.

Problem in submitting the function to grader (ibm challenge 2024)

Already i have implemented the code but when i am submitting to grade_lab1_ex6 it is giving error " you need to implement the code to get the result".

def cost_func(params, ansatz, hamiltonian, estimator,callback1_dict):
"""Return estimate of energy from estimator

Parameters:
    params (ndarray): Array of ansatz parameters
    ansatz (QuantumCircuit): Parameterized ansatz circuit
    hamiltonian (SparsePauliOp): Operator representation of Hamiltonian
    estimator (EstimatorV2): Estimator primitive instance

Returns:
    float: Energy estimate
"""
pub = (ansatz,hamiltonian,params)
result = estimator.run([pub])
energy = result.result()[0].data.evs

#return energy,result

callback1_dict["iters"] += 1
callback1_dict["prev_vector"] = params
callback1_dict["cost_history"].append(result)

Don't change any code past this line

print(energy)
return energy, result

grade_lab1_ex6(cost_func) ## while running this, got the below error
error : [0.70898438]
You need to implement code to get a result.

LAB3 : Service Error In Transpiler-AI

"I am working on Lab 3, Exercise 1, and I encountered an issue when running the following cell:

circuit_ai_false = transpiler_ai_false.run(circuit)

The error message I receive is:

INFO: qiskit_transpiler_service.transpiler_service: Requesting transpile to the service
ERROR: qiskit_transpiler_service.ai.service_wrapper: Service error: 403 Client Error: Forbidden for url: ......

Grader related error (my python version is Python 3.11.9)

Running command git clone --filter=blob:none --quiet https://github.com/qiskit-community/Quantum-Challenge-Grader.git /private/var/folders/45/yv52f3rn2r15z_86trmcthxm0000gn/T/pip-req-build-7f2b99g0
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
error: subprocess-exited-with-error

note: This error originates from a subprocess, and is likely not a problem with pip.
Note: you may need to restart the kernel to use updated packages.
Screenshot 2024-06-11 at 4 07 42 PM

Grader_lab4_ex6 performance related issue

While submitting the results_test to the grade_lab4_ex6 function i m getting the 52.6% performance. However, i my system performance is around 84%

Performance for this set of parameters: 84.11407470703125
Performance for this set of parameters: 84.051513671875
Performance for this set of parameters: 84.32769775390625
Performance for this set of parameters: 83.88214111328125
Performance for this set of parameters: 84.17205810546875
Performance for this set of parameters: 83.97064208984375
Performance for this set of parameters: 84.22393798828125
Performance for this set of parameters: 84.12017822265625
Performance for this set of parameters: 84.31396484375
Performance for this set of parameters: 84.393310546875

Lab4 exercise 3 issue

Hey,
As far as I understand, exercise 3 is about finding the best result generated by the given code.
My optimization converged, and the first two exercises passed, but all of the results could not pass the grading.

download
download

best_result_index = 0 1 2 3 4 no matter what here
grade_lab4_ex3(res_list[best_result_index])

Submitting your answer. Please wait...
Oops 😕! Performance: 49.93% < 90%
Please review your answer and try again.

Can anyone help with this issue?
Thx!

Lab 3

If there are only 2 graded exercises for the third lab, why does the challenge website say "You have completed 2 out of 6 questions?"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.