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.

504 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8 votes
1 answer
243 views

Enforcing a particular layout mapping in Qiskit

I would like to ask how to set a particular layout during transpiling. I guess that the layout can be set by the initial_layout parameter in the transpiler. However,...
soara's user avatar
  • 81
7 votes
0 answers
184 views

Run VQE for parametrized quantum circuit with ancilla qubits

Let's say we have the following circuit (picture and code shown below), and now the $q_0$ is an ancilla qubit. If the system of interest has only two qubits, Is there a way to use only $q_{1,2}$ as my ...
fagd's user avatar
  • 940
6 votes
0 answers
257 views

Quantum State Tomography Implementation in IBMQ

I am working to understand quantum state tomography, specifically using the algorithm presented in PRL 108, 070502. This paper is referenced in IBMQ implementations of QST, both in old deprecated ...
Nathan Miller's user avatar
6 votes
0 answers
135 views

Bell State 11 not working for parity curve

I am currently writing a script to automate the creation of parity curves for a 2 qubit bell state and then calculate fidelity and proving entanglement from that (inspired by this paper). It was going ...
thewolfaxe's user avatar
5 votes
0 answers
179 views

How to get the compiled circuits and measurements from a Qiskit Runtime job

I have not been able to find any way to retrieve the compiled circuits and the measurement counts used for a Qiskit Runtime job. This page describes the various error suppression mechanisms available. ...
Elijah Pelofske's user avatar
5 votes
1 answer
614 views

Two qubit gate decomposition using Qiskit

I am writing some python code to be able to optimise the total error in two qubit gate decomposition. I am using the Qiskit module qiskit.quantum_info.synthesis.two_qubit_decompose My question relates ...
shuey97's user avatar
  • 151
5 votes
0 answers
620 views

OpenFermion to Qiskit

Is there a direct way to go from an object generated in OpenFermion to objects usable in Qiskit? I can't find anything about any plugin. It's not too hard to translate into pyQuil and then to Qiskit ...
Andrew Jackson's user avatar
5 votes
0 answers
158 views

Results from looped experiments on IBM Q different than individual experiments

I'm experiencing an issue while using Qiskit where the counts from a job return vastly different values when ran in a loop or as an array of circuits as opposed to single experiments when run by ...
Mav's user avatar
  • 83
5 votes
0 answers
147 views

How can I express controlled unitary operation in QPE of this implementation of HHL?

I have found this implementation of HHL, and I don't understand why the controlled unitary operation is expressed in the form of $\exp(i t_0 A/2)$ and $\exp(i t_0 A/4)$. The rotation of $\pi$ and $\...
Macalcubo's user avatar
  • 133
4 votes
0 answers
51 views

Difference between Qiskit and Openfermion two body integrals

I am struggling with understanding the differences between OpenFermion and Qiskit libraries when it comes to Molecular Data, two body integrals. For example, I am working with the following ...
Eugen's user avatar
  • 41
4 votes
0 answers
35 views

Performing Binary Operations on Classical Bits

I am trying to prepare the n-qubits GHZ state using LOCC on Qiskit. The implementation uses the result of some mid-circuit measurements for later operations. I am now using something like ...
Sami Farrag's user avatar
4 votes
0 answers
135 views

Qiskit QAOA optimization does not work when setting simulation seed in AerSampler

I am using Qiskit's QAOA for optimization and I would like to extract the probabilities distribution obtained in the optimization loop when running the circuit with the optimal parameters set. To do ...
user26100's user avatar
4 votes
0 answers
238 views

The error with Estimator primitive due to the qiskit version

The code that I follow is from this tutorial. But there are some errors due to the version of qiskit on the Estimator primitive ...
Linh Nguyễn Vũ's user avatar
4 votes
1 answer
100 views

HHL for the pseudoinverse in Qiskit

The HHL algorithm can be modified to compute the pseudoinverse of $A$ as is shown here and here. Is there anyway to do this in Qiskit without coding the entire thing manually?
bonsh's user avatar
  • 41
4 votes
0 answers
139 views

Apply a single-qubit channel between in between two circuits in Qiskit

Suppose, you have two parts of a circuit in Qiskit, qc1 and qc2 on any number of qubits such that the entire circuit is given by ...
Marsl's user avatar
  • 899
4 votes
0 answers
31 views

Qiskit: efficient way to create bound circuits?

I am running an optimization problem whose objective function $F(a)$ requires measuring N variational circuits $V_i(a)$ at each evaluation. So, roughly, I have created N parametric circuits and I do: <...
consthatza's user avatar
4 votes
0 answers
218 views

Qiskit NoiseModel.from_backend gives wrong gate error

According to the Qiskit documentation, a gate error is simulated by a thermal relaxation channel followed by a depolarisation channel, where the parameter of the depolarisation channel is adjusted so ...
siserman's user avatar
  • 161
4 votes
0 answers
35 views

