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.
I'm a little confused, in John's learning videos he says he's gonna use Qiskit notation and says "turn the circuit diagram 90° clockwise to easier remember which qubit is the first" but applying that here q1 would be the first, q0 second 🧐
Hey derek, I followed the exact some codes. but when following the second example, i got stuck in the 'execute on the backend' part. in their an error message came for the line 'options.dynamical_decoupling.sequence.type = "XY4" ' . the error message was 'AttributeError: 'DynamicalDecouplingOptions' object has no attribute 'sequence'. how to fix this problem?
Dr. Wang, I really appreciate you taking the time to create this video series. I am new to Quantum Computing and a little intimidated at the same time. I have a background in Python programming so it makes it a little easier to understand. However, in Step 3, I am getting a Name Error that 'job' name is not defined, did I forget to install something? job is not a variable I thought.
@@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)
@ghillesainouche3329 and @StifTyler I re-downloaded and ran the code from the github and it ran it on ibm_sherbrooke and got a result. I wasn't the same as in the video but it was similar and was not a flat line.
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
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.
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`.
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.
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?
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?
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.
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.
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)])
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.
@@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)
Same error here - says Module Not Found but I can see that it is installed (pip list) and I know that I am in the same environment in VSCode (cwq). Been working this issue for a couple hours now. Still nothing.
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.
You can dynamically select the least busy resource (although I think it ignores some QPUs available). service = QiskitRuntimeService() backend = service.least_busy(operational=True, simulator=False) All the free QPUs are Eagle r3 (at the time of writing this), on some there's huge queue of jobs, delaying your run
Hi Derek, can you help me out? I'm a beginner learning Quantum Computing and Qiskit. I've followed all the steps prescribed in this video. But, at the end, my scatter plot gives me a Straight Line instead of a scattered one as seen in the video. Can you tell me why this happens or what possible mistake I would've done?? Thanks in Advance!
Hello, can someone help me with the following issues I am facing while running the code? In the extended Hello world e.g. for n qubit GHZ state, at step 3: for this "options.dynamical_decoupling.enable = True" line of code I'm getting the error "'bool' object has no attribute 'enable'".. even if I comment it out and run the code it is showing similar error in the very next line. Please tell me why this is happening and how I can correct it.
I am working on windows and for some reason i wasn't able to create a separate environment, hence I didn't bother and continued with my default setup in vs code jyupter nb. I want to know if there will be any drawbacks of doing so.
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... 👍
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..?)
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.
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!
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.
@@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?
@@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.
On running Step 3, job.results(), I was getting error "observable type not supported: " Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings... Please help me out on this one