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
1 answer
53 views

How to see the effects of the depolarizing channel in qiskit?

I am playing around with adding noise to quantum circuit simulation using qiskit_aer.noise.NoiseModel(). My code creates a quantum circuit and simulates it with ...
Christian Bunker's user avatar
0 votes
0 answers
39 views

Materials for Qiskit Exam

I spent a few months studying from the following materials but still failed the Qiskit exam (38/60 = 63%). I will be retaking next week so I'm looking for recommendations for any materials I may have ...
epsilonolispe's user avatar
1 vote
0 answers
40 views

What does adding depolarizing error on a Hadamard gate mean mathematically?

I have a quantum circuit as the following picture. Now I add the depolarizing error on the Hadamard gate using the following code in Qiskit. ...
Michael.Andy's user avatar
2 votes
0 answers
73 views

Comparative analysis of TensorFlow-Quantum, Pennylane, and Qiskit, to implement quantum CNNs

I am currently working on a project wherein I have to implement a Quantum Convolutional Neural Network. The best options for NISQ devices are hybrid algorithms, so I will try integrating quantum ...
Chan's user avatar
  • 121
0 votes
1 answer
36 views

Why is Qiskit's QASM simulator giving me incorrect result with VQE?

In the code below, I am using VQE without noise to calculate the minimum expectation value of the two-qubit operator X^X. I get the correct result when I use statevector_simulator but do not get the ...
bisarch's user avatar
  • 189
0 votes
1 answer
53 views

What is the gate order in QuantumCircuit.data?

I'm trying to print the quantum gates in a circuit using the QuantumCircuit.data. However, the printed quantum gate order is not the same as the drawing. For example, in the QFT5 circuit generated ...
Amanli's user avatar
  • 25
2 votes
2 answers
38 views

Compatibility of partial_transpose in Qiskit

I need to calculate the negativity of a density matrix; in doing so on Qiskit I stuck on the problem of computing the partial transpose for a problem of compatibility. Basically I extract my density ...
Giulia Tranquillini's user avatar
1 vote
3 answers
151 views

Why does my quantum circuit run so slow on a real IBM quantum hardware?

I have created a very simple circuit on qiskit to produce a Bell state: bell = QuantumCircuit(2) bell.h(0) bell.cx(0, 1) bell.measure_all() And I then run it on a ...
Stéphane's user avatar
0 votes
2 answers
86 views

Qiskit, Statevector.from_label

I apply Grover's on an eigh qubits circuit I just want to amplify the states whose qubits 6 and 7 are |1> The following test works (the state 11011001 is correctly amplified) ...
Maurice Clerc's user avatar
0 votes
1 answer
83 views

Modular addition in Qiskit

I want to implement the Jordan gradient estimation algorithm in Qiskit. I need a unitary operator $U_f$ that performs as follows: $$U_f: |x_1\rangle |x_2\rangle \cdots |x_d\rangle|y\rangle \...
Ramin Fakhimi's user avatar
0 votes
1 answer
46 views

How does the Qiskit AerSimulator performance scale with the circuit depth?

The performance of a full-statevector simulation by the Qiskit AerSimulator scales of course exponentially with the number of qubits, since the dimensionality of the Hilbert space where an $N$-qubits ...
SimoneGasperini's user avatar
1 vote
0 answers
47 views

IS my QUBO too big for QAOA using IBM Quantum computer?

On qiskit, I have defined a QUBO, called qp as follows: ...
Stéphane's user avatar
0 votes
1 answer
88 views

How to apply error-correction to the swap test circuit?

Swap test is a simple quantum circuit to measure the inner product of two quantum states [Wiki: swap test], it only contains three quantum gates. However, due to the error in the real quantum computer ...
Saul_better's user avatar
1 vote
0 answers
24 views

How to Find a circuit that evolves from one density matrix to another(qiskit or cirq)

given two density matrices, dmBefore and dmAfter, I want to generate(find) a circuit in Qiskit or Cirq that starting initaliazed with dmBefore ends with dmAfter after it's execution. Is it possible?. ...
Luis ALberto's user avatar
0 votes
1 answer
31 views

How to implement a doubly controlled phase gate?

I'm trying to implement a doubly controlled phase gate using Qiskit. I'm aware of this proposed solution, but it's not working on my Google collab notebook. For some reason, I cannot import the "...
Herr Schrödinger's user avatar
0 votes
1 answer
142 views

How to calculate the state overlap of two quantum circuits?

Given two parametrized circuits, is there a way of calculating the state overlap of the two of them? I have seen that with Qiskit you can do it through this class: https://qiskit.org/documentation/...
bjail66's user avatar
  • 155
1 vote
0 answers
21 views

Can someone explain the behavior called "Aer fast expectation" of Qiskit simulators?

Earlier I asked a question on why statevector_simulator ignores the number of shots when calculating the expectation value of an operator using ...
bisarch's user avatar
  • 189
1 vote
1 answer
84 views

