Skip to main content

Questions tagged [qiskit]

Qiskit is an open source SDK for working with quantum computers at the level of pulses, circuits and application modules. If appropriate, also use the [programming] tag. Please include the version of Qiskit you use when using this tag.

Filter by
Sorted by
Tagged with
5 votes
2 answers
2k views

Test equivalence of circuits exactly on qiskit

I have two circuits that I believe are equivalent. When I say 'equivalent' I mean that they have equivalent unitary representations up to a global phase. How can one check this using Qiskit? How I ...
Jason Fring's user avatar
5 votes
1 answer
705 views

How to not optimize the quantum gates in a qiskit circuit when running it in the real device?

I have been trying to run two circuits in the ibmq_london device, the one resulting of applying one X gate on qubit $0$ and the one that applies two X gates. I know that applying two X gates is the ...
Paula G's user avatar
  • 389
5 votes
1 answer
5k views

How to implement if statement based on measurement results in qiskit?

I tried to implement three qubit bit flip code in qiskit and need to get the result of measurements and then apply recovery quantum operations conditioned on the measurement results. The following is ...
Jacey Li's user avatar
  • 585
5 votes
1 answer
881 views

Understanding quantum teleportation algorithm from qiskit tutorials

I am very new to quantum computing and I have recently started to experiment with qiskit module in python, by following tutorials and implementing simple algorithms....
Ach113's user avatar
  • 223
5 votes
3 answers
1k views

How do I get out 2 measurements from the same execution on Qiskit?

Here's my circuit, trying to checkout the effect of measurement on the IBM Q circuit. Here you can see I do 2 different measurement at different time, and I hope to be able to see both results. ...
Jack Nathan's user avatar
5 votes
3 answers
2k views

Can't draw figures with Qiskit in Visual Studio

I'm using Qiskit in Visual Studio 2019. I want to draw quantum circuits, but it only shows their sizes with text instead of figures. The output on the interactive window is like this. ...
Lemonade's user avatar
5 votes
2 answers
2k views

How to create a condition on only one classical bit when we have a total of 2 classic bits in the system

I am trying to make a quantum circuit with one qubit and 2 classical bits for each measurment in the system below: I want to make condition on the first bit: if the first collapse to zero so x ...
Daniel Vainshtein's user avatar
5 votes
1 answer
1k views

What is Qconfig in QISKit and how do I set it up?

To use certain things in QISKIt, such as acessing the real quantum processors, it seems that there is a file 'Qconfig.py'. That needs to be set up. How do I do this?
James Wootton's user avatar
5 votes
1 answer
2k views

Qiskit: PauliTrotterEvolution for Hamiltonian simulation

Context: I have H (in qiskit.opflow notation). I want a circuit which does exp(-itH) Solution attempt: I think qiskit.opflow.evolutions.PauliTrotterEvolution should do the trick. Also, I found this ...
Andreas Burger's user avatar
5 votes
1 answer
2k views

Difference between Aer.get_backend('aer_simulator') and AerSimulator()

In Qiskit, there are several ways to choose simulator: one is from qiskit import Aer backend = Aer.get_backend('aer_simulator') result = backend.run(circ).result() ...
sotowa's user avatar
  • 131
5 votes
1 answer
200 views

Where does the "correction" in quantum error correction occur, specifically when using repetition codes?

I'm reading the part of the qiskit textbook that deals with this (https://qiskit.org/textbook/ch-quantum-hardware/error-correction-repetition-code.html) and so far it seems as though they're just ...
John Macintosh's user avatar
5 votes
2 answers
306 views

Qiskit: How can I modify Grover's algorithm to search for a state that doesn't belong to a basis set?

Let's say I need to find the state $111$ in a "database" that is not the computational basis for a 3-qubits system (because it doesn't contain all of the basis vectors or contains the same ...
Alfred's user avatar
  • 93
5 votes
3 answers
860 views

How to create the logical $|0_L\rangle$ state for the Steane's 7-qubit code?

I don't know how to prepare using Qiskit the following state in order to implement a Steane's 7-qubit code circuit (I omit the normalization factor): \begin{align*} |0_L\rangle =&|0000000\rangle+|...
Hub One's user avatar
  • 75
5 votes
2 answers
3k views

How to measure in the bell basis?

The question is quite straightforward, I have some two qubit state and I want to measure it in the Bell basis. This question answers me partly, but I still have some doubts because, I thought that ...
Bidon's user avatar
  • 838
5 votes
1 answer
4k views

Get result measurement into a circuit with Qiskit

I'm trying to implement the three qubit bit flip code in Qiskit. Therefore, I need to get the result of a measure of two ancilla qubits, to deduce which gate I need to use do recover my logical qubit....
lufydad's user avatar
  • 471
5 votes
1 answer
654 views

Controlled unitary from the HHL algorithm – practical implementation using Qiskit

I have a question about the implementation of the controlled unitary $e^{iAt}$, from the paper Demonstration of a Quantum Circuit Design Methodology for Multiple Regression, using the Qiskit framework....
ljubab's user avatar
  • 53
