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
1
vote
0answers
2 views

From Qubo 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 ...
-4
votes
1answer
36 views

what should we add to complete the program

In the following code, what should replace #Your code here, if we want to create the quantum state $\frac{1}{\sqrt{2}}(|0\rangle - |1\rangle)$? (Hint: Think about ...
-4
votes
0answers
30 views

How do you debug the following code?

This is code provided by user47787 in response to my previous question: How to use backend.run() with a constant pulse shape in order to get the results of a measurement? When I run the following code,...
1
vote
1answer
86 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
26 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
35 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
54 views

How do you change the backend.run() command?

This is code from Chapter 6.1 of the qiskit textbook, which shows a job being run. How would you change the first line of the backend.run() command, the schedules parameter, in order to use it for a ...
1
vote
1answer
33 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
37 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
32 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
1answer
52 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
30 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
40 views

Pack Header Error when using QAOAProgram [closed]

I want to use QAOAProgram from Qiskit in the following way: ...
0
votes
0answers
20 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
26 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
33 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
52 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
27 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
52 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
32 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
34 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
29 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 ...
1
vote
0answers
24 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
32 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
58 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
39 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
78 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
49 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
vote
2answers
73 views

How do you map an X gate to a constant pulse?

I was wondering how to map an X gate to a constant pulse shape. This https://qiskit.org/documentation/tutorials/circuits_advanced/05_pulse_gates.html is the link that I am working off. It shows an ...
0
votes
1answer
59 views

Which Qiskit Aer ideal quantum circuit simulator to use when aer_simulator is no longer available?

Some Qiskit tutorials have aer_simulator in the code and I have noticed that this simulator is no longer available. ...
1
vote
2answers
66 views

Ramdon accuracy using VQC and Iris dataset

Using the same seed (seed_simulator and seed_transpiler) I get different accuracy when running it several times. In Aqua library (from qiskit.aqua.algorithms import VQC) I solved it adding ...
0
votes
0answers
29 views

How does Qiskit's VQE encode binary digits into a solution from a given Hamiltonian?

So far I have been working with the VQE on different Hamiltonians that happened to have degeneracies, that is there were always at least two different global minima, because the Hamiltonians I was ...
1
vote
2answers
60 views

How to convert the output column vector or matrix into bra ket notation using python?

When using qiskit, we normally get the output inform of column vectors or matrix. But is it possible to convert then into bra ket notation using some python code? Can someone help me with this?
1
vote
1answer
47 views

Custom labelling of randomly generated unitaries in Qiskit

I'm writing a program in Qiskit involving the generation of Haar-random unitaries. Is there a way to label each unitary such that the label appears instead of 'unitary' when I draw the circuit? ...
1
vote
1answer
27 views

Qiskit: rounding with get_statevector does not work?

I am trying to follow some tutorials for Qiskit and came to the point where I wanted to get some statevector containing $1/\sqrt{2}$ with the following line of code: ...
2
votes
3answers
73 views

How to describe the evolution of a density matrix using the Choi matrix?

How do I apply the Choi matrix on a Density matrix. Say my process is a Hadamard gate, and my input state is the ground state on 1 qubit (qubit id 0). $U = H = \dfrac{1}{\sqrt{2}} \begin{bmatrix}1&...
0
votes
1answer
36 views

how can we save a model using qiskit_machine_learning?

How can we save a trained model using Qiskit Machine Learning library? I've built a VQC classification model and once finished, I'd like to save the different models to be loaded later. There is a <...
0
votes
1answer
41 views

Manual measurement error mitigation returning a negative number of counts

I have a simple 2 qubit circuit which I am trying to protect from errors using the measurement error mitigation technique laid out here: https://qiskit.org/textbook/ch-quantum-hardware/measurement-...
1
vote
0answers
52 views

Error when computing the self-designed gradient in qiskit

I had question with the way to define a new kind of gradient to improve the performance of VQE. The gradient formula I used consists of multiply energy (measurement result of the Hamiltonian) with the ...
0
votes
0answers
46 views

How to solve a linear equation of qubit operators in qiskit?

I am trying to repeat the results from Peng and Kowalski (Eq 11) which solves the analytical form of an equation consisting of powers of the Hamiltonian (moments): The $K$-th order PDS formalism is ...
0
votes
1answer
55 views

Get the inverse of a Hermitian operator for measurement in qiskit

I am using qiksit to measure the Hamiltonian H, which isbasically sum of Pauli strings, say something like 2*X^X+0.5*Z^Y. For ...
0
votes
2answers
84 views

How to assemble two quantum circuits whose qubit mapping states are different each other?

I uploaded similar question before, but the answer was not I want. I think I should show you in more detail about my question. I use SABRE algorithm which can do qubit mapping for executing quantum ...
0
votes
0answers
49 views

Qiskit equivalent of get_expectation_value() in ProjectQ

Is there a corresponding function that has the same function as function get_expectation_value() in Project Q? Get the expectation value of qubit_operator w.r.t. the current wave function ...
1
vote
5answers
199 views

How can I get the number of measurements where any specific qubit is equal to 0?

Say I am using a 100 qubit quantum computer, but my circuit is such that I am only interested in the output of a particular qubit. So for example I want to know how many outcomes had a result of 0 on ...
4
votes
1answer
77 views

What is the correlation between Toffoli and a more generic rotation shown in qiskit textbook

Can someone help me understand the correlation between the 2 diagrams in the qiskit textbook.
1
vote
1answer
41 views

How do you create a square pulse in Qiskit?

I am wondering how to create a square pulse in Qiskit. I am working off this Qiskit documentation but still cannot figure out how to create a square pulse.
1
vote
1answer
54 views

Trying to connect IBM Quantum to External API

Is it possible to connect a quantum computer to openlibary.org API? How do I find the public IP address to my quantum instance?
0
votes
1answer
44 views

How can I simulate the Avg CNOT Error on IBMQ Backends?

I want to know exactly how to estimate the Avg CNOT Error rate for IBMQ Backends? For instance, I tried to estimate the Avg CNOT Error rate for Belem Backend; I randomly prepared the 00,01,10,11 ...
0
votes
0answers
40 views

Where can we find Qiskit exercises solution/answers?

Where can we find Qiskit Exercises solution/answers, is there any website for it? Or any alternative way to check our answer/solution?
-1
votes
1answer
36 views

HLL Algorithm results interpretation

I have the following HLL qiskit implementation and really need some help interpreting the results! CODE ------------------------------ ...

1
2 3 4 5
21