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
8 votes
1 answer
308 views

Enforcing a particular layout mapping in Qiskit

I would like to ask how to set a particular layout during transpiling. I guess that the layout can be set by the initial_layout parameter in the transpiler. However,...
soara's user avatar
  • 81
7 votes
3 answers
3k views

Why isn't $Ry(\pi/2)$ gate equivalent to Hadamard gate?

I've been experimenting with quantum circuits and can't quite fathom how the difference between states comes together. Speaking in terms of simulations using qiskit,...
Ricardo's user avatar
  • 189
7 votes
1 answer
1k views

How good is basic_device_noise_model() simulating the noise in the quantum computer?

Is there any paper or article about the performance of the noise model using basic_device_noise_model()? For example, like the noise model in the code below. ...
Firepanda's user avatar
  • 105
7 votes
2 answers
1k views

What is this circuit doing?

Can anyone help me understanding what is this circuit doing ? The circuit can be reproduced with qiskitas follows: ...
mpro's user avatar
  • 517
7 votes
3 answers
2k views

Quantum circuit to implement matrix exponential

I want to build a circuit which will implement $e^{iAt}$, where $ A= \begin{pmatrix} 1.5 & 0.5\\ 0.5 & 1.5\\ \end{pmatrix} $ and $t= \pi/2 $. We see that $A$ can be written as, $A=1.5I+0.5X$. ...
Omkar 's user avatar
  • 331
7 votes
3 answers
3k views

How to run a qasm file on IBMQ device?

I can find many qasm examples. How can I run them on different IBMQ devices?
peachnuts's user avatar
  • 1,393
7 votes
3 answers
2k views

Qubit Connectivity of IBM Quantum Computer

When simulating a quantum circuit using the qiskit qasm_simulator, the qubits that you assign to the quantum circuit may be ...
Yitian Wang's user avatar
7 votes
3 answers
3k views

Pennylane and Qiskit for quantum machine learning

I'm interested in quantum computing, specifically in “quantum machine learning” (QML). I'm going to start my masters program in computer science and have previous experience in classical machine ...
Carlos Alfredo Vergara Rojas's user avatar
7 votes
1 answer
2k views

How to selectively apply noise in Qiskit simulations?

In Qiskit it is possible to specify noise models to apply to simulations. This allows noise to be defined for certain operations, like measurement or each type of gate. Is it also possible to change ...
James Wootton's user avatar
7 votes
1 answer
1k views

Would IBM's "compiler" turn my identity circuit into nothing?

If I were to create a circuit with the following gate: $$\tag{1}R_\phi = \begin{bmatrix} 1 & 0 \\ 0 & e^{i \phi} \end{bmatrix},$$ with $\phi$ specified to be equal to 0, then the gate that I ...
user1271772 No more free time's user avatar
7 votes
4 answers
2k views

How to create an Ising coupling gate with Qiskit?

I'm trying to apply a time evolution algorithm for a physical system I'm trying to simulate on QISkit, however, in order to do that, I need to use the so-called Ising coupling gate: $I=\begin{pmatrix}...
Jorge Rodríguez Peña's user avatar
7 votes
1 answer
1k views

What is the purpose of the TDG gate in QISKit?

The QISKIT documentation doesn't explain what a TDG gate does and I can't find it anywhere else online.
Theodore Lewitt's user avatar
7 votes
2 answers
1k views

Which qiskit backend is faster in execution of the quantum circuit prepared?

I have a quantum circuit of 40 qubits with mutliple gate operations being applied to many of the qubits. Currently I am using qasm simulator which for shots=1 took 10 hour of time. Is there any other ...
Binshumesh sachan's user avatar
7 votes
2 answers
327 views

Cascade/Feedforward quantum circuits

I would like to know if it is possible implement the following situation in Qiskit (either using the simulators or real quantum computers). Consider this illustrative toy example: The arrows ...
fcrp's user avatar
  • 156
7 votes
3 answers
1k views

Why is the order reversed on measurement?

Why is the order reversed on measurement? ...
Yushan Lu's user avatar
7 votes
1 answer
264 views

Status of software packages for quantum compiling

By "quantum compiling", what I mean is classical algorithms to solve the following problem: given a $SU(D)$ matrix $U$ (the goal) and a set of $SU(D)$ unitary matrices $V_1 \cdots V_N$ (the gates), ...
Scott Lawrence's user avatar
7 votes
1 answer
276 views

What are some current applications of Quantum Computing in drug discovery? Are there any test examples of this?

I am interested in applying the power of Quantum Computing to drug discovery. Although I realize that quantum computing is limited in regards to modeling drug-like compounds and their interactions ...
Rob James's user avatar
  • 355
7 votes
2 answers
1k views

How many ancilla qubits to use with Multiple-Control Toffoli (mct) gate in Qiskit?

