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.

Filter by
Sorted by
Tagged with
2
votes
1answer
92 views

HHL - the result is correct for one matrix but wrong for another one

I tried to run HHL algorithm in new version of Qiskit (0.29). Firstly I tried to solve a diagonal system 4x4 with matrix [[1,0,0,0],[0,2,0,0],[0,0,3,0],[0,0,0,4]] ...
4
votes
2answers
156 views

Cannot get a provider from IBMQ

My code is: from qiskit import IBMQ IBMQ.load_account() provider = IBMQ.get_provider('ibm-q') qcomp = provider.get_backend('ibmq_16_melbourne') but ...
1
vote
1answer
56 views

Simulating OpenQASM 2.0 in Qiskit?

I'm just getting started with OpenQASM, but I'm feeling a bit confused. Is there a way to run the .qasm file I've written in Qiskit (i.e. in Python), or is OpenQasm ...
1
vote
0answers
72 views

Qiskit Portfolio Optimization

After running this code: I have an error: ...
3
votes
1answer
50 views

How can I prepare and measure spins in arbitrary directions in qiskit?

I'm just starting with Qiskit and I would like to reproduce basic results about spin measurements. For that I want to prepare multiple spins each in arbitrary directions and measure them in arbitrary ...
6
votes
0answers
60 views

AWS Braket Backend for Qiskit?

Is there a working AWS Braket backend provider for Qiskit 0.29 that can be used with the MinimumEigenOptimizer interface? The qiskit-aws-braket-provider package is unfortunately not working.
2
votes
1answer
213 views

Can Google Sycamore's benchmark for quantum supremacy be simulated on Qiskit?

In 2019, Google claimed that they have achieved quantum supremacy/advantage with their 53 qubit quantum processor Sycamore. The paper is here. But I have not even been able to find what their ...
0
votes
0answers
34 views
0
votes
1answer
40 views

unexpected effect of coherent unitary error in qiskit

I'm trying to simulate the effect of a coherent unitary Z rotation at an arbitrary angle of a single qubit on the fidelity of a quantum circuit. I am using the qiskit Aer noisy simulator. More ...
2
votes
1answer
110 views

Molecular orbitals in Qiskit

During the same minute as asking this question, I also asked this at Matter Modeling SE. In Qiskit, each qubit corrrespond to one spin orbital. For example, the $\text{N}_2$ molecule have 10 molecular ...
0
votes
1answer
37 views

Initialization time for StatevectorSimulator Qiskit

I have a question about initializing a quantum circuit to a custom state using Qiskit's StatevectorSimulator(). My naive understanding is that eventually, the ...
1
vote
1answer
105 views

Can someone explain using H and T gates repeatedly?

The Qiskit textbook says it is used because $R_x$, $R_y$, and $R_z$ are not accurate single qubit rotations. Can someone elaborate what the repeated $H$ and $T$ gates actually do? In what scenario ...
7
votes
0answers
67 views

Can boson sampling be simulated in Qiskit?

In December 2020, there was this claim of quantum advantage/supremacy by a team of USTC using Gaussian boson sampling. Here is the paper and here is an explanatory news article in Nature. To get an ...
2
votes
2answers
117 views

IBM Quantum: Are ibmq_5_yorktown and ibmqx2 different devices?

When I run provider.backends(), ibmqx2 is listed as an available backend, but is not listed on the IBMQ systems page. This file ...
0
votes
1answer
41 views

Open pulse, simple schedule meaning

I'm going through the tutorials qiskit and quantum lab 06_building_pulse_sched for qubit calibration. The first pulse is as in the image. There's a couple of things that I still don't understand in it....
4
votes
1answer
213 views

Do I need to use classical bits in measurement?

I wonder if I have to add classical bits while performing measurement for a single-qubit quantum circuit. The difference to initialize the circuit is ...
1
vote
1answer
50 views

Define customized excitation for the unitary coupled-cluster (UCC) algorithm in qiskit

I encountered the issue that when defining my customized excitation list in the UCC algorithm, there was only one parameter. How to fix this so that the algorithm assign one parameter for each ...
2
votes
1answer
59 views

