Hello World | Coding with Qiskit 1.x | Programming on Quantum Computers

Поделиться
HTML-код
  • Опубликовано: 1 июн 2024
  • Welcome back to Coding with Qiskit, where IBM research scientist Dr. Derek Wang will get you up to speed with the latest developments in quantum computers for your own work.
    What is Hello World? When installing anything new, whether it’s a language or package, it’s standard practice to include a “Hello World” example. The purpose is twofold: first, we ensure that the installation was done correctly, and second, we want demonstrate what a typical application workflow looks like. Here, we’re going to prepare a two-qubit Bell state and then, to highlight how this approach can scale to utility-scale circuits on over 100-qubit circuits, we’ll generalize our approach.
    Qiskit Resources:
    GitHub notebook for this episode: github.com/derek-wang-ibm/cod...
    Install Qiskit - qisk.it/cwq-install
    Hello World Tutorial: docs.quantum.ibm.com/start/he...
    Introduction to Primitives: docs.quantum.ibm.com/run/prim...
    Error Suppression and Mitigation: docs.quantum.ibm.com/run/conf...
    Qiskit Github Notebook: qisk.it/cwq-ep2
    Miniconda: docs.anaconda.com/free/minico...
    A free IDE: code.visualstudio.com/
    Qiskit GitHub: github.com/Qiskit
    IBM Quantum: quantum.ibm.com/
    #ibmquantum #learnquantum #qiskit
  • НаукаНаука

Комментарии • 58

  • @remingtonsmith1372
    @remingtonsmith1372 15 дней назад +9

    Some lingo that may be useful!
    1. Bell State
    A Bell state in quantum computing is a special type of entangled state where two qubits are linked such that the state of one qubit instantly influences the state of the other, no matter the distance between them.
    2. Superposition
    The principle that a qubit can exist in multiple states (0 and 1) simultaneously, rather than being in a single state like a classical bit.
    3. Hadamard Gate
    A basic operation that transforms a qubit into an equal superposition of its 0 and 1 states, creating a state where the qubit has a 50% chance of being measured as 0 and a 50% chance of being measured as 1.
    4. The CNOT (Controlled NOT) Gate
