Questions tagged [qiskit]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

Code keeps running job after job

I'm attempting to to run a electronic ground state energy calculator, when I send a job to the real quantum computer it will wait in the queue, run the job, give me a histogram (on the quantum-...
0
votes
0answers
17 views

I found an article based on multiplication of two numbers in quantum computing.How can I change the program in a format of array multiplication?

https://medium.com/@sashwat.anagolum/arithmetic-on-quantum-computers-multiplication-4482cdc2d83b https://github.com/SashwatAnagolum/DoNew/blob/master/multiplication/multiply.py This is the article and ...
0
votes
1answer
18 views

Error while trying to execute the Quantum Circuits in IBMQ

I have been trying to execute the quantum circuit in the backend of the IBM 16 qubit Melbourne machine. I end up getting ...
-1
votes
1answer
43 views
0
votes
1answer
35 views

How to calculate the exponential of all elements in an input array using qiskit?

How can I perform an operation similar to Numpy.exp() in qiskit?
1
vote
1answer
26 views

Simplifying Qiskit circuit with c_if()

I'm trying to simplify the inner for loop of this implementation of the Mosca-Ekert semi-classical variant of Shor's algorithm. The inner for loop should have only linear length, but this ...
4
votes
1answer
56 views

Qiskit: How can I modify Grover's algorithm to search for a state that doesn't belong to a basis set?

Let's say I need to find the state $111$ in a "database" that is not the computational basis for a 3-qubits system (because it doesn't contain all of the basis vectors or contains the same ...
0
votes
4answers
175 views

Import Qiskit fails [closed]

I have successfully installed the Qiskit in Anaconda by using pip install qiskit. But I can't import Qiskit and get the following error. ...
0
votes
2answers
38 views

What is the effect of the reset gate on the matrix form of a gate/circuit?

From what I understand, any circuit can be combined to make a gate, which has a square, unitary matrix form that acts on the $2^n$ row of the qubits state column vector. For example, the circuit ...
0
votes
0answers
42 views

Is there a way to entangle to a dirty qubit?

Let's say I do something to a qubit, and I want to entangle it to a 2nd one, like this: ...
1
vote
2answers
42 views

IBM Q - Individual Run Results

In Qiskit, is there a way to get the individual results from each shot on the IBM quantum device (instead of simply the summary statistics)? The result JSON file provides the count of all the 1024 ...
0
votes
0answers
34 views

HHL algorithm Qiskit version

...
0
votes
1answer
42 views

Parallel shots on Qiskit

I am running variational algorithms using QuasmSimulator, which means I am performing a classical optimization where the cost function is computed running a quantum circuit. Moreover, for the ...
0
votes
1answer
29 views

Produce a quantum state with its density matrix an identity matrix up to an constant

For a n-qubit quantum state $|\psi\rangle=\displaystyle\sum_{i=0}^{2^N-1}|i\rangle$, by definition it's density matrix is $|\psi\rangle\langle\psi|=\displaystyle\sum_{i,j=0}^{2^N-1}|j\rangle\langle i|$...
3
votes
1answer
87 views

Qiskit Inverse of a quantum fourier transformation

In the photo provided the Quantum Fourier Transform is depicted in Qiskit before the barrier. I don't understand the result of inverse. Conceptually, should the inverse of the QFT be the same ...
1
vote
1answer
28 views

How does Qiskit Aqua commutator work?

Commutation operation is essential in quantum mechanics, but when I was trying to use the commutator of IBM qiskit I find something confusing. Here comes the problematic code. ...
-2
votes
1answer
40 views

qiskit aer: Insufficient memory error [closed]

If the circuit has more than 28 qubits, how I can I use StatevectorSimulator?
0
votes
1answer
67 views

Quantum Phase estimation with $2\pi$ replaced with $2e$

The QPE on IBM platform finds the eigenvalue of a unitary operator, i.e $$U|\phi\rangle=e^{2\pi i\theta}|\phi\rangle$$ and uses the rotation operators as $$U(\theta)=\begin{bmatrix}0 & 1\\ 1 &...
1
vote
2answers
52 views

