Questions tagged [qiskit]

Quantum Software Development Kit for writing quantum computing experiments, programs, and applications. If appropriate, also use the [programming] tag.

Filter by
Sorted by
Tagged with
1
vote
0answers
50 views

About a Qiskit Function

I want to understand this Qiskit function (a function for creating the gate CNX with Python): more specifically i don't understand what's the rotations (Y and Z) over the qubits for ? I added inline ...
3
votes
2answers
100 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. ...
0
votes
0answers
43 views

What is the need of Operator module from qiskit.aqua?

My question is two-fold: a) Why is it that Pauli takes two arguments (z,x). What is the role of x? In the max_cut module, z is initialized as an np array of size=no of nodes in graph with False dtype ...
1
vote
1answer
226 views

CRZ and CRY Gates

I am trying to understand the CRZ and CRY gates functions : what do they actually used for ? why we require a certain angle rotation around z or y Axis on a Qubit ? and what does it yield ? ...
3
votes
1answer
88 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 ...
1
vote
1answer
77 views

Qiskit Aqua cannot import 'QasmQobj'

I have an error when I use Quantum SVM kernel algorithm from Qiskit aqua. This is my code section with imports: ...
3
votes
0answers
195 views

Measuring Coherence Length for T1 and T2 values with IBMQ Experience

So I'm currently working on a little program to measure how long the coherence time of a qubit is. Basically the idea is to initialise a qubit with a X or H gate then stick in a varying amount of ...
2
votes
1answer
246 views

What does a quantum circuit look like after qiskit.compile() has been applied?

IBM-Q states that the real devices available for public use have a set of "basis" gates consisting of u1,u2,u3 and CNOT. However in Qiskit the circuit can be built with many gates which are not ...
1
vote
1answer
86 views

How can I build a controlled gate for this matrix in qiskit?

How can I build a controlled version of the below matrix in qiskit?$$ \begin{pmatrix} e^{i\theta} & 0\\ 0 & e^{i\theta} \end{pmatrix} = e^{i\theta}I $$
2
votes
1answer
123 views

Using Quantum Fourier Transform in adding two 2-bit numbers

I am trying to use Qiskit to write a code that uses QFT to add 2 numbers. I am referring to this paper: https://iopscience.iop.org/article/10.1088/1742-6596/735/1/012083 I have a few questions: 1) Is ...
3
votes
1answer
87 views

How to do randomised benchmarking for non-Clifford gates on Qiskit?

For my summer research internship I'm looking to randomized benchmark (RB) non-Clifford gates for a single qubit. Since I found out that Qiskit ignis allows for the RB of Clifford gates, naturally I ...
-2
votes
1answer
214 views

What does it mean to get 403 error when running a code on Qiskit? [closed]

I have been using Qiskit over the last few weeks to run different programs. But right now, whenever I try to run any code, it gives me a 403 error stating that I am out of credits. I am creating a ...
3
votes
0answers
65 views

Bell State 11 not working for parity curve

I am currently writing a script to automate the creation of parity curves for a 2 qubit bell state and then calculate fidelity and proving entanglement from that (inspired by this paper). It was going ...
3
votes
1answer
196 views

Implementing a complex circuit for a Szegedy quantum walk in qiskit

Problem definition I'm implementing a quantum circuit in qiskit for a Szegedy quantum walk, (reference, Fig 21.). It uses two registers of dimension $N$ ($N=3$) each one. The challenges I'm facing ...
5
votes
1answer
361 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....
8
votes
2answers
279 views

How to program a controlled Hadamard-Hadamard gate?

I'm trying to program a controlled gate as the figure below in Qiskit. Should it be sufficient to separate and control individually the Hadamard gates?
4
votes
1answer
432 views

About the Qiskit draw function

Where does Qiskit put the rendered figure created by circuit.draw(output='mpl')?
3
votes
0answers
111 views

Measurement inconsistency in Qiskit

I am using Qiskit in an algorithm. In the end, I am measuring exactly a register of 4 qubits but the histograms show states with 5 qubits. This is the code I used: ...
3
votes
1answer
363 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. ...
4
votes
0answers
85 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 ...
3
votes
0answers
61 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 $\...
3
votes
1answer
211 views

How to implement the XY Heisenberg interaction using IBMQ and Qiskit?

A possible way to implement the 2 qubit Heisenberg XYZ model using a Quantum computer is to decompose the Hamiltonian as follows: $$H_{XYZ} = H_{XY} + H_{YZ} + H_{XZ}$$. In this case, these operators ...
6
votes
1answer
331 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 ...
6
votes
1answer
297 views

Defining qubit operator from scratch

I'm a beginner with Qiskit and the Python language at all. Here is my question: One of the VQE function arguments is qubit operator (qubitOp). I saw some examples ...
1
vote
0answers
527 views

How to run quantum SVM algorithm from Qiskit in real IBM Quantum Computer using IBMQ?

I'm trying to run QSVM algorithm in IBMQ experience, want to run in one of those real quantum computers. ...
2
votes
1answer
244 views

How to construct a CCY gate in Qiskit

How can one construct a CCY gate using gates which are native to Qiskit (CCX and single qubit gates). I was able to find the answer for CCZ gates, however guessing and testing until I can figure out ...
4
votes
3answers
807 views