Qiskit transpiler error: Unable to translate

This code worked in a previous version of ibmq_simulator and, I think, it works with qiskit_aer, but it doesn't work here and I don't understand the error message. The issue is there is no "path&...
Anna Naden's user avatar
0 votes
1 answer
42 views

How to enable qiskit logging? Where is the log file?

I'm trying to debug a qiskit circuit that won't "unroll." Looking at the source code, there are a log of logging calls but they aren't enabled. How can I enable logging in qiskit? Where is ...
Anna Naden's user avatar
0 votes
1 answer
41 views

Why don't I receive the output I expect?

I tried to test the Bitflip code using Qiskit. So, see my code below, build the circuit and initialised the first qubit in the state $\biggl[ \frac{1}{\sqrt{3}}, \sqrt{\frac{2}{3}} \biggr]$. ...
3nondatur's user avatar
  • 163
0 votes
0 answers
27 views

How to augment a QASM circuit for orbital rotation

Could anyone advise on how to properly augment the hamiltonian circuits in https://github.com/CQCL/ethz-hackathon22/tree/main/benchmarking/circuits for orbital rotation ? https://poe.com/s/...
kevin's user avatar
  • 7
1 vote
0 answers
52 views

VQE for Vibrational ground state energy

I was reading this article. In this article, they calculated the vibrational energy of CO2 and NH3 molecules using VQE, and I checked qiskit documentation for finding Vibrational energy using qiskit. ...
Akash Yadav's user avatar
0 votes
1 answer
71 views

How to "eliminate" some components of the state vector?

I have $n*k$ qubits. At the very beginning the length of the state vector is $2^{nk}$. After some manipulations (Qiskit circuit) I reduce it to $k^n$ and it looks like $a|1...\rangle +a|0...\rangle ......
Maurice Clerc's user avatar
2 votes
0 answers
35 views

GPU Support for Qiskit's SPSA Optimization Algorithm

I am using Qiskit's SPSA optimization algorithm to find the ground state energy of various lattices (fermi-Hubbard model) by running different circuits through it and having the algorithm modify the ...
Nidhish Sharma's user avatar
1 vote
0 answers
71 views

Hamiltonian of Bose-Hubbard model

In https://medium.com/qiskit/introducing-bosonic-qiskit-a-package-for-simulating-bosonic-and-hybrid-qubit-bosonic-circuits-1e1e528287bb , could anyone explain the rationale behind the use of ...
kevin's user avatar
  • 7
2 votes
1 answer
137 views

Find the number of iterations for Amplitude Amplification to get the correct states amplified

I'm trying to use Grover operator in Qiskit (more precisely to perform Amplitude Amplification) but I'm facing some problems. I'm experimenting the Quantum Amplitude Amplification in order to amplify ...
Tommaso's user avatar
  • 23
2 votes
0 answers
34 views

Qiskit experiments on qiskit IBM runtime [duplicate]

I'm trying to perform a state tomography on a quantum circuit using Qiskit experiments. I was able to perform the tomography on the AerSimulator but have still not been able to do the tomography on ...
J. Villas's user avatar
3 votes
1 answer
66 views

state_tomography_circuits error

I build a QuantumCircuit named qc, I want to generate state tomography circuits to evaluate fidelity of simulation. I used code, ...
Jie Jiang's user avatar
3 votes
1 answer
44 views

Rotations with angle 0 after transpiling with qiskit

When using qiskit to transpile a circuit sometimes there is a gate Rz(0.0)in the result. I wonder 1) why this happens and 2) what does it mean for the executed ...
qcabepsilon's user avatar
0 votes
1 answer
76 views

How to implement Shor's 9-Qubit-Code in Qiskit?

I am new to qiskit and currently trying to implement Shor's 9-Qubit_Code. I am trying to orient my code on the example given in the official qiskit-tutorial and so far I have the following: ...
3nondatur's user avatar
  • 163
2 votes
1 answer
166 views

How does Qiskit/Qasm simulate the density matrix of up to 30 qubits?

The full density matrix of 30 qubits contain $2^{30}$ states. How does qiskit/qasm implement this without storing and computing the full $2^{30}$ density matrix of possible state coefficients?
James's user avatar
  • 445
1 vote
0 answers
46 views

how to convert a qiskit circuit to pauli strings

I have a qiskit quantum circuit that i want to convert to pauli strings (coefficients,observables) so that i can use it to build a hamiltonian. I did not see any methods in qiskit quantumcircuit ...
Dassen's user avatar
  • 11
1 vote
1 answer
62 views

Defining an oracle with Qiskit

I have a 8-qubits circuit whose final vector state may be for instance: $$ \frac{\sqrt{2}}{4} |00010101\rangle+\frac{\sqrt{2}}{4} |00101010\rangle+\frac{\sqrt{2}}{4} |01010110\rangle+\frac{\sqrt{2}}{4}...
Maurice Clerc's user avatar
1 vote
1 answer
116 views