Qiskit programming: convert qubit to quantum register

When simulating quantum circuits in Qiskit, sometimes you need to build your own operation. And when you are doing so you would like to save the computational cost, but the QuantumCircuit object takes ...
1
vote
2answers
57 views

Usage of Tensorflow/Keras to train Qiskit circuits

In order to explore whether it is possible to train a Qiskit Quantum circuit with tensorflow I built a small toy model. The purpose of this toy model is to find via tensorflow the correct angle to get ...
0
votes
1answer
31 views

Qiskit HHL algorithm BrokenProcessPool error

I try to run HHL algorithm on qasm_simulator. I took the example from here. I try to solve 8x8 random matrix and adjust some parameters in create_eigs. ...
3
votes
1answer
28 views

Is it possible to plot the average counts from two jobs with multiple circuits on a single histogram in Qiskit?

I have the results of 2 separate jobs that contain a set of 75 circuits each. I am trying to compare these jobs by plotting the average counts from all the circuits in job 1 vs the average counts from ...
0
votes
1answer
33 views

How can I view a quantum circuit execution?

Qiskit-Shots-Animator animates microwave-pulse shots in a quantum circuit execution as microwave flashes either on a gate map, or x-ray photo of the quantum computer chip. Microwave measurement pulses ...
1
vote
1answer
26 views

How to change the names of the registers displayed with circuit_drawer (output='mpl')

I am trying to change the appearance of the circuit_drawer in output='mpl' mode. The registers of the Quantum Circuit are named like ($q0_0$, $q0_1$, $q1_0$, $q2_0$, $q2_1$,..) but I'd like to name ...
2
votes
1answer
41 views

TypeError: 'NumPyMinimumEigensolver' object is not subscriptable

I'm trying to implement the same Jupyter notebook Jin-Sung Kim gave in his YouTube video The Variational Quantum Eigensolver — Programming on Quantum Computers — Coding with Qiskit S2E4; however, I'm ...
2
votes
1answer
53 views

Why and how is quantum noise predictable?

I have been learning about quantum error correction using the zero-noise extrapolation method from this paper and have been pleased with the results. This method takes advantage of the fact that the ...
1
vote
0answers
51 views

HHL example solution on Qiskit

In the example on the Qiskit page (https://qiskit.org/textbook/ch-applications/hhl_tutorial.html#A.-Some-mathematical-background) section 3 for the HHL algorithm the author is trying to solve the ...
0
votes
1answer
35 views

Qiskit get qubits from statevector

How do I get the amplitude of each qubit, like plot_bloch_multivector(), but not output the tensor product of all qubits. In this case I need output ...
1
vote
1answer
44 views

ImportError when setting up PySCF driver

I have a problem when attempting to set up a PySCF driver for a hydrogen molecule from the QISKIT Chemistry tutorial: https://qiskit.org/documentation/tutorials/chemistry/01_electronic_structure.html. ...
3
votes
2answers
93 views

Traveling salesman problem in Qiskit: cannot find a solution on simulator

I am trying to solve Traveling Salesman Problem (TSP) in Qiskit based on Qiskit Tutorial. I used TSP for four cities described by this distance matrix: $$ D = \begin{pmatrix} 0 & 207 & 92 &...
-1
votes
1answer
34 views

qiskit:how can i get negative sign in encoding process simulation of error correction code

I want to make sure my code word has a minus sign or not, but when I use the get_count() function from Qiskit, I only can get back the sequence consisting of $0's$ ...
2
votes
1answer
49 views

Applying conditional X-gate in Qiskit

I have problem with implementation of the circuit below. How can I write down the conditional X-gate in the following circuit?
2
votes
1answer
90 views

Toffoli circuit explanation [closed]

Can anyone explain me the behaviour of these two circuits? They contain Hadmard and rotation gates before the Toffoli gate. Results of simulation:
0
votes
1answer
37 views

What is the proper way of doing Pauli arithmetic in Qiskit?

To my understanding, the WeightedPauliOperator class in discontinued, and should no longer be used when dealing with Pauli operators. So how should I perform ...
2
votes
1answer
29 views

A problem with IBM Q, NameError: name 'iBMQ' is not defined

I 'm trying to reproduce the code given in the Qiskit summer school here. The code is: ...
3
votes
1answer
81 views

Confused about the application of Hadamard gate to uncorrelated qubits [duplicate]

Why does applying the following circuit on a $00$ state produce $|0\rangle \otimes |+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |01\rangle)$. Shouldn't it produce $ |+\rangle \otimes |0\rangle = \...
1
vote
1answer
46 views

