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.

4
votes
1answer
49 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
41 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 ...
2
votes
1answer
42 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
51 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 ...
1
vote
1answer
37 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 ...
5
votes
3answers
179 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 ...
4
votes
1answer
109 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
89 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$$ ...
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: ...
8
votes
2answers
229 views

Qubits specification on IBMQ devices

As it is shown here, CNOT gates between different qubits have different error rates. I have the following questions: 1) While defining a circuit on QISkit, does ...
1
vote
1answer
54 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
92 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
0answers
194 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, ...
6
votes
1answer
271 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 ...
4
votes
1answer
103 views

How to deal with -LookupError: backend “ibmqx4” is not found?

I am using Jupyter notebook to write and running my qiskit codes (python 3.6) and every time I encounter the message: LookupError: backend "ibmqx4" is not found, right now the ibmqx4 computer is not ...
4
votes
1answer
225 views

How to install qiskit in spyder editor?

I am working in Anaconda using spyder editor. Can anyone tell me how to install qiskit in spyder?
3
votes
1answer
97 views

How can I get the qiskit module

I have successfully installed qiskit. However, when I try to run a simulation I get the error "No module named 'qiskit' ...
3
votes
2answers
411 views
5
votes
1answer
133 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.
4
votes
1answer
193 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 ...
9
votes
2answers
212 views

Composing multiple quantum circuits in single quantum program in QISKit

I was wondering if there is a way to compose a program with multiple quantum circuits without having the register reinitialized at $0$ for each circuit. Specifically, I would like run a second ...
12
votes
2answers
2k views

How can I implement an n-bit Toffoli gate?

I want to create a Toffoli gate controlled by n qubits, and implement it in QISKit. Can this be done? If so, how?
8
votes
1answer
1k views

Visualization of Quantum Circuits when using IBM QISKit

I have followed the installation steps, regarding QISKit working environment. For circuit visualization, I've installed latex as in addition to poppler to convert from PDF to images. Afterwards, I ...
5
votes
1answer
445 views

Phase-Shift Gate in Qiskit

How to implement the phase shift gate in qiskit or ibmq? Phase Shift Gate : $$\begin{pmatrix}e^{ia} && 0 \\ 0 && e^{ia}\end{pmatrix} = e^{ia}I$$
4
votes
1answer
542 views

How to create an arbitrary state in QISKit for a local_qasm_simulator?

I would like to play with a quantum circuit local_qasm_simulator in QISKit, but I do not want to implement a separate quantum circuit that would prepare an initial ...
8
votes
2answers
344 views

There was an error in the circuit!. Error = 'QISkit Time Out'

I've got the following quantum code using QISKit (based on hello_quantum.py): ...
2
votes
2answers
134 views

How to run algorithms on IBMQ via Qiskit-Aqua?

I am trying to run an optimization problem on IBMQ. Running the same code on QASM simulator works fine. However, changing only the backend name to IBMQX takes long time. I am aware of the queues ...
2
votes
0answers
192 views

Qiskit Python program cannot connect to QE API

I am just getting started with Qiskit and IBM Quantum Experience, so please forgive my newby question. I have a IBM Quantum Experience account and I generated an API token. I used the generated ...
1
vote
2answers
117 views

How can the state $\lvert0\rangle+M^{-1/2}\sum_{j=1}^M\lvert j\rangle$ be generated?

I was wondering if anybody to help me to generate the following state. It would be preferable if you use only Hadamard, CNOT and T-gates, on $\lceil\log_2(M+1)\rceil$ qubits: $$|\psi\rangle = \frac{1}{...
2
votes
0answers
345 views

Qiskit SDK problem

So I am getting this error when I fire the command on Ipython or Jupyter Notebook ...
5
votes
4answers
265 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}{...
1
vote
1answer
74 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 ...
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
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: ...
2
votes
1answer
55 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
2answers
112 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
38 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 ...
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 ...
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
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
57 views

Consistent QISkit error: “All devices are currently unavailable”

I am attempting to run the following on a remote backend through QISkit: ...
5
votes
1answer
576 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?
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
101 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
50 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
396 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
135 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
135 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 ...