The Multiple-Control Toffoli (mct) gate takes as input: 1. a register containing the control qubits, 2. the target qubits and 3. a register containing ancilla qubits. I don't know how many ...
Sorin Bolos's user avatar
7 votes
1 answer
545 views

Why am I able to simulate such high qubit numbers on my laptop?

Recently I've been working on a VQE-related project, for which I'm using Qiskit's TwoLocal variational form (qiskit version 0.34.2). I noticed that I was able to simulate this circuit up to ...
Matthias's user avatar
  • 173
7 votes
1 answer
3k views

How to calculate the fidelity of a certain gate of a IBMQ device in Qiskit using randomized benchmarking/tomography?

For example, I want to calculate the fidelity of a 1-qubit and 2-qubit gates (similar to the result shown in figure 2 in this paper). Is there any way to do that in Qiskit? I've gone through the ...
Trong Duong's user avatar
7 votes
1 answer
815 views

Quantum algorithm for linear system of equations (HHL) - Final Step: How can I find my vector of solution $|x\rangle$?

I'm working on solving a linear system with the quantum algorithm HHL. I don't understand how I can recover my vector $|x\rangle$ of real solution of the system starting from the states measured with ...
Nicolò Cangini's user avatar
7 votes
1 answer
165 views

Why does job.running in QISKit output False, even if the job is still running?

I submitted a job in the 0.5.0 version of QISKit using job = execute(qc, 'ibmqx5', shots=shots) This just submits the job, and does not wait for a result. I ...
James Wootton's user avatar
7 votes
2 answers
3k views

Get state vector of a single qubit in a circuit in Qiskit

I have two quantum circuits, and I would like to compare state vector of the first qubit and check if equals, what is the best way to do that in qiskit ? Let's say I have : ...
user12910's user avatar
  • 451
7 votes
1 answer
497 views

One-qubit gate results in QISKit

