Stack Exchange Network

Stack Exchange network consists of 174 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.

3
votes
2answers
97 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: ...
7
votes
1answer
83 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
36 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
34 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
109 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), ...
3
votes
1answer
56 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
30 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
31 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
29 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
33 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
34 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
41 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
48 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
50 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
53 views

Module BasicAer not found

After installing qiskit-terra via git (pip install qiskit), all python programs involving the line ...
4
votes
4answers
119 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}{...
3
votes
1answer
76 views

Why can't you run a teleportation circuit on an IBM Q device?

I'm studying teleportation circuits with this tutorial and just out of curiosity, why can't a teleportation circuit be run on an IBM Q device?
2
votes
1answer
50 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
78 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
63 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
211 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
48 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
80 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 ...
7
votes
1answer
110 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
2answers
93 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
2answers
77 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
183 views

Qiskit SDK problem

So I am getting this error when I fire the command on Ipython or Jupyter Notebook ...
2
votes
0answers
83 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 ...
5
votes
1answer
90 views

Entanglement state preparation by using amplitude values

I have an algorithm that uses QRAM, after accessing the given QRAM that store M d-dimensional classical vectors, the state of the index register and the data register become entangled. But for now I ...
3
votes
1answer
67 views

How can I resolve the error QISkit Error: The same provider has already been registered!

I am writing a small algorithm to multiply two numbers using IBM's QISkit. The code is below: times_shell.py ...
3
votes
1answer
59 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' ...
6
votes
1answer
174 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
2answers
129 views

How to create a condition on only one classical bit when we have a total of 2 classic bits in the system

I am trying to make a quantum circuit with one qubit and 2 classical bits for each measurment in the system below: I want to make condition on the first bit: if the first collapse to zero so x ...
3
votes
1answer
81 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 ...
3
votes
1answer
82 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?
6
votes
2answers
169 views

Why do we need a Classical Register for carrying out Quantum Computations?

I've just started to mess about with QISKit on Python and one thing is confusing me a fair bit. Given that we are building Quantum Circuits what is the need for a classical register ? Is it because ...
3
votes
2answers
252 views

Comparing run times on IBM Quantum Experience

I have run this program - ...
9
votes
3answers
202 views

Does conditional gate collapse controller's superposition?

I've created a simple circuit in Q-Kit to understand conditional gates and outputted states on each step: In the beginning there is clear 00 state, which is the input The first qubit is passed ...
5
votes
1answer
105 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
0answers
151 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
139 views

SWAP gate(s) in the $R(\lambda^{-1})$ step of the HHL circuit for $4\times 4$ systems

Context: On the 5th page of the paper Quantum circuit design for solving linear systems of equations (Cao et al, 2012) there's this circuit: Schematic: A brief schematic of what's actually ...
4
votes
1answer
115 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 ...
5
votes
1answer
175 views

What are theta, phi and lambda in cu1(theta, ctl, tgt) and cu3(theta, phi, lam, ctl, tgt)? What are the rotation matrices being used?

I was reading the documentation for qiskit.QuantumCircuit and came across the functions cu1(theta, ctl, tgt) and ...
5
votes
3answers
151 views

Checking value of variable using quantum approach

A beginner question after watching few videos. Say, var=a; var can be either of two values, ...
5
votes
1answer
318 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$$
6
votes
2answers
96 views

Construct Controlled-$G^{\dagger}$ from known Controlled-$G$

Let there be a known a scheme (quantum circuit) of Controlled-G, where unitary gate G has G$^†$ such that G≠G$^†$ and GG$^†$=I (for example S and S$^†$, T and T$^†$, V and V$^†$, but not Pauli and H ...
7
votes
1answer
152 views

One-qubit gates 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{...
6
votes
2answers
296 views

Quantum algorithm for linear systems of equations (HHL09): Step 2 - Preparation of the initial states $|\Psi_0\rangle$ and $|b\rangle$

This is a continuation of Quantum algorithm for linear systems of equations (HHL09): Step 2 - What is $|\Psi_0\rangle$? In the paper: Quantum algorithm for linear systems of equations (Harrow, ...
7
votes
1answer
233 views

Changing indices of qubits in QISKit

I was wondering if something like this is possible in QISKit: let's say we have two registers containing target and ancilla qubits: $a_0$ ------------------- $a_1$-------------------- $\vdots$ $...
8
votes
2answers
154 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 ...