How to increase matrix size and getting high fidelity for HHL algorithm in Qiskit?

I have followed an example that Qiskit provides here. I tried to increase the matrix size to 16x16 and change num_ancillae and ...
4
votes
2answers
445 views

What's meant by the depth of a quantum circuit?

I'm using Qiskit to create quantum circuits wherein I've this attribute called depth. The documentation states it is the length of the critical path here. What does ...
0
votes
1answer
30 views

Unknown error code [5204] when running job on IBM's qasm_simulator

I am submitting a job to ibmq_qasm_simulator and after the validation I repeatedly get the error "Error running job on a simulator. [5204]" The site with error descriptions https://quantum-...
2
votes
1answer
43 views

Qiskit “statevector_gpu” method not available

I am trying to use the statevector_gpu simulation method in Qiskit Aer (see this page). I installed qiskit-aer-gpu according to ...
1
vote
2answers
97 views

How to repeat circuit efficiently and reliably in IBM Qiskit?

I'm having a problem in IBM Qiskit with my qubit identities switching places during transpilation. I've been told by developers on the Qiskit slack server that there's currently no built-in way to fix ...
2
votes
2answers
66 views

How to intentionally add noise to a Qiskit circuit?

I am attempting to intentionally add noise to my qiskit circuit by applying n-pairs of CNOT gates. The effect of this should be to yield the same result of my baseline (no pairs of CNOT gates applied) ...
1
vote
1answer
36 views

How can I obtain a unitary matrix of quantum circuit with angles as parametric?

I need to draw a quantum circuit in Clifford+T library and obtain automatically its transformation matrix. (I received a response to this part of my question before in the link: How can I obtain ...
4
votes
0answers
36 views

Can I partially collapse the wavefunction in Qiskit?

I'm trying to do something similar to this question, where I want to partially measure the system before getting the output. In particular, say I have 4 qubits. I want to measure two of them, and then ...
2
votes
2answers
97 views

Creating a custom gate (given by a matrix) more efficiently

I have the following gate (as represented by its matrix) on $4$ qubits which I hope to use in an error-detection code $$M=\left( \begin{array}{cccccccccccccccc} 1 & 0 & 0 & 0 & 0 &...
0
votes
2answers
34 views

Cannot get the counts of a job in Qiskit with the usual command

When I use job.result().get_counts I am getting this result: ...
2
votes
2answers
51 views

How to verify teleportation was successful in this circuit?

In this circuit (link), q0 is Alice's qubit and q1, q2 are entangled qubits given to Alice ...
1
vote
1answer
30 views

Composing teleportation circuit in Qiskit Circuit Composer

I'm trying to create the teleportation circuit in IBM Qiskit Circuit Composer. ...
2
votes
1answer
57 views

Which method of executing a multi-control gate is more efficient?

I am interested in executing multi-control gates and I have found two methods to do so as explained below. The first is taken from Nielsen and Chuang (2010) from their Figure 4.10. This method ...
1
vote
1answer
46 views

Partial Measurement of Quantum Circuit in Qiskit

I want to do partial measurement of quantum circuit containing two qubits in entangled state. I want to first measure one qubit and record the result. Thereafter, record the measurement of second ...

1
2 3 4 5
14