Keep receiving Error - AttributeError: 'QuantumCircuit' object has no attribute 'save_statevector'

I am attempting to code a feed-forward simulation of a QECC in Qiskit. Qiskit (to my knowledge) does not directly support feed-forward simulation, so I attempted a work-around. I call the simulator ...
4
votes
3answers
174 views

Software tools to train quantum circuits with parameters

I want to play with the following problem. Given a unitary $U$ with parameters $\theta$ I want to optimize these parameters to make $U$ match some target unitary $V$, i.e. to find $\operatorname{...
1
vote
2answers
48 views

How to know positive or negative phrase from qshere diagram?

How to find out whether it is a positive or negative $\pi$ phrase between 00 and 11 from q-Sphere diagram?
2
votes
0answers
78 views

Applying projectors with mid-circuit measurements

I am trying to apply a non-unitary projector (see image) to my two-qubit quantum circuit using mid-circuit measurements. $$ \begin{pmatrix} 0 & 0 & 0 & 0 \ 0 & 1 & 0 & 0 \ 0 &...
2
votes
1answer
89 views

Measuring tensor products of Pauli operators

Is there a neat way to derive and efficiently implement a measurement circuit for tensor products of arbitrary Pauli operators like $XZZXZ$ in Qiskit ? I tried using the ...
3
votes
2answers
538 views

Is Qiskit more popular than cirq? Why?

It seems like most people are using Qiskit, what's the difference?
0
votes
1answer
35 views

Apply a custom gate to qubits in separate quantum registers

Let there be a custom gate (simply called gate that takes $N$ qubits as input. Also, let $A$ of those qubits be in first_register...
2
votes
1answer
67 views

From general Hamiltonian to Ising Hamiltonian

I would like to convert my qubit hamiltonian fom the HeH+ system that I have obtained using Qiskit to an Ising or QUBO model. I have seen multiples examples from QUBO to Qubit Hamiltonian but on the ...
2
votes
2answers
306 views

Qiskit CNOT-gate matrix mixup?

In the qiskit textbook chapter 1.3.1 "The CNOT-Gate" it says that the matrix representation on the right is the own corresponding to the circuit shown above, with q_0 being the control and ...
0
votes
1answer
30 views

How to use backend.run() with a constant pulse shape in order to get the results of a measurement?

I have formed a constant pulse and then I ran a measurement on the pulse. Now, I want to run a job to access the results of the measurement. Attached is a picture of the pulse and measurement. Now, at ...
1
vote
0answers
45 views

Applying a projector or a general nonunitary gate in the middle of a circuit using qiskit

Is there a way to implement a projector gate in a middle of a circuit?. For instance, assuming I have a Bell state $|00\rangle+|11\rangle$, I'd like to apply a projector on the first qubit onto state $...
1
vote
1answer
43 views

Integer factorization using Shor's Alorithm

I have question about Shor's algorithm, from I know it's for factorize an integer and can factorize big number with ease. I using Qiskit to try make a simple factorization program (with local ...
0
votes
1answer
68 views

Faster pulse generation in Qiskit

I need to be able to generate very quickly pulse schedules to submit them on quantum chips. For the moment I am generating instances of QuantumCircuit: ...
1
vote
0answers
39 views

Transform Fermionic operators to quantum circuit in qiskit

I am trying to realize a modified version of the UCCSD algorithm, which consists of combining multiple fermionic opeators to form a unitary tranformation U to act ...
2
votes
2answers
69 views

How to Implement a noisy identity gate on qiskit?

I can successfully implement the U gate (single qubit) on qiskit, but when I am trying for the identity operation it is not showing any differences with the ideal one .
1
vote
1answer
35 views

Matplotlib graphs are being duplicated each time

Simple UI question. I have installed qiskit according to the instruction and try to implement some basic operations. I have the issue that anything I plot appears twice. I am not sure why this is ...
1
vote
1answer
41 views

Pack Header Error when using QAOAProgram [closed]

I want to use QAOAProgram from Qiskit in the following way: ...
0
votes
0answers
21 views

How would you measure an X gate with qiskit.pulse.builder.measure?

I am using this link: https://qiskit.org/documentation/stubs/qiskit.pulse.builder.measure.html for reference. How would you use the measure command in order for an X gate to be measured within the ...
0
votes
1answer
31 views

What are the runtimes of the different modes of qiskit's mcx?

Qiskit's mcx has four different modes: 'noancilla': Requires 0 ancilla qubits. 'recursion': Requires 1 ancilla qubit if more than 4 controls are used, otherwise 0. 'v-chain': Requires 2 less ancillas ...
0
votes
1answer
41 views

I have a questions about the represented values in the chapter “Advanced single bit gates”

I don't understand what are the values of this table at the very end is representing. My question: Does decimal values in the table represent Frequency divided by shots?
1
vote
0answers
56 views

Thoughts in coding large and repetitive/non-repetitive quantum circuits?

Just out of curiosity, are there advances or directions on how to write a program (e.g. in qiskit) for a large number of qubits? Assuming that the number of gates ...
0
votes
1answer
38 views

Active space chosen for VQE in qiskit

I encountered a problem when learning from the qiskit tutorial about solving electronic structure problem with VQE. Under the "Running VQE on a Statevector Simulator" part, the code provided ...
4
votes
1answer
56 views

How is the state preparation Unitary in initialize selected?

Normally, in order to prepare the Bell state $\frac{1}{\sqrt{2}}(|00\rangle+|11\rangle)$, we can simply make a circuit with a Hadamard gate on $|0\rangle$ followed by a CNOT gate on $|1\rangle$. ...
1
vote
1answer
39 views

About qiskit's error mitigation

In qiskit, the error correction using least squares is apparently in qiskit-ignis/qiskit/ignis/mitigation/measurement/filters.py, source code from github and reads: ...
-4
votes
1answer
37 views

How to Report an error in the Qiskit Textbook?

In the Qiskit Textbook in Chapter "Introduction to Quantum Computing -> Entangled states -> The CX gate revisited" the following sentence might be wrong: If we do the CX now, we will ...
0
votes
1answer
32 views

How to perform a plot histogram for a circuit?

I have created a circuit and I don't know how to plot a histogram. I tried to plot a histogram but it gives me output for 0000 case only, how to get to know the probability for all of the cases. The ...
2
votes
0answers
25 views

Managing memory while running a high depth circuit simulation (amplitude amplification) using Qiskit

I am running an instance of amplitude amplification using Qiskit (v 26) on Google Colab. The circuit is approximately 17 qubits in space and $O(ck)$ in depth where $k \in \left \{1,2,3....,22 \right \...
1
vote
0answers
34 views

How do you verify the output of an X Gate within the Pulse gates framework?

I have found out how to create an X gate for a constant pulse within the Pulse gates framework found on this link: https://qiskit.org/documentation/tutorials/circuits_advanced/05_pulse_gates.html My ...
3
votes
0answers
61 views

"503: Server Unavailable. Your server appears to be down. Try restarting it from the hub". Help

This message is popping continuously for 2 days in my IBM Quantum lab. I have tried logging out and in again, restarting the browser, changing the internet connection, and changing the device but this ...
1
vote
1answer
50 views

Trouble when implement a self designed gradient in qiskit

everyone! I have trouble when implement a self-designed gradient to the VQE algorithm. The following code will pop the 'ListOp' object is not callable exception to the last line of the code when ...
1
vote
2answers
111 views

How to build a QAOA Ansatz

I saw there is a qiskit package called "QAOAAnsatz" https://qiskit.org/documentation/stubs/qiskit.circuit.library.QAOAAnsatz.html. But I didn't find out any tutorial related, so I have no ...
0
votes
1answer
59 views

Measuring the accuracy of a circuit output?

I have created a circuit and got the output which matches the truth table but, I'm not understanding the measuring the circuit output in terms of the probabilities, power or error. This is the circuit ...

1
2
3 4 5
23