How does it work QasmSimulator with the option "density matrix"?

I am making some simulations on IBM Quantum Lab and as backend I tried to use QasmSimulator(method = "density_matrix") in order to simulate noise. I wanted to know how this method works in ...
Natale Matranga's user avatar
4 votes
0 answers
167 views

How to calculate Quantum Discord for two qubit system using Qutip?

Quantum discord of a bipartite system can be determined as: $${D_A}({\rho _{AB}}) = I({\rho _{AB}}) - {J_A}({\rho _{AB}}),$$ The subscript of $A$ denotes that the measurement has been performed on the ...
Paranoid's user avatar
  • 141
4 votes
0 answers
49 views

Predator–prey theory

We have a project where we are supposed to simulate the predator–prey theory in qiskit. Can anyone help or suggest of any ways to start from somewhere because we are kinda lost.
thanos ks's user avatar
4 votes
0 answers
177 views

How to implement a gate that generate a uniform superposition of all permutation of element

I'm looking for a quantum circuit that permits generating a uniform superposition of all possible permutations for example if we have as input $|0123\rangle$ the output will be the uniform ...
malak sa's user avatar
4 votes
0 answers
88 views

Why does running a pulse schedule for Bell circuit give incorrect counts?

As part of another project I need to be able to run a custom pulse schedule for a bell ciruit and measure the counts. However I am having a problem where running the scheduled circuit is giving counts ...
John Kerf's user avatar
4 votes
0 answers
97 views

What is the most efficient method to update the binary encoded values inside a quantum state?

We're implementing a QML algorithm in which we have to update the value stored inside a quantum state which is strictly unknown to us, by multiplying it with a real number classically stored with us. ...
Rohan Bhatia's user avatar
4 votes
1 answer
264 views

Does one measurement affect the following measurement errors in mid-circuit measurement?

Suppose I have a quantum circuit with a few measurements (say $N$) on a single qubit. Before all the measurements, I generated calibration circuits and the 2 by 2 calibration matrix for that qubit of ...
ZR-'s user avatar
  • 2,378
4 votes
0 answers
60 views

Why the pulse scheduler produces a different output from the original circuit?

As part of a larger code, I have to convert a quantum circuit into a Pulse scheduler. The problem is that the scheduler output is incompatible with the circuit output. In particular, the difference ...
Davide Rattacaso's user avatar
4 votes
1 answer
134 views

Can the ancilla for Qiskit's mcx with mode="recursion" be dirty?

I think their implementation is close to the one from here which does use a dirty ancilla, but I just want to make sure
Dani007's user avatar
  • 532
4 votes
0 answers
87 views

Computing specific observable for a Clifford circuit

Given a clifford circuit, how can I simulate it efficiently to get the 2-RDM (reduced density matrix) $D^2=\langle a_i^\dagger a_j^\dagger a_k a_l\rangle$ in the presence of deplorizing error? The ...
ironmanaudi's user avatar
4 votes
0 answers
51 views

Is it possible to construct a QuantumCircuit object which only shows the 5 qubits and the classical bit where I store the measurement outcome?

I have a 5-qubit circuit on Qiskit, which applies some unitary. Then I have a second circuit which basically measures whether all the qubits are 1, and it does so through a 5-CNOT on an ancilla qubit, ...
NYG's user avatar
  • 337
4 votes
0 answers
203 views

How to design a RF-SQUID qubit by Qiskit Metal?

I am now learning how to use Qiskit Metal to design superconducting circuits. I found that there are only several transmon qubits in the library. Can I design an RF-SQUID qubit by using Qiskit metal? ...
qcnewbie23's user avatar
4 votes
0 answers
91 views

Writing circuits in Qiskit using only Clifford and T gates

Is there a way in Qiskit to write my circuit using only Clifford and T gates (CX, S, H, T and I think also $S^\dagger$ and $T^\dagger$)? With the function compile (with aer simulator) it gives me some ...
stopper's user avatar
  • 393
4 votes
0 answers
212 views

Generate certain depth Clifford random circuit by qiskit

To obtain knowledge about the pattern of errors occur in quantum circuits, random Clifford circuits are a good paradigm to use in that these kind of circuits can be efficiently simulated by a ...
ironmanaudi's user avatar
4 votes
0 answers
132 views

How exactly does the QuantumCircuit.decompose() method work?

From what I can understand from the source code, the circuit is converted into a DAG before the decomposition transpiler is performed onto the DAG circuit. How does converting to a DAG circuit help us ...
sven's user avatar
  • 103
4 votes
0 answers
176 views

Extract the Crosstalk noise of a circuit in Qiskit

I'm new to Quantum Computing. How to extract the cross-talk noise of a quantum circuit using qiskit? Can someone provide an example code for this?
Raghul K's user avatar
4 votes
0 answers
89 views

What are the correct eigenvalues to use in controlled rotation in HHL?