How can I find the documented T1 time of a retired IBM system?

I need to find the published mean T1 time for the 'ibm_oslo' system that I used in an experiment a while back. Unfortunately, that system has now been retired and there's seemingly no way for me to ...
Lucy H's user avatar
  • 13
2 votes
1 answer
94 views

Are there qiskit or stim examples of how to decode a subsystem code

I can manage decoding a stabilizer code in qiskit and stim. I'd like to try a subsystem code next. For a stabilizer code, all stabilizers commute so simultaneous measurement of these produces ...
unknown's user avatar
  • 1,786
-2 votes
1 answer
59 views

Unitary matrix knowing input and ouput states

Input: n qubits after H gates. Output, after measure: the n different bit strings of length 2^n with just one 1, with same probabilities. Or said differently: Input state |phi0>=(1,1,...1)/2^n ...
Maurice Clerc's user avatar
2 votes
1 answer
35 views

Is it possible to use GPU backends with `Statevector.evolve`and `DensityMatrix.evolve` method?

I find it useful to use the Statevector.evolveand DensityMatrix.evolve methods as a shorthand to using the Aer simulators with <...
RGWinston's user avatar
  • 153
1 vote
3 answers
81 views

How to join different quantum circuits into one big circuit on specific qubits in qiskit?

I have a quantum circuit that loads the data and is acting on qubit q0,q1,q2 then another circuit that does the same on q3,q4,q5 ...
Another Random Guy's user avatar
0 votes
0 answers
49 views

python code to approximate an arbitrary 2*2 unitary matrix with gates H,T and Z

I'm new to programming, tried different options, compiled programs myself, took them from websites, but they didn't work, for example, the program: ...
Настя's user avatar
2 votes
2 answers
164 views

In the qiskit QFT demonstration, how to implement CPHASE between Q0 and Q1?

In the qiskit example for QFT demonstration the ibm_q_bogota is used, it has the following layout: in the same time the measurement circuit for QFT demonstration is: For such a linear layout how is ...
Curious's user avatar
  • 239
0 votes
1 answer
77 views

The amount of clbit arguments 0 does not match the instruction expectation (16)

I have a quantum circuit of 16 qubits, and I am running Amplitude Estimation on that, my final qubit to measure is 15th, so I do this ...
Another Random Guy's user avatar
1 vote
1 answer
32 views

How to best represent 5-Qbit codeword operator in Qiskit [duplicate]

We learned that in the 5-Qibit error correcting code, the logical zero state $ | \bar{0} \rangle $ is encoded in the form of $ \frac{1}{4} (\mathbb{1}+M_0)(\mathbb{1}+M_1)(\mathbb{1}+M_2)(\mathbb{1}+...
Blackwidow's user avatar
2 votes
1 answer
57 views

Grover, Qiskit, general definition of "good state"

Trying to implement Grover under Qiskit I found an example with good_state = ['110','101'] For a given $n$ it possible to define good_state as "any string of $...
Maurice Clerc's user avatar
1 vote
2 answers
274 views

qiskit textbook code throws RuntimeError: IBMBackend.run() is not supported in the Qiskit Runtime environment

I am trying to run the quantum communication algorithm from qiskit textbook "Entangled States" using my IBM API key, however, it throws the error ...
Omar Morales Rivera's user avatar
0 votes
1 answer
26 views

Nonsensical projection of initialized qubits in Qiskit

I wanted to try Qiskit by setting up two qubits initialized to $ | 11 \rangle $ or $ | 01 \rangle $ and two classical bits to measure those two initialized qubits. For this simple demonstration, I ...
Blackwidow's user avatar
1 vote
1 answer
158 views

Exponential of SparsePauliOp in Qiskit

Since qiskit.opflow has been deprecated, the way I used to generate a UCC ansatz was to use ...
Carter Gustin's user avatar
2 votes
1 answer
199 views

What are the differences between the two Estimator in the qiskit

Recently, I have been completing a VQE code and implementing the VQE algorithm for noisy models. However, during this process, I discovered that there are two types of Estimators provided in different ...
Curry's user avatar
  • 53
0 votes
1 answer
114 views

Qiskit primitives with commuting observables

Is there a way of bundling commuting observables in qiskit primitive estimator to save the number of shots? With the new feature of Qiskit primitives, it is easy to sample observables for a specific ...
Zeeshan ahmed's user avatar
0 votes
2 answers
47 views

How to improve the state fidelity of state tomography in qiskit

I want to simulate state tomography on a 8 qubit state. I use the example https://qiskit.org/ecosystem/experiments/manuals/verification/state_tomography.html as a guide. My problem is that I get a ...
Luis Andres Colmenarez's user avatar
2 votes
1 answer
37 views

In what order does Qiskit assign parameter values?

It seems that "assign_parameters" method introduces the values of the parameters in alphabetical order of different "ParameterVector"s' names. Here is a simple example: ...
Paul's user avatar
  • 70

1 2
3
4 5
43