# Questions tagged [qiskit]

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

891 questions
Filter by
Sorted by
Tagged with
3answers
3k views

2answers
1k 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 ...
1answer
377 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 ...
1answer
128 views

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

In the following piece of code: cnx(qwc, q, q,q,q) in what order control qubits and target qubit are? Which qubit is inverted for which values of ...
1answer
219 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)?
1answer
59 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$?
1answer
162 views

### Grover's algorithm returns skewed probability distribution

I wrote an implementation of Grover's algorithm that looks like this: ...
1answer
453 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....
1answer
120 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 ...
0answers
91 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 ...
1answer
203 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 ...
1answer
285 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), ...
1answer
113 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 ...
1answer
715 views

### Import from qiskit-aqua error

I try to use Quantum SVM kernel algorithm: multiclass classifier extension. This is my code section with imports ...
2answers
247 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 ...
3answers
1k 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 ...
1answer
83 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: ...
2answers
192 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 (...
0answers
86 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 ...
1answer
496 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 ...
1answer
186 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 ...
1answer
483 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 ...
1answer
117 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 . ...
2answers
1k views

### Cannot load account with Qiskit

I just got started with Qiskit. When I tried to save my account with the API token from IBMQ website, I got the error: ...
0answers
90 views

### Qiskit gates in LaTeX representation: notation meaning [duplicate]

I started working in Qiskit, and here is an example of how gates of a circuit are represented graphically in LaTeX format: Obviously, $R_y(\theta)$, is a y rotation by a certain angle. But all the ...
1answer
239 views

### Consistent QISkit error: “All devices are currently unavailable”

I am attempting to run the following on a remote backend through QISkit: ...
1answer
264 views

### Is it possible to create a superposition in IBMQ QISkit which has probability amplitudes $|a|\neq |b|$?

For example, we can create a single qubit state with a polar angle of $\pi/2$ with the Hadamard gate. But, can we create a state such as this, $$\Psi = \cos(\pi/8)|0\rangle + \sin(\pi/8)|1\rangle$$ ...
1answer
201 views

### QISKit warrning on marshmallow

I have updated qiskit module but unfortunately, it doesn't work it says ...
1answer
767 views

### Qiskit - How do we measure the same single qubit system multiple times while also getting the counts/results after each measurement?

I am able to apply multiple measurements (2) to the same qubit system. However, I would like to get the counts right after each measurement is executed. I realize that the counts should be the same ...
1answer
353 views

### LaTeX error when drawing circuits with Qiskit

I am currently running the following document from this Qiskit documentation. This notebook is running in Jupyter, and I started Jupyter from the Mac terminal within a Conda environment. Normally, ...
1answer
460 views

### Qiskit: 'per shot' result

Is there a way to access the results of measurements 'per shot' performed on a backend such as one of the real IBM machines? I know it can generate a histogram from the cumulative data, but I was ...
1answer
2k views

### ImportError: cannot import name 'QuantumProgram' from 'qiskit'

I get below error when I run a code on spyder environment: File C:/MYPYTHON Programs/My Quantum Programs/Shor algo.py, line 4, in from ...
1answer
647 views

### Deprecation warnings in Qiskit (circuit drawing)

I am just starting to get around Qiskit, I'm going at baby steps, so I tried to run the code below and I noticed three things: I tried using ...
1answer
1k 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 ...
2answers
461 views

### Why won't Qiskit ccx gate accept registers?

In Qiskit, they have the concept of a Toffoli gate (ccx). However, the following code throws an error: ...
1answer
390 views

### Submitting jobs to IBM devices without Python

Qiskit can be used to submit jobs to IBM devices using Python (or Swift and JavaScript). But what if I want to use a different language? For example, suppose I have a specific circuit I want to run. ...
1answer
1k views

### Plotting data in QISKit using plot_histogram

I'm trying to plot a set of data using plot_histogram, but the rendered image looks like this (the larger values are outside the image): How can I set the y-...
1answer
115 views

### TypeError: unorderable types: QuantumRegister() >= int()

I've been using qiskit for about a year now, and as of late, I've had issues finding an available backend to run my circuit on. Looking into the matter, I reinstalled qiskit to find that most ...
1answer
209 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), ...
1answer
1k views

### Can I remove gates from a QuantumCircuit?

Suppose I want to implement run several circuits one after another, but they are constructed in a similar fashion. I could reinstantiate a QuantumCircuit for each ...
1answer
529 views

### How can noise on a device be simulated using measured noise parameters?

The real devices used as backends for Qiskit have calibration data that quantifies errors ($T_1$ and $T_2$, gate fidelities, etc). This can be accessed by, for example ...
2answers
655 views

### Result of a job for a list of circuits on QISKit

Suppose Circuits= [circuit1, circuit2, ..., circuitn] is a list of defined circuits. Then, ...
1answer
270 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 ...
1answer
232 views

### Entanglement in VQE ansatz in Qiskit

The Qiskit documentation on VQE describes two of the ansatz as "rotations with entanglements". The rotation gates are more or less clear, but the documentation doesn't mention what gate is used for ...
1answer
262 views

### Programming quantum half adder

While computing the carry bit [C=0 XOR (AB)] I am unable to compute that AB in Qiskit. I don't whether Toffoli gate is available in Qiskit. So does anyone know how to perform AB, which is basically ...
1answer
185 views

### Qiskit - Authorization Required error

When I use Qiskit to do quantum computing, I suffer from a big problem. When running the code,it turns out to be: ...
1answer
319 views

### Qiskit - expand and/or merge registers

Suppose one of my functions create some ancillary qubits and reset them. Then, another function wants to create a larger number of ancillary qubits. So, I'd like to reuse the first set of qubits and ...
1answer
3k views

### ModuleNotFoundError: No module named qiskit.providers

The following message I got by running the qft.py code Traceback (most recent call last): File "qft.py", line 18, in ...
1answer
550 views

### Module BasicAer not found

After installing qiskit-terra via git (pip install qiskit), all python programs involving the line ...