I'm studying the HHL algorithm from the qiskit textbook, but I don't understand what $\lambda$ we have to use. If my matrix $A$ has eigenvalues that can be written in a binary representation, then, ...
Simona99's user avatar
  • 180
4 votes
0 answers
142 views

Transpiler fails after 1000 iterations

I'm transpiling a set of quantum circuits using ibmq_5_yorktown. However, as the number of circuits gets larger, it shows me the following error message: ...
ZR-'s user avatar
  • 2,378
4 votes
0 answers
220 views

Implemented QAOA returns wrong result

I try to apply QAOA algorithm to find minimal energy state of the Hamiltonian: $H_A = \frac{1}{2}\sigma_z^1 + \frac{1}{2}\sigma_z^1\sigma_z^2$ It is expected that with p=2 my variational should ...
Masamune's user avatar
4 votes
0 answers
908 views

qiskit: Traveling Salesman Problem using QAOA fails for more than 3 cities

I tried to implement the traveling salesman problem (TSP) using QAOA with qiskit. I worked with this qiskit QAOA tutorial and this qiskit minimum eigen optimizer tutorial, where they implement a TSP ...
ile2N's user avatar
  • 155
4 votes
0 answers
138 views

Form and effect of the intrinsic Hamiltonian on the IBM machines

I want to understand the form of the intrinsic Hamiltonian of the IBM machines, such as ibmq_16_melbourne, and how this affects the data I get out when waiting ...
Oscar Emil Sommer's user avatar
4 votes
0 answers
197 views

How does batching work in the optimizer loop of the VQC algorithm in Qiskit Aqua?

I've playing around with a binary classification problem with a dataset of size 1000 examples and 5 features. I'm using the VQC algorithm from the Qiskit package the that uses a feature map and a ...
Ricardo García's user avatar
4 votes
2 answers
2k views

In Grover, how to implement oracle and amplification using Qiskit?

I found some examples of implementing the oracle when the marked state is $|000\rangle$. But how can we know what gate we should use inside of the oracle? Besides, for the part implementation, the ...
peachnuts's user avatar
  • 1,373
4 votes
0 answers
328 views

Problem with measurement error mitigation using VQE

I am attempting to mitigate measurement error while running on one of IBM's real devices and am doing so by passing CompleteMeasFitter into ...
user8961's user avatar
4 votes
0 answers
102 views

`execute()` hangs and eats memory

Used memory-profiler to check why I get memory spikes in what I though were small circuits. The circuit itself is constructed using ...
Dori's user avatar
  • 141
4 votes
0 answers
525 views

Measuring Coherence Length for T1 and T2 values with IBMQ Experience

So I'm currently working on a little program to measure how long the coherence time of a qubit is. Basically the idea is to initialise a qubit with a X or H gate then stick in a varying amount of ...
thewolfaxe's user avatar
3 votes
0 answers
43 views

Updating qiskit.chemistry.core.Hamiltonian to qiskit-nature Framework

I recently saw a piece of code that computes molecular bond energy with respect to bond length. I am trying to update the code to the newer qiskit framework (I'm running qiskit 0.45.1 and ...
ScientiaNatura's user avatar
3 votes
0 answers
40 views

qiskit QAOA on Aer GPU giving errors

I am trying to run Qiskit QAOA algorithm on using aer simulator and device GPU. But I am not sure how to give this backend in the QAOA algorithm structure. Here is ...
to_batman's user avatar
3 votes
1 answer
93 views

Quantum error correction circuit from stabilizer codes

I am trying to familiarize myself with QEC codes and their use in quantum communication. Right now, I am trying to implement some more widely known codes in Qiskit. My main problem is I cannot wrap my ...
Narcano's user avatar
  • 31
3 votes
1 answer
220 views

4 qubit QFT decomposition in the qiskit textbook

I am reading about the quantum Fourier transform (QFT) in the qiskit textbook, but got stuck at the last part of it which shows a decomposed version of the 4 qubit QFT circuit. It seems that the ...
pilsungk's user avatar
3 votes
0 answers
93 views

Is it possible to convert a qudit to a qubit?

I am trying to write a Qiskit code for a algorithm which uses qudits. I want to use qubits instead because $p$ value can go pretty high. Is it mathematically possible to convert qudit to qubit for ...
videet.acharya's user avatar
3 votes
0 answers
86 views

Minimum working example for Qiskit's AdaptVQE

I am trying to implement a simple AdaptVQE in Qiskit. Following the documentation provided by Qiskit, this should be very simple: ...
NaturalLog's user avatar
3 votes
2 answers
646 views

How to choose a suitable number of iterations for Grover's algorithm?

In Nielsen and Chuang (2010), section 6.1.1. it is written: "For an N item search problem with M solutions, it turns out that we need only apply the search oracle ...
Lucas's user avatar
  • 51

1
2 3 4 5
11