5 votes
2 answers
2k views

Path to learn Qiskit as a tool for the future

I am an undergraduate in Engineering physics, yet to take classes on Quantum mechanics, but none (if I'm not mistaken) on quantum information and quantum algorithms, and I am curious about the subject ...
Bidon's user avatar
  • 838
5 votes
2 answers
535 views

Checking value of variable using quantum approach

A beginner question after watching few videos. Say, var=a; var can be either of two values, ...
Dr.PB's user avatar
  • 183
5 votes
1 answer
466 views

How are quasiprobabilities calculated when sampling from a nonsimulated ibm backend

I've started playing around with IBM's quantum platform, I have a simple test circuit I've been working with ...
Julien's user avatar
  • 53
5 votes
1 answer
196 views

I don't understand unitary of ${e^{iAt}}$ from HHL algorithm

I tried to implement the following circuit in the image below but with the red circled gates replaced with a unitary controlled ${e^{iAt/2}}$ and controlled ${e^{iAt/4}}$ The image came from this ...
Tanin Imanothai's user avatar
5 votes
2 answers
1k views

Bloch Sphere of Qiskit logo

Trying to plot the Bloch Sphere of the IBM Qiskit logo ...
Van Peer's user avatar
  • 577
5 votes
1 answer
581 views

What is Qiskit's Transpiler method for unitary synthesis?

As I could found in here how the transpile works in qiskit, I understood that transpile gets arbitrary Unitary gate $U$ and some set of basis gates as input, and produce some quantum circuit of $U$ ...
Changu Kang's user avatar
5 votes
1 answer
244 views

Is there a physical definition of barrier operation in qiskit?

As far as I know, we can use barrier method in qiskit to split circuits into two sets to prevent the optimization. However, is there any physical meaning of the barrier? Like a delay operation or ...
peachnuts's user avatar
  • 1,393
5 votes
1 answer
491 views

HHL algorithm, How can I get result from register $|b\rangle$?

From the paper A survey on HHL algorithm: From theory to application in quantum machine learning , I use qasm code from here. I try to follow the example in page 7. with Ax = b and the answer x ...
Tanin Imanothai's user avatar
5 votes
1 answer
797 views

Why are there such different UGate and U3Gate implementations in the Qiskit documentation?

The documentation for the new version Qiskit 0.20.0 states that: UGate is "Implemented using two X90 pulses on IBM Quantum systems: $U(θ,ϕ,λ)=RZ(ϕ−π/2)RX(π/2)RZ(π−θ)RX(π/2)RZ(λ−π/2)$" ...
Psanfi's user avatar
  • 306
5 votes
1 answer
390 views

Qiskit Portfolio Optimization Application

I recently got flung into the world of quantum computing and I'm a beginner at coding. I was assigned to do the Portfolio Optimization tutorial of the Qiskit Finance Tutorials and input real data. ...
Lana's user avatar
  • 81
5 votes
2 answers
1k views

How to read the elements of a circuit in qiskit?

I would like to know if there is a way to read the elements of a circuit. What I mean is if I have a QuantumCircuit object, can I obtain the gates that are applied ...
Paula G's user avatar
  • 389
5 votes
1 answer
1k views

How do we discard or delete or reuse a qubit at the end, on Qiskit?

After I have finished computing and operating a specific circuit on a set of (say) 4 qubits, my final interest only is to deal with (say) two of the four qubits. Then, how do I recycle or delete the ...
Sachin S Bharadwaj's user avatar
5 votes
1 answer
2k views

Is there a way to develop a multiple controlled X or Z gate on Qiskit without using ancillary qubits?

I know for instance I can derive a cccX gate using 2 Toffoli gates on 5 qubit wire or ccccX with 3 Toffoli gates and 7 qubits and so on. you will notice the depth is increasing as the number of ...
Ab1's user avatar
  • 51
5 votes
1 answer
185 views

Graphing the decoherence of qubits being used to perform an algorithm

How would I be able to graph the decoherence of qubits being used to perform an algorithm? I'm working with the IBMQ Qiskit framework and I'm trying to write a program that allows me to find the ...
alfonso guevara's user avatar
5 votes
1 answer
515 views

Introspecting quantum circuit execution on Qiskit Aer simulators

Is there any way to get information from intermediate points in the execution of a quantum circuit. This is not possible on real quantum hardware but would be very useful on the Aer simulators for ...
Daniel Mahler's user avatar
5 votes
1 answer
345 views

Quantum SVM Algorithm Error on import

I am experimenting with some Qiskit ACQUA AI algorithms which require the following import statement: from datasets import * However, ...
DrHamed's user avatar
  • 181
5 votes
2 answers
3k views

How to get probabilities from a simulator without sampling for a Qiskit circuit with measurement throughout

Suppose we have a Qiskit circuit like from qiskit import QuantumCircuit qc = QuantumCircuit(1,1) qc.h(0) qc.measure(0,0) If we want to find the probabilities for ...
James Wootton's user avatar
5 votes
2 answers
2k views

controlled-Z rotation gates in symmetrical fashion

I was going through the qiskit textbook and in this chapter I came across a statement under the topic "Kickback with the T-gate" related to the Controlled-Z gate that the controlled-Z ...
neel.spartacus's user avatar
5 votes
1 answer
577 views

Defining a custom parametric gate in Qiskit in terms of standard gates?

Here it is explained how to define a custom non-parametric gate in Qiskit. How do I define a new parametric gate? For example, I want to have the $CCR_y$ gate defined as in order to use it as ...
mavzolej's user avatar
  • 1,971
5 votes
1 answer
2k views

Deutsch's algorithm in Qiskit

I am trying to understand and implement the Deutsch algorithm. I follow the logic from Nielsen book and I started to implement it in Qiskit. For implementing the oracle, I use a CNOT gate and now I ...
marissalianam's user avatar
5 votes
1 answer
864 views

Chose how to map virtual qubits to physical qubits

I'm currently trying to specify an initial_layout for a circuit on a IBM Q device. Looking at the device's topology I would like to use the less noisy qubits in order to have the best performance. ...
Samuel Beaussant's user avatar
5 votes
1 answer
421 views

Entanglement state preparation by using amplitude values

I have an algorithm that uses QRAM, after accessing the given QRAM that store M d-dimensional classical vectors, the state of the index register and the data register become entangled. But for now I ...
Aman's user avatar
  • 503
5 votes
1 answer
504 views

Is there a common set of modules for user-defining-quantum-gate for QISKit

I am wondering if there exists a common library or a set of modules for user-defining-quantum-gate for QISKit. If it does, could you tell me? By referring to Define Quantum Gates and How to define ...
Bick's user avatar
  • 842
5 votes
1 answer
358 views

Qiskit: QAOAnsatz circuit with custom Hamiltonian

I am trying to implement the Quantum Approximate Optimization Ansatz by creating a parametrized subcircuit $$V (α) = e^{−iH_M α_1} e^{−iH_D b_1} ... e^{−iH_M α_n} e^{−iH_D b_n}$$ with the custom ...
consthatza's user avatar
5 votes
1 answer
91 views

Is it possible to set quantum volume in IBM Quantum simulator?

A quantum volume serves as a metric of a quantum processor quality. So far, IBM Quantum provides processors with quantum volume up to 128. Freely accessbile processors have QV up to 32. A user using ...
Martin Vesely's user avatar
5 votes
1 answer
670 views

Simulation of a helium molecule using Qiskit

I am trying to compute the ground state energy of He-He using VQE. For this purpose I have utilized Qiskit and have written the following script: ...
user14660's user avatar
5 votes
1 answer
1k views

Qiskit BasicAer & Aer

While I'm simulating grover's algorithm, I found that with BasicAer backend it works well but with Aer it is not. What is the difference between ...
김동민's user avatar
  • 937
5 votes
1 answer
362 views

How to upload .py file to new online Qiskit Notebook

I'm trying to run a program in the Qiskit Notebook on the IBMQ Experience. I need to import some .py files that I've done in order to run my main program but the notebook won't accept .py files. I've ...
Carolina Alves's user avatar
5 votes
0 answers
211 views

How to get the compiled circuits and measurements from a Qiskit Runtime job

I have not been able to find any way to retrieve the compiled circuits and the measurement counts used for a Qiskit Runtime job. This page describes the various error suppression mechanisms available. ...
Elijah Pelofske's user avatar
5 votes
0 answers
114 views

Writing circuits in Qiskit using only Clifford and T gates

Is there a way in Qiskit to write my circuit using only Clifford and T gates (CX, S, H, T and I think also $S^\dagger$ and $T^\dagger$)? With the function compile (with aer simulator) it gives me some ...
stopper's user avatar
  • 473
5 votes
1 answer
653 views

Two qubit gate decomposition using Qiskit

I am writing some python code to be able to optimise the total error in two qubit gate decomposition. I am using the Qiskit module qiskit.quantum_info.synthesis.two_qubit_decompose My question relates ...
shuey97's user avatar
  • 151
5 votes
0 answers
676 views

OpenFermion to Qiskit

Is there a direct way to go from an object generated in OpenFermion to objects usable in Qiskit? I can't find anything about any plugin. It's not too hard to translate into pyQuil and then to Qiskit ...
Andrew Jackson's user avatar
5 votes
0 answers
158 views

Results from looped experiments on IBM Q different than individual experiments

I'm experiencing an issue while using Qiskit where the counts from a job return vastly different values when ran in a loop or as an array of circuits as opposed to single experiments when run by ...
Mav's user avatar
  • 83
5 votes
0 answers
151 views

How can I express controlled unitary operation in QPE of this implementation of HHL?

I have found this implementation of HHL, and I don't understand why the controlled unitary operation is expressed in the form of $\exp(i t_0 A/2)$ and $\exp(i t_0 A/4)$. The rotation of $\pi$ and $\...
Macalcubo's user avatar
  • 133

1 2 3
4
5
48