I found it odd that the result of the action of identity gate (namely a $2\times2$ identity matrix) on a pure state $|0\rangle$ (namely the vector corresponding to the $2\times1$ matrix $\begin{...
Mathist's user avatar
  • 495
7 votes
1 answer
859 views

How can I run a VQE on one of IBMQ's Quantum Computers

I have implemented a VQE based on Qiskit's VQE function and want to run that on an actual quantum computer. My understanding was, that an IBMQ backend can be passed into the function as a Quantum ...
Tom's user avatar
  • 71
7 votes
0 answers
202 views

Run VQE for parametrized quantum circuit with ancilla qubits

Let's say we have the following circuit (picture and code shown below), and now the $q_0$ is an ancilla qubit. If the system of interest has only two qubits, Is there a way to use only $q_{1,2}$ as my ...
fagd's user avatar
  • 975
6 votes
3 answers
8k views

How can I obtain transformation matrix of a quantum circuit in the Qiskit?

I need to draw a quantum circuit in Clifford+T library and obtain automatically its transformation matrix. Is there any feature on Qiskit in this case?
Moein sarvaghad's user avatar
6 votes
3 answers
1k views

XOR gate for n control qubits in qiskit

I am currently creating a blackbox for a grover search algorithm to solve the graph colouring problem with qiskit. One of my search criteria is that one node can only have one color. Therefore, with ...
sererant's user avatar
6 votes
3 answers
1k views

Is the SWAP gate a Clifford Gate? How would I express it using the Clifford Gate generators?

By my calculations, it looks like the SWAP gate is a Clifford Gate. See the following table: I follow the same method as in this paper for showing a gate is a Clifford Gate. I got the above table by ...
Quantum Guy 123's user avatar
6 votes
5 answers
1k views

How do I get the Unitary matrix of a circuit without using the 'unitary_simulator'?

I am using jupyter notebook and qiskit. I have a simple quantum circuit and I want to know how to get the unitary matrix of the circuit without using 'get_unitary' from the Aer unitary_simulator. i.e.:...
Jared's user avatar
  • 75
6 votes
1 answer
2k views

What does the error rate on the IBMQ website mean?

How is the error rate pointed by the arrow defined? How did you get it? thanks!
wei zi's user avatar
  • 325
6 votes
3 answers
2k views

What is the location of the Qiskit config file?

I'm trying to follow the instructions here https://qiskit.org/documentation/getting_started.html. It says The default backend for qiskit.visualization.circuit_drawer() or QuantumCircuit.draw() is ...
user1936752's user avatar
  • 3,075
6 votes
4 answers
487 views

Where I can read about protein folding on quantum computers with simple examples?

Where I can read about protein folding on quantum computer (Qiskit will be ideal variant) with simple examples? Thanks
mitrik_bnr's user avatar
6 votes
4 answers
528 views

Software tools to train quantum circuits with parameters

I want to play with the following problem. Given a unitary $U$ with parameters $\theta$ I want to optimize these parameters to make $U$ match some target unitary $V$, i.e. to find $\operatorname{...
Nikita Nemkov's user avatar
6 votes
2 answers
438 views

How to implement the CCH gate in quantum computers available in clouds?

How to implement CCH gate in quantum computers available in clouds? If there is not any gate directly available for it, what are the possible ways to represent CCH?
Ankit Raj's user avatar
6 votes
2 answers
1k views

How to prepare a specific initial state of three qubits?

I would like to prepare the following initial state for variational quantum algorithms: $$ \sin\theta_1 \sin\theta_2 \sin\theta_3 |000\rangle + \sin\theta_1 \sin\theta_2 \cos\theta_3 |001\rangle + \...
Ashy's user avatar
  • 375
6 votes
2 answers
885 views

How to draw Qiskit's HHL algorithm as a circuit?

Qiskit Aqua has a module that implements the HHL algorithm: https://qiskit.org/documentation/stable/0.32/stubs/qiskit.aqua.algorithms.HHL.html How does one draw the implemented circuit? *** EDIT *** I'...
user727041's user avatar
6 votes
1 answer
327 views

T-depth in Qiskit

How to find T-depth in Qiskit? Is there any inbuilt function or some method to find T-depth? I know that the .depth() function exists which returns circuit depth (i....
Gopal Dahale's user avatar
6 votes
2 answers
345 views

Is there a way to use titles on circuit drawing?

As you may know, one can use barriers in Qiskit to seperate gates on a circuit in a proper way. So, I was wondering is there a way to give a title to these "sections" seperated by barriers? ...
Saba's user avatar
  • 63
6 votes
2 answers
2k views

Preparing Bell state $(1/\sqrt{2}) (|01\rangle + |10\rangle)$ in Qiskit

I'm working through the Qiskit textbook right now, and wanted to complete part 1 of exercise 3.4, which asks me to use qiskit to produce the Bell state: $$\frac{|01\rangle + |10\rangle}{\sqrt{2}}$$ ...
aikky's user avatar
  • 169
6 votes
2 answers
5k views

Unable to use qiskit_textbook module

When I tried to use the Qiskit textbook module, it threw the following error: Command was: ...
sai bharath's user avatar
6 votes
1 answer
5k views

How to make circuit for n-control Z gate( i.e $C^3Z$ )?

I am trying to make circuit for $C^3Z$ gate I have seen a circuit for $C^2Z$ or $CCZ$ gate made by using $CCX$ gate so is there any way to make circuit for $C^3Z$ in this similar manner( i.e by using $...
zircon's user avatar
  • 439
6 votes
1 answer
756 views

Does Grover's algorithm always give the correct answer with 100% certainty for two-qubit states?

In the Qiskit tutorial on Grover's algorithm it is stated that with a 2 qubit algorithm the chance of measuring the "right" state is already 100%. But I thought that the algorithm would ...
eli44's user avatar
  • 165
6 votes
1 answer
444 views

Does the circuit with qubit-wise CZ gates compute the inner product of two states? If not, is there another circuit that does?

I've been searching for a quantum algorithm to compute the the inner product between two $n$-qubit quantum states, namely $\langle\phi|\psi\rangle$, which is in general a complex number. One can get $|...
cwhsing's user avatar
  • 63
6 votes
2 answers
724 views

How can I find a Clifford+T approximation of an arbitrary one qubit gate in Qiskit?

I know the Solovay-Kitaev algorithm can achieve this. Is there an implementation of this or any other algorithm for the same task in Qiskit? Or perhaps some other library that interfaces well with ...
shashvat's user avatar
  • 807
6 votes
1 answer
4k views

How to add several parameters in qiskit circuit?

I want to construct an ansatz circuit in Qiskit, so I need some parameters to act on the gates (e.g. RX(a), RY(b)). In the Qiskit tutorials I find a way to implement a parameter: ...
wu Peter's user avatar
6 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
  • 858
6 votes
1 answer
565 views

How to parallelly run a quantum circuit on IBMQ?

I am trying to implement the following circuit and my code is The above circuit has size 5 and depth 3. My question is, how can I run the circuit parallelly. I mean, the gate ...
wei zi's user avatar
  • 325
6 votes
1 answer
2k views

How would one implement a quantum equivalent of a while loop in IBM QISkit?

I'm writing a simple multiplication algorithm that uses the Quantum Fourier Transform to repetitively add a number (the multiplicand) to itself and decrements another number (the multiplier). The ...
Sashwat Anagolum's user avatar
6 votes
1 answer
876 views

Implement the classical shadow coding error?

I'm trying to reproduce the basic method of classical shadow, which is based on the tutorial of pennylane. However, I've met some realization problems here when I finish reading the tutorial of ...
narip's user avatar
  • 2,999

1
2
3 4 5
49