A two-qubit operation where the state of the second qubit (target) is flipped if the first qubit (control) is in the state 1, otherwise, the target qubit remains unchanged.
    5. Pauli Operators
    A set of three basic matrices (Pauli-X, Pauli-Y, and Pauli-Z) used to describe quantum gates that can change the state of a qubit by flipping its state, rotating it, or inverting its phase.
    In quantum computing, operators like ZZ, XX, and YY perform specific transformations on qubit states, altering their properties such as phase, amplitude, or entanglement.

  • @tinto278
    @tinto278 27 дней назад +2

    I was expecting the Qubit's to print "Hello World" 😂
    Man it looks like I have a lot to learn.

  • @AlexanderNachtigall
    @AlexanderNachtigall 25 дней назад

    Awesome Derek, a fantastic Qiskit Intro! Well done and keep going compiling the tutorials in the same style... really appreciated the condensed and swift walkthrough the code and step by step instructions... 👍

  • @renatevankempen65
    @renatevankempen65 19 дней назад +1

    Thank you so much for the clear explanation, making it easy to follow and working on my end as well. I've now completed my very first job on the IBM quantum platform 🙂! Will definitely continue with this series and enhancing my quantum knowledge.

  • @felipefernandesfanchini6094
    @felipefernandesfanchini6094 Месяц назад +4

    Nice to see new videos for qiskit 1.0 . Congratulations!!! But, instead of the estimator, how to calculate the count to create the histogram, as was previously done with get_counts?

    • @DerekWangIBM
      @DerekWangIBM Месяц назад +2

      You can use Sampler instead. I will show how this can be done in a future video dedicated to Primitives.

    • @oluwapelumiolubayo2043
      @oluwapelumiolubayo2043 Месяц назад

      Great video! I am also getting stuck on how to implement get_counts on the new version

    • @DerekWangIBM
      @DerekWangIBM Месяц назад

      @@oluwapelumiolubayo2043 See the next episode on Primitives, where I show how to get counts with SamplerV2

  • @marekhubka2887
    @marekhubka2887 Месяц назад +1

    Hey, is there any detailed class on operators or some other resource? That is one part I cant still wrap my head around.

  • @MrArtalink
    @MrArtalink 28 дней назад

    Hi, thanks for these lessons! They are incredibly useful. I have a quick question, when we initialized the two qubits q0 and q1 are they automatically in the |0> state? (are they both in the same state..?)

    • @DerekWangIBM
      @DerekWangIBM 27 дней назад +1

      The convention is to assume that the qubits start in the 0 state. For the two-qubit example, we then apply a Hadamard gate to the 0th qubit, so it would no longer be in the 0 state.

  • @ravijha7301
    @ravijha7301 16 дней назад

    Hi Derek, great video and initiative! I attempted to implement a 5-qubit GHZ example on IBM Kyoto, but I received a warning that the task would take more than 10m to execute. Surprisingly, when I tried the same on IBM Brisbane, it completed in nearly 50 seconds. This compels me to ask: How can I determine which system is more suitable for a particular task? Many thanks in anticipation.

    • @DerekWangIBM
      @DerekWangIBM 8 дней назад

      Unfortunately, I don't think there's a feature for estimating resource cost, especially on a device by device basis, until after you submit.

  • @techjunk8467
    @techjunk8467 Месяц назад

    Is the transpiling section you used specific for the ibm_brisbane backend? Or can it be used for any device

    • @DerekWangIBM
      @DerekWangIBM Месяц назад

      It should work for any backend, as long as you swap out the backend name "ibm_brisbane" with your target backend. Some of the information being sent to the preset pass manager includes the coupling map, native gates, and number of gates, and these properties can of course change from device to device.

    • @techjunk8467
      @techjunk8467 Месяц назад

      @@DerekWangIBM QiskitError: 'Number of qargs does not match (2 != 100)'
      I keep having this error from the operators_transpiled_list. What could be the issue?

    • @DerekWangIBM
      @DerekWangIBM Месяц назад +1

      @@techjunk8467 It appears you did not create operators with 100 qubits. Instead, you are applying a layout for 100 qubits on observables that have 2 qubits, which are likely leftover from the initial 2-qubit example.

  • @HAKIMA_HAMID
    @HAKIMA_HAMID Месяц назад

    Sir can you please try the bb84 simulation using qiskit ?

  • @Hirdayanshkanojiya
    @Hirdayanshkanojiya Месяц назад +3

    Sir i have problem with installation process it just shows my name of pc in terminal anad when i try to create another environment for anaconda(like u) it just shows an error. Can you please help me to resolve my issue?

    • @DerekWangIBM
      @DerekWangIBM Месяц назад

      It sounds like `conda` is not active. See if it's installed by typing `conda --version` in your terminal. If conda is indeed there, try activating it: `conda init`. When conda is active, you should see (base) before your username. Once it's active, you should be able to create an environment within conda.

    • @HrvojeKalic
      @HrvojeKalic Месяц назад +1

      Happened to me also.
      You have to start your terminal in "MiniConda mode". Go to Start Menu and type 'Anac' and there should be something like "Anaconda Prompt (miniconda3)". Start that command/script/program. Someone smarter than me should know how to do this in the VS Code.

    • @DerekWangIBM
      @DerekWangIBM Месяц назад

      @@HrvojeKalic Thank you! I only showed installation on Mac in the video. Glad that differences with PC could be resolved here.

    • @Hirdayanshkanojiya
      @Hirdayanshkanojiya Месяц назад

      @@HrvojeKalic thank you sir i will try and see if the problem is solved or not

    • @Hirdayanshkanojiya
      @Hirdayanshkanojiya Месяц назад

      @@DerekWangIBM thanks sir

  • @kutubkhanbhatiya4573
    @kutubkhanbhatiya4573 Месяц назад

    When I tried to run the estimator part of the code it is showing that qc is not defined, why is it happening, is it because I refreshed the VS Code, because when I again run all of the code from the start it works

    • @DerekWangIBM
      @DerekWangIBM Месяц назад

      Run the block that defines the `qc` before trying to pass it into the Estimator.

  • @user-nj6zi6kh3e
    @user-nj6zi6kh3e Месяц назад

    Hello, I have an error saying that I am unauthorized with the code 'backend=QiskitRuntimeService().get_backend(backend_name)'. (16:40) Can you help me? Thanks!

    • @DerekWangIBM
      @DerekWangIBM Месяц назад

      It's possible you do not have access to that particular backend that I use in the video. Use a backend that you do have access to.

  • @CaceresHoracio
    @CaceresHoracio Месяц назад

    great!!

  • @martinbombardelli1324
    @martinbombardelli1324 Месяц назад +1

    I did't get why we are intoducing operators and not just running the qc to get 50% |00> and 50 % |11> what are we doing here ?

    • @DerekWangIBM
      @DerekWangIBM Месяц назад

      Sure, one could do that too. In fact, we do exactly what you suggest in an upcoming video :)

    • @martinbombardelli1324
      @martinbombardelli1324 Месяц назад

      @@DerekWangIBM Can't wait to see it, i'm trying to get a grasp of qiskit but there is son few documentation on version 1.X (except official one of course)

  • @user-nj6zi6kh3e
    @user-nj6zi6kh3e Месяц назад

    what extensions did you install for putting colors in the code?

    • @DerekWangIBM
      @DerekWangIBM Месяц назад

      I'm using the default dark color theme in Visual Studio Code.

    • @user-nj6zi6kh3e
      @user-nj6zi6kh3e Месяц назад

      @@DerekWangIBM I mean your QiskitRuntumeService is written in nice green color which is readable, but my code is all shown in white🥲

    • @user-nj6zi6kh3e
      @user-nj6zi6kh3e Месяц назад

      @@DerekWangIBM I was wondering about the color of the code because I can see nice readable green color from your library code but not in mine.

  • @toobaqasim3300
    @toobaqasim3300 25 дней назад

    I am looking for BB84 simulation on Qiskit.

  • @sachinpathak8935
    @sachinpathak8935 Месяц назад

    Sir, When i am to do:
    from qiskit import IBMQ
    this is showing error "ImportError Traceback (most recent call last)
    Cell In[6], line 1
    ----> 1 from qiskit import IBMQ
    ImportError: cannot import name 'IBMQ' from 'qiskit' (C:\Users\sachin.pathak\AppData\Local\anaconda3\Lib\site-packages\qiskit\__init__.py)"
    even I have upgraded my qiskit to new version. Please suggest.

    • @DerekWangIBM
      @DerekWangIBM Месяц назад

      The module IBMQ does not exist in Qiskit I believe. If you're trying to access providers and backends, you'll need to `pip install qiskit-ibm-runtime`.

    • @sachinpathak8935
      @sachinpathak8935 Месяц назад

      @@DerekWangIBM thanks for your reply. I already have installed ibm run time in my system still it is not working.

  • @jorgeas
    @jorgeas 17 дней назад

    In Step 3 for the n-qubit GHZ state, I'm getting this error:
    ValueError: cannot create object arrays from iterator
    The line causing the error is:
    job = estimator.run([(qc_transpiled, operators_transpiled_list)])

    • @DerekWangIBM
      @DerekWangIBM 14 дней назад

      The Estimator().run() functions expects `qc_transpiled` and `operators_transpiled_list` to be lists, not iterators. So make sure you've actually instantiated these variables as lists.

    • @jorgeas
      @jorgeas 14 дней назад

      @@DerekWangIBM The thing is, I followed exactly every step. The cell where these variables are defined run well. The other one does not. Not really sure what am I missing here.
      def get_quantum_circuit(n):
      qc = QuantumCircuit(n)
      qc.h(0)
      for i in range(n-1):
      qc.cx(i, i+1)
      return qc
      n = 100
      qc = get_quantum_circuit(n)
      # qc.draw(output='mpl')
      from qiskit.quantum_info import SparsePauliOp
      operator_strings = ['Z' + 'I' * i + 'Z' + 'I' * (n - i - 2) for i in range(n - 1)]
      print(operator_strings)
      print(len(operator_strings))
      operators = [SparsePauliOp(operator_string) for operator_string in operator_strings]
      from qiskit_ibm_runtime import QiskitRuntimeService
      from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
      backend_name = "ibm_brisbane"
      backend = QiskitRuntimeService().get_backend(backend_name)
      pass_manager = generate_preset_pass_manager(optimization_level=1, backend=backend)
      qc_transpiled = pass_manager.run(qc)
      operators_transpiled_list = [op.apply_layout(qc_transpiled.layout) for op in operators]
      from qiskit_ibm_runtime import EstimatorV2 as Estimator
      from qiskit_ibm_runtime import EstimatorOptions
      options = EstimatorOptions()
      options.resilience_level = 1
      options.optimization_level = 0
      options.dynamical_decoupling.enable = True
      options.dynamical_decoupling.sequence_type = "XY4"
      estimator = Estimator(backend, options=options)
      job = estimator.run([(qc_transpiled, operators_transpiled_list)])
      job_id = job.job_id()
      print(job_id)

  • @Ibbysz
    @Ibbysz 26 дней назад +1

    Starting to see how I sound to my parents when explaining classical computing 😭

  • @arvindjain3208
    @arvindjain3208 Месяц назад

    Hello sir I love this series so knowledgeable and amazing sir can I join ibm quantum as a student

    • @devanshjaiswal9502
      @devanshjaiswal9502 Месяц назад

      You can visit the IBM quantum website, look for a careers page, and you might find something that interests you , you can apply there

  • @mikecole2837
    @mikecole2837 4 дня назад

    The only thing I've learned in this video is that quantum software is in its infancy.

  • @michaelcharlesthearchangel
    @michaelcharlesthearchangel Месяц назад

    You all would benefit from watching my RUclips videos where I trained ChatGPT on my Quantum Language Model.

  • @Abhigyan103
    @Abhigyan103 Месяц назад

    What is pauli ?

    • @user-xm5vv4dy3b
      @user-xm5vv4dy3b Месяц назад

      Pauli is referred to matrices, specif a set of three 2 × 2 complex matrices that are Hermitian, involutory and unitary.

    • @SiddharthSharma360
      @SiddharthSharma360 Месяц назад

      Rather ask who is pauli

  • @jm76430
    @jm76430 5 дней назад +2

    it would be excellent if the folks doing work in the quantum space would stop naming things after themselves and instead give them descriptive names.