How to quickly calculate the custom U3 gate parameters $\theta, \phi$ and $\lambda$ for any unitary?

In IBM Qiskit and Quantum Experience, the custom U3 gate is defined as $$ U(\theta, \phi, \lambda) = \begin{pmatrix} \cos\left(\frac{\theta}{2}\right) & -e^{...
5
votes
2answers
249 views

Transform matrix into a combination of simple quantum gates

I am trying to transform this matrix into a combination of quantum gates but I cannot find any such functionality on Qiskit or anywhere else. I have tried to use Quirk but I do not understand it. $$\...
2
votes
2answers
622 views

IBM QISKit: creating a variational algorithm from zero

I would like to implement a variational algorithm (similar to VQE but with another cost function, no expectation of a Hamiltonian involved) from zero. Is there any tutorial explaining how to implement ...
6
votes
1answer
216 views

How does measurement calibration work?

One of the possible ways to improve the results of an experiment on the IBM machine using the Qiskit language is to use the measurement calibration methods. This is the link to the documentation. I ...
1
vote
1answer
81 views

Order of controls and targets of cnx gates in Qiskit (Python)

In the following piece of code: cnx(qwc, q[0], q[1],q[2],q[3]) in what order control qubits and target qubit are? Which qubit is inverted for which values of ...
3
votes
1answer
138 views

How does the cnx gate work in Qiskit (Python)?

Could somebody explain the cnx operator, and how it operates on its qubit parameters to flip the target qubit in Qiskit (Python)?
1
vote
1answer
51 views

Default value for a state created by QuantumRegister

What's the default value for a state created by QuantumRegister(1,'name_of_the_register')? Is it a $|0\rangle$ or a $|1\rangle$?
2
votes
1answer
128 views

Grover's algorithm returns skewed probability distribution

I wrote an implementation of Grover's algorithm that looks like this: ...
4
votes
1answer
287 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....
5
votes
0answers
78 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 ...
1
vote
0answers
71 views

Exception encountered while running quantum-enhanced support vector machines

I am trying to run the code of the notebook example aqua/artificial_intelligence/qsvm_kernel_classification.ipynb. I save it in a python file and I have an exception at runtime the display of ...
1
vote
1answer
140 views

(name of gate) is not in the list of basis operations

I'm trying to define a custom gate for my computations. I decided to copy the structure in one of the files in qiskit.extensions.standard package. Here is the code ...
2
votes
1answer
208 views

Qiskit DAG circuit - print information about individual gate/node by number

I created a DAG circuit in Qiskit and don't really understand how to see which gate is which. I want to call a function like dag_circuit.gate_info(gate_number), ...
1
vote
1answer
97 views

Using latest (GitHub) version of Qiskit as Python library

I just started working in Qiskit and want to use some of the new functions available to Qiskit on Github. Unfortunately, I don't know how to implement the latest GitHub version into my Anaconda ...
2
votes
1answer
391 views

Import from qiskit-aqua error

I try to use Quantum SVM kernel algorithm: multiclass classifier extension. This is my code section with imports ...
3
votes
2answers
151 views

Problems with qiskit-terra: missing members of instance QuantumCircuit

I have installed a Python 3.7.2, download anaconda and visual studio code. Install Qiskit SDK 0.5.3. But when I launch my first test program from https://github.com/Qiskit/qiskit-terra I received a ...
12
votes
3answers
827 views

How is the Grover-Algorithm applied to a database?

Question I want to use the Grover-Algorithm to search an unsorted database for an element $x$. Now the question arises, how do I initialize index and value of the database with the qubits? Example ...
2
votes
1answer
63 views

Qiskit predecessor and successor map of DAG circuits

I am trying to figure out how to use the functions "_make_pred_succ_maps". Here is a description of the function from Github: ...
3
votes
2answers
140 views

Finding the second smallest number. Is it achievable in QC?

I have a set of numbers in a superposition state (example: 3,8,1,5) in a quantum register (of 3 qubits). So I try to find the $n^{\text{th}}$ smallest number (...
3
votes
0answers
62 views

What are reasonable noise/dephasing parameters for QuEST to emulate state-of-the-art quantum computers?

The QuEST code allows for simulation of quantum computers taking dephasing and depolarizing noise into account via one and two qubit dephasing and depolarization. What are realistic parameters for ...
5
votes
1answer
369 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 ...
3
votes
1answer
131 views

For CNOT gate with control qubit set to 1, the measured state of the second qubit unexpectedly depends on the measurement

I have the following circuit in qiskit. It is a simple CNOT operation with the control qubit set to 1, by running the control qubit through an X-gate. However, when I measure the 2nd qubit, I get the ...
2
votes
1answer
247 views

Building an N-qubit Controlled S Gate

I've been beating my head against this problem for three days now and I just can't seem to crack it. To construct an N-qubit controlled Unitary gate, I can do something like this (note I'm using ...
3
votes
1answer
78 views

“Wait” gate throws an error “NotImplementedError: ('No decomposition rules defined for ', 'wait')”

My Quantum circuit contains "Wait" Gate. When I try to execute it (qasm_simulator or unitary-simulator), it throws an error . ...