Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
0 votes
0 answers
18 views

How do I set up Jupyter Lab for Quantum Computing [migrated]

I have just moved over from the IBM Quantum Lab to Jupyter Lab due to it getting shut down. I'm struggling with setting up a Quantum Computing file, as I think I'm just setting up a python file ...
Ark Rana's user avatar
1 vote
1 answer
29 views

What is the difference between HamiltonianGate and PauliEvolutionGate in qiskit?

The PauliEvolutionGate implements $ U = exp(-itH)$ for an operator $H$ consisting of Pauli terms. Since qiskit 1.0 there is also ...
qcabepsilon's user avatar
0 votes
0 answers
16 views

Qiskit error: too many subscripts in einsum when calling DensityMatrix.evolve(Operator)

Minimal details: My density matrix is of dims=(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2)). I want to use DensityMatrix.evolve(qc) to evolve this DM with a quantum circuit qc. Below is the code ...
tomek's user avatar
  • 115
0 votes
1 answer
60 views

How to convert states |0011⟩, |1100⟩, |0101⟩ to |1111⟩?

How can I use X gate (quantum not) to convert each of the pure states |0011⟩, |1100⟩, |0101⟩ to |1111⟩ with Qiskit? My programming assignment is Using the idea of a multi-controlled phase gate, now ...
Jettapol's user avatar
1 vote
1 answer
30 views

Portfolio Optimization with VQE

I'm working on a portfolio optimization problem using Qiskit and I'm encountering an error when trying to solve a quadratic program using MinimumEigenOptimizer with SamplingVQE. Any insights on what ...
Ivan's user avatar
  • 11
0 votes
1 answer
24 views

How to understand the matrix representation of the Toffoli produced by qiskit?

I would like to ask about the results of running the Toffoli gate matrix and circuit diagram on colab Possible reasons for inconsistent results with the following correct matrix results. I would also ...
Dona's user avatar
  • 1
2 votes
1 answer
28 views

How to apply gates on a subspace of a superposition of qubits?

Let us say that I have the state $a|00\rangle + b|01\rangle + c|10\rangle + d|11\rangle$. I wish to apply a one-qubit unitary (a $2\times2$ matrix) U on the subspace spanned by $|01\rangle$ and $|10\...
Soumyadeep sarma's user avatar
1 vote
0 answers
15 views

Are reset gates allowed on IBM quantum computers?

My circuit involves many "reset" gates. After running on the IBM real backend, the experiment status says "Failed" with error message that says: Failed - Unknown operation type ...
Deren  Liu's user avatar
3 votes
2 answers
87 views
+50

Solving quantum equation using qiskit

I am struggling to solve the mathematical equations using qiskit in the below paper. https://arxiv.org/pdf/2205.00081 The mathematical equation I tried to solve is below: I tried solving it using ...
Manu's user avatar
  • 53
1 vote
1 answer
61 views

Pauli Strings on the same qubit?

I am working on solving a Max-Cut problem using fewer qubits via efficient encoding methods of more classical information onto a single qubit.Using the method of The original problem has the ...
Another Random Guy's user avatar
1 vote
1 answer
16 views

How to get partial probability from measurements in qiskit?

Is there a way to get partial probability distributions on Qiskit? Consider a quantum circuit measuring all the qubits. I want to retrieve the probability of, say, outcome ...
Alyssa Lin's user avatar
0 votes
1 answer
21 views

Bernstein-Vazirani Algorithm not giving the right results in Qiskit Aer

I have this implementation of the Bernstein-Vazirani Algorithm for Qiskit Aer: ...
Ícaro Lorran's user avatar
2 votes
1 answer
46 views

Is there a qiskit method to obtain the generator (ie. Pauli operator) of a gate?

