Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [qiskit]

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

2
votes
0answers
50 views

Grover's Algorithm returns skewed probability distribution

I wrote an implementation of Grover's algorithm that looks like this: ...
4
votes
1answer
65 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....
3
votes
0answers
42 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
45 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
56 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
43 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
40 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 ...
1
vote
1answer
58 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
97 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 ...
5
votes
3answers
184 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
38 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
115 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
39 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 ...
4
votes
1answer
116 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
71 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
62 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
61 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 . ...
1
vote
1answer
51 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: ...
1
vote
0answers
31 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 ...
3
votes
1answer
59 views

Consistent QISkit error: “All devices are currently unavailable”

I am attempting to run the following on a remote backend through QISkit: ...
3
votes
1answer
91 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$$ ...
1
vote
1answer
100 views

QISKit warrning on marshmallow

I have updated qiskit module but unfortunately, it doesn't work it says ...
4
votes
1answer
105 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 ...
3
votes
1answer
54 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, ...
2
votes
1answer
52 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 ...
4
votes
1answer
429 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 ...
4
votes
1answer
140 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 ...
3
votes
1answer
138 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 ...
3
votes
2answers
176 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: ...
8
votes
1answer
153 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. ...
2
votes
1answer
166 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-...
1
vote
1answer
61 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 ...
5
votes
1answer
129 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), ...
4
votes
1answer
86 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 ...
4
votes
1answer
102 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 ...
2
votes
1answer
76 views

Result of a job for a list of circuits on QISKit

Suppose Circuits= [circuit1, circuit2, ..., circuitn] is a list of defined circuits. Then, ...
2
votes
0answers
46 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 ...
1
vote
1answer
76 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 ...
3
votes
1answer
62 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 ...
1
vote
0answers
62 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: ...
3
votes
1answer
65 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 ...
1
vote
1answer
518 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 ...
1
vote
1answer
179 views

Module BasicAer not found

After installing qiskit-terra via git (pip install qiskit), all python programs involving the line ...
5
votes
4answers
279 views

How do I build a gate from a matrix on Qiskit?

I'm creating a gate for a project and need to test if it has the same results as the original circuit in a simulator, how do I build this gate on Qiskit? It's a 3 qubit gate, 8x8 matrix: $$ \frac{1}{...
2
votes
1answer
78 views

Print circuit compiled on hardware?

I would like to see the compiled circuit as executed on a hardware. Nominally, this sequence of commands should return the QASM circuit in the variable ran_qc, but ...
3
votes
2answers
166 views

How to fix? 'E1101:Instance of 'QuantumCircuit' has no 'h' member' and 'E1101:Instance of 'QuantumCircuit' has no 'cx' member'

I'm using this simple code to test my Qiskit and learn how to use it but it keeps giving this problems, how do I fix it (Using VS Code and Anaconda Python 3.7) ...
2
votes
1answer
141 views

qiskit - Is there any way to discard the results of a measurement?

I have a circuit composed by n qubits, plus a single one which is an ancilla. I'm making multiple measurements on the ancilla at different stages of the circuit, ...
2
votes
1answer
232 views

Is it possible to expand/merge different circuits?

Suppose I have created a circuit composed of some registers with the usual qc = QuantumCircuit(qr, cr) where qr and ...
3
votes
1answer
121 views

How to set up Qconfig.py and where is the file?

How to set up Qconfig.py and where is the file? I mean under which folder? Like /anaconda/lib/python3.6/site-packages/qiskit/.
3
votes
2answers
138 views

Implementing gate with two parameters using Qiskit in Python

I am trying to implement the HHL algorithm (for solving $Ax=b$). I am assuming $A$ to be unitary and Hermitian so that I can find the Hamiltonian simulation for it easily. For any $A$ to be Hermitian ...