Questions tagged [qiskit]

Qiskit is an open source SDK for working with quantum computers at the level of pulses, circuits and application modules. If appropriate, also use the [programming] tag. Please include the version of Qiskit you use when using this tag.

Filter by
Sorted by
Tagged with
3 votes
2 answers
895 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) ...
Nillmer's user avatar
  • 695
2 votes
1 answer
1k 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, ...
tigerjack's user avatar
  • 478
3 votes
1 answer
912 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 ...
tigerjack's user avatar
  • 478
3 votes
1 answer
475 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/.
Mingyu's user avatar
  • 31
3 votes
2 answers
381 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 ...
MeetR's user avatar
  • 185
9 votes
2 answers
801 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 ...
Mathist's user avatar
  • 495
1 vote
2 answers
208 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}{...
Aman's user avatar
  • 483
3 votes
3 answers
593 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 ...
Akshay Ajagekar's user avatar
2 votes
0 answers
526 views

Qiskit SDK problem [closed]

So I am getting this error when I fire the command on Ipython or Jupyter Notebook ...
BayMax's user avatar
  • 109
3 votes
0 answers
613 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 ...
Bruno Rijsman's user avatar
5 votes
1 answer
402 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 ...
Aman's user avatar
  • 483
3 votes
1 answer
214 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 ...
Sashwat Anagolum's user avatar
3 votes
3 answers
239 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' ...
Gene Naden's user avatar
6 votes
1 answer
2k 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 ...
Sashwat Anagolum's user avatar
5 votes
2 answers
2k 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 ...
Daniel Vainshtein's user avatar
4 votes
1 answer
233 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 ...
Daniel Vainshtein's user avatar
4 votes
1 answer
1k 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?
user avatar
8 votes
2 answers
658 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 ...
Jake Xuereb's user avatar
4 votes
3 answers
2k views

Comparing run times on IBM Quantum Experience

I have run this program - ...
Trevor Oakley's user avatar
9 votes
3 answers
737 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 ...
CodeSandwich's user avatar
7 votes
1 answer
1k 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.
Theodore Lewitt's user avatar
5 votes
1 answer
329 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, ...
DrHamed's user avatar
  • 181
7 votes
1 answer
608 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 ...
Sanchayan Dutta's user avatar
5 votes
1 answer
494 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 ...
Bick's user avatar
  • 842
8 votes
2 answers
2k 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 ...
Sanchayan Dutta's user avatar
5 votes
2 answers
504 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, ...
Dr.PB's user avatar
  • 183
9 votes
1 answer
3k 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$$
Debarghya Kundu's user avatar
8 votes
2 answers
463 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 ...
John Lancaster's user avatar
7 votes
1 answer
470 views

One-qubit gate 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{...
Mathist's user avatar
  • 495
9 votes
2 answers
2k 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, ...
Sanchayan Dutta's user avatar
8 votes
2 answers
888 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$ $...
brzepkowski's user avatar
  • 1,019
11 votes
2 answers
3k 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 ...
asdf's user avatar
  • 493
8 votes
1 answer
2k 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 ...
user2519's user avatar
28 votes
4 answers
10k 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?
Ali Javadi's user avatar
  • 1,612
8 votes
1 answer
1k views

How to delete pending jobs on IBM Quantum Computer to retrieve units?

I am trying to run some code using qiskit, but I get the error message, that I have run out of necessary Experiment Units. I ...
brzepkowski's user avatar
  • 1,019
5 votes
1 answer
1k 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?
James Wootton's user avatar
7 votes
1 answer
151 views

Why does job.running in QISKit output False, even if the job is still running?

I submitted a job in the 0.5.0 version of QISKit using job = execute(qc, 'ibmqx5', shots=shots) This just submits the job, and does not wait for a result. I ...
James Wootton's user avatar
8 votes
1 answer
8k 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 ...
Alexander Pozdneev's user avatar
8 votes
2 answers
809 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): ...
kenorb's user avatar
  • 652

1
36 37 38 39
40