Is there a (qiskit) method to give the generator $H$ in terms of Paulis of some gate $U=e^{iH}$ defined in qiskit. For example, it would take CNOT as input and give a representation of $\pi /4 (I_1 - ...
qcabepsilon's user avatar
0 votes
1 answer
40 views

doesn't a reset on an entangled qubit collapse a superposition?

When I reset an entangled qubit then measure it looks a superposition isn't collapsed to a certain states. In my experiment, the state just before applying a reset is: $$\frac{1}{2}(|000⟩+|011⟩+|101⟩+|...
taketoshi kinoshita's user avatar
2 votes
1 answer
99 views

Why is the Choi matrix different from the analytic form for a depolarizing channel?

I'm currently trying to implement the depolarizing channel on qiskit. But, as I see in my calculation it doesn't match with the qiskit aer_noise. So, for the Depolarizing Channel we got : $$ \mathcal{...
felipechoy's user avatar
2 votes
1 answer
21 views

Relation between Rz gate and Phase gate

As I know, the $Rz(\frac{\pi}{2})$ gate is equivalent to the Phase gate $S$ up to the global phase. However, I found using qiskit, the $Rz(\frac{-\pi}{2})$ is also equivalent to the Phase gate $S$. I ...
Amanli's user avatar
  • 57
1 vote
0 answers
23 views

Custom classical control in qiskit

I'm generating a qiskit circuit and want to add an X gate to a qubit if the sum of some previous measurements modulo 2 is equal to 1. In cirq, I could just use a sympy expression that would look ...
Palash Goiporia's user avatar
3 votes
3 answers
195 views

How to convert a combinatorial optimization problem into a problem hamiltonian

I want to ask how I can convert any combinatorial optimization problem into a Problem Hamiltonian, since such a conversion is needed in order to solve an optimization problem on quantum hardware (e.g. ...
Maths_hawk's user avatar
2 votes
1 answer
60 views

Does Qiskit SamplerV2 change circuit depth?

I'm currently implementing some algorithms on IBM quantum devices. After the migration to qiskit 1.0, I started using primitives and SamplerV2. What I observed is that even if I manually select a ...
G.Lebonwski's user avatar
1 vote
1 answer
18 views

In e91 protocol, if one of the bases combination was not chosen, what should be done to avoid division by zero?

In e91 protocol, if one of the bases combination was not chosen, what should be done in this case to avoid division by zero? One solution that comes to mind is setting the whole value to zero, but is ...
Mohamed Elsheikh's user avatar
0 votes
0 answers
20 views

are there other error mitigation methods in qiskit?

recently I've tried solving this 3-SAT problem: (𝐴∨𝐵∨𝐶)∧(𝐴∨𝐵∨¬𝐶)∧(𝐴∨¬𝐵∨𝐶)∧(𝐴∨¬𝐵∨¬𝐶)∧(¬𝐴∨𝐵∨𝐶)∧(¬𝐴∨𝐵∨¬𝐶)∧(¬𝐴∨¬𝐵∨𝐶) by grover's algorithm. The result looks good with AerSimulator in ...
taketoshi kinoshita's user avatar
0 votes
1 answer
46 views

What is an introductory book or resource for qiskit?

I am a complete beginner to qiskit, I know some stuff about quantum computing (I read a book on quantum computing by David McMahon), so now I want to learn to use qiskit, I tried to follow the recent ...
Kutubkhan Bhatiya's user avatar
1 vote
1 answer
52 views

Why circuit in Shor algorithm differs for different factorized numbers?

I recently started studying quantum algorithms, and I have a question about Shor algorithm. I have been reading Qiskit documentation and other books and articles, I felt like it was changing the ...
momo's user avatar
  • 13
0 votes
1 answer
23 views

Manualy setting 'id' operation error probability in GenericBackendV2 doesn't work

I am trying to alter the noise probability for 'id' operation in GenericBackendV2. This is my code: ...
Mohamed Elsheikh's user avatar
4 votes
3 answers
409 views

Where to find a generic implementation of Shor's algorithm with Qiskit?

Since Shor's algorithm was deprecated in Qiskit, I'm wondering where to find a generic implementation. There are some examples over the Internet but factoring of 15 is just hardcoded.
Alexender Iotko's user avatar
0 votes
1 answer
28 views

Discrepancy between answers from different Estimators in qiskit

After upgrading to qiskit 1.0.0, I tried using different estimators: estimatorv2, qiskit-aer estimator and default primitive estimator. But I get different expectation values with each of them? Am I ...
Anaya Parra's user avatar
2 votes
0 answers
42 views

Is there a fix for the varying numerical gradients calculated in the optimizer with qiskit?

I am currently trying to train a quantum circuit on Qiskit using an Azure QPU. I have some parameterized gates that I optimize using ADAMs. However, as the output of the circuit $f(x)$ is not ...
Rij's user avatar
  • 53
1 vote
1 answer
24 views

Qiskit: Evolve TrotterQRTE from Operator

I am trying to implement the method in the following paper: Exponential Quantum Speedup in Simulating Coupled Classical Oscillators using Qiskit. All is good until I call evolve on ...
guest's user avatar
  • 11
2 votes
0 answers
36 views

How can I increase number of qubits by increasing RAM/GPU?

I am using Qiskit, where if I go beyond 32 qubits, the output does not get counted. The code is not supported by the stabilizer back-end. I want to use up to 100+ qubits for my task. I got RAM 42 GB ...
Syed Shahmir Kazmi's user avatar
0 votes
0 answers
8 views

Qiskit not install on AWS Apprunner [migrated]

I am running to run Qiskit on AWS Apprunner. Just a basic line to check the version. However the build fails when importing qiskit. Installation is done through a requirements.txt
Adhisha Gammanpila's user avatar
0 votes
0 answers
12 views

How to use qiskit-aer-gpu on aarch64?

I need to run noisy simulation, I have a Nvidia DGX and GH but they are aarch64 and not x86. Is there another way to use qiskit-aer-gpu?
Gilad Sivan's user avatar
1 vote
0 answers
42 views

Shor’s / qiskit.circuit.exceptions.CircuitError: 'duplicate qubit arguments' [closed]

All code for Quantum Realiazition Shor's algoritm P.S. I hope all operation almost correct. ...
Bekzad Dzhanpolatov's user avatar
3 votes
2 answers
48 views

How to compose a larger circuit onto a smaller circuit in Qiskit, adding extra quantum registers to some fixed list

$\newcommand{\ket}[1]{|{#1}\rangle}$ I have a Qiskit quantum circuit for multiplication $M$, that I want to compose onto another qiskit quantum circuit for inner ...
Aditya Morolia's user avatar
0 votes
0 answers
27 views

How to implement fault tolerant cat state construction with qiskit?

I want to build a fault-tolerant error correction gadget in qiskit. As a part of that, I want to construct cat states (for the syndrome measurements) in a fault-tolerant way. One way to do this, is to ...
qubitzer's user avatar
  • 187
1 vote
0 answers
26 views

qiskit transpile taking forever to run while CPU usage near zero

I am using the following code to use IBM's quantum computer. My understanding is that it is required before circuits are passed to the real quantum computers as certain operations and instructions ...
Deren  Liu's user avatar
0 votes
0 answers
6 views

Error with import qiakit_aer [migrated]

I've a very simple program: import qiskit_aer print(f'Version qiskit_aer = {qiskit_aer.__version__}') But I got an error: ...
Andreas's user avatar
0 votes
0 answers
23 views

Qiskit: Density matrix's dimension is too large

My circuit is with 18 qubits. I want to find density matrix by calling DensityMatrix.from_instruction(qc) but then I get an error "Maximum supported dimension for an ndarray is 32, found 36"....
tomek's user avatar
  • 115
1 vote
1 answer
48 views

Error when using crx gate in quantum circuit

When I try to run a quantum circuit that has a crx gate in it, I get an error AerError: 'unknown instruction: crx'. Below is an ...
Emmett Nash's user avatar
0 votes
0 answers
37 views

Qiskit IBM Runtime EstimatorV2 has changed the user specified default number of shots

While I am running some simulations on IBM hardware, I've noticed that the number of shots recorded in the metadata of the job is different from the number of shots I've specified. For example, I've ...
squareroottwo's user avatar
2 votes
1 answer
59 views

weird negative sign in a state vector in qiskit

I run the following simple code in qiskit, which get statevector of a quantum circuit. ...
mike_gz's user avatar
  • 23
1 vote
1 answer
64 views

Should I Stick to an Older Version of Qiskit Due to Tutorial Compatibility Issues?

I'm new to quantum computing and have recently started exploring Qiskit. I noticed that a new version was released in February, and since then, I've encountered some issues where many of the examples ...
aha san's user avatar
  • 35
1 vote
0 answers
17 views

finding weights for Zero Vector matching output vector VQA QISKIT

Hello fellow Quantum Computer Scientists, I'm relatively new to Quantum Computing and Qiskit. The changes in February have somewhat complicated my learning process, so please pardon my beginner ...
aha san's user avatar
  • 35
0 votes
1 answer
28 views

Non gate based error mitigation on qiskit

I am attempting to measure the expectation value of a product state using qiskit_ibm_runtime.EstimatorV2. There are no gates in the circuits. What options/...
squareroottwo's user avatar
3 votes
1 answer
328 views

Quantum circuit not showing when using qiskit with pycharm

I am trying to run below code in PyCharm: ...
Aleah Turner's user avatar
0 votes
1 answer
33 views

Solving optimization problems on real quantum hardware

I want to know how to solve a 01 Knapsack problem (or any optimization problem) on real Quantum Hardware only. I don't want to use an Application class or any classical simulation technique. If anyone ...
Maths_hawk's user avatar
0 votes
2 answers
40 views

How to perform noisy simulation of qiskit fake backends?

I have qiskit fake backends present in qiskit ibm runtime, If I run the circuit directly on the backend is it noisy simulation, or should I use qiskit Aersimulator and then perform noisy simulation ...
Vishnu Vardhan's user avatar
1 vote
1 answer
21 views

How is the controlled-n NOT gate represented in Qiskit?

I want to decompose an 8-control qubit gate like the one in the picture on the right using Qiskit, similar to the decomposition shown. To do this, I need a C7XGate for 7 control bits, but it seems ...
junghyunHa's user avatar
1 vote
1 answer
31 views

IBM quantum computer backend cycle time and real gate duration

I am new to dynamical decoupling and is trying to study this from qiskit: https://docs.quantum.ibm.com/api/qiskit/qiskit.transpiler.passes.PadDynamicalDecoupling . There, they are specifying the ...
Tianqi Chen's user avatar
1 vote
1 answer
41 views

QisKit Matrix Exponential VQC

I have some trouble building an exponential matrix using the latest version of Qiskit that supports Parameters. I am also interested in learning how to use custom loss functions (if this is even ...
aha san's user avatar
  • 35
1 vote
1 answer
35 views

Error when binding parameters to a quantum circuit

When I try to run the circuit below: ...
Opal Gill's user avatar

1
2 3 4 5
48