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

  Рет қаралды 13,233

Qiskit

Qiskit

Күн бұрын

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

Пікірлер: 63
@remingtonsmith1372
@remingtonsmith1372 20 күн бұрын
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.
@DerekWangIBM
@DerekWangIBM 18 күн бұрын
Very helpful, thanks!
@tinto278
@tinto278 Ай бұрын
I was expecting the Qubit's to print "Hello World" 😂 Man it looks like I have a lot to learn.
@AlexanderNachtigall
@AlexanderNachtigall 29 күн бұрын
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 23 күн бұрын
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.
@DerekWangIBM
@DerekWangIBM 13 күн бұрын
This is great to hear!
@marekhubka2887
@marekhubka2887 Ай бұрын
Hey, is there any detailed class on operators or some other resource? That is one part I cant still wrap my head around.
@felipefernandesfanchini6094
@felipefernandesfanchini6094 Ай бұрын
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 Ай бұрын
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
@MrArtalink
@MrArtalink Ай бұрын
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 Ай бұрын
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 21 күн бұрын
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 13 күн бұрын
Unfortunately, I don't think there's a feature for estimating resource cost, especially on a device by device basis, until after you submit.
@HAKIMA_HAMID
@HAKIMA_HAMID Ай бұрын
Sir can you please try the bb84 simulation using qiskit ?
@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 Ай бұрын
@@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.
@shira-cd9hn
@shira-cd9hn Күн бұрын
hello, im facing an error at step -2 transpilation at 18.23 min the error shows : raise AccountNotFoundError("Unable to find account.")
@toobaqasim3300
@toobaqasim3300 29 күн бұрын
I am looking for BB84 simulation on Qiskit.
@CaceresHoracio
@CaceresHoracio Ай бұрын
great!!
@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.
@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
@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.
@Ibbysz
@Ibbysz Ай бұрын
Starting to see how I sound to my parents when explaining classical computing 😭
@mikecole2837
@mikecole2837 9 күн бұрын
The only thing I've learned in this video is that quantum software is in its infancy.
@martinbombardelli1324
@martinbombardelli1324 Ай бұрын
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)
@Hirdayanshkanojiya
@Hirdayanshkanojiya Ай бұрын
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 Ай бұрын
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.
@kelleclark4521
@kelleclark4521 2 сағат бұрын
since I restarted the kernel after doing the pip install qiskit_aer at this point, I had to run all to get the variables back
@jorgeas
@jorgeas 21 күн бұрын
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 18 күн бұрын
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 18 күн бұрын
@@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)
@Tomas-zv2js
@Tomas-zv2js 3 күн бұрын
Whenever I type in qc.daw() my circuit is not drawing. Please help
@RenderedUselessness
@RenderedUselessness 6 сағат бұрын
qc.draw()
@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.
@michaelcharlesthearchangel
@michaelcharlesthearchangel Ай бұрын
You all would benefit from watching my KZfaq 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 10 күн бұрын
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.
@jreamscape
@jreamscape 3 күн бұрын
bruh
Final increíble 😱
00:39
Juan De Dios Pantoja 2
Рет қаралды 31 МЛН
Super gymnastics 😍🫣
00:15
Lexa_Merin
Рет қаралды 8 МЛН
Exploring the IBM Quantum Lab with Dr. Olivia Lanes
10:16
Qiskit
Рет қаралды 60 М.
The easiest way to chat with Knowledge Graph using LLMs (python tutorial)
18:35
How To Code A Quantum Computer
20:42
Lukas's Lab
Рет қаралды 482 М.
My FULL Obsidian Zettelkasten Workflow in 10 minutes
10:19
FromSergio
Рет қаралды 132 М.
The Map of Topological Quantum Computing - a NEW Kind of Quantum Computer
23:19
What does the second derivative actually do in math and physics?
15:19
😱НОУТБУК СОСЕДКИ😱
0:30
OMG DEN
Рет қаралды 3,2 МЛН
Эффект Карбонаро и бумажный телефон
1:01
История одного вокалиста
Рет қаралды 2,7 МЛН