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.

375 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
1 answer
110 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,...
  • 71
6 votes
1 answer
358 views

How can I run a VQE on one of IBMQ's Quantum Computers

I have implemented a VQE based on Qiskit's VQE function and want to run that on an actual quantum computer. My understanding was, that an IBMQ backend can be passed into the function as a Quantum ...
  • 61
5 votes
0 answers
161 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 ...
5 votes
1 answer
458 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 ...
  • 131
5 votes
0 answers
129 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 ...
  • 880
5 votes
0 answers
119 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 ...
5 votes
0 answers
144 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 ...
  • 83
5 votes
0 answers
130 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 $\...
  • 133
4 votes
0 answers
107 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 ...
  • 116
4 votes
0 answers
45 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.
4 votes
0 answers
122 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 ...
4 votes
0 answers
106 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?
4 votes
1 answer
413 views

Simulation of a helium molecule using Qskit

I am trying to compute the ground state energy of He-He using VQE. For this purpose I have utilized Qskit and have written the following script: ...
4 votes
0 answers
116 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 ...
4 votes
0 answers
164 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 ...
4 votes
2 answers
1k 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 ...
  • 1,303
4 votes
0 answers
300 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 ...
4 votes
0 answers
100 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 ...
  • 141
4 votes
0 answers
485 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 ...
3 votes
0 answers
23 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. ...
3 votes
1 answer
50 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?
  • 31
3 votes
0 answers
87 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 ...
  • 839
3 votes
0 answers
72 views

Is there a tutorial for error mitigation in qiskit that does not use the deprecated ignis?

Working through the qiskit text I have come accross measurement error mitigation a few times (Measurement Error Mitigation, Lab 3: Quantum Measurment,...]. In the online textbook the coding indicates ...
  • 428
3 votes
0 answers
25 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 ...
3 votes
1 answer
93 views

Qiskit Runtime: What are the units of job.result().time_taken? Seconds, milli-seconds, micro-seconds?

job = execute(qwalk_circuit, backend='ibmq_16_melbourne', shots=1000) results = job.result() time = job.result().time_taken What are the units of time? And where ...
3 votes
0 answers
61 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 ...
  • 131
3 votes
0 answers
56 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 ...
3 votes
0 answers
83 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. ...
3 votes
1 answer
216 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 ...
  • 2,298
3 votes
0 answers
48 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 ...
3 votes
1 answer
83 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
  • 500
3 votes
0 answers
62 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 ...
3 votes
0 answers
39 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, ...
3 votes
1 answer
78 views

unsymmetric observable estimation by Qiskit

Assume $|i\rangle,i\in[1,m]$ is a set of states, like the Fock states for Fermions. The question is how to compute the quantity,$\langle i |H|j\rangle,i,j\in[1,m]$, in qiskit. The $H$ here is the ...
3 votes
1 answer
113 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? ...
3 votes
0 answers
77 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 ...
  • 363
3 votes
0 answers
135 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 ...
3 votes
0 answers
95 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 ...
  • 83
3 votes
0 answers
66 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, ...
  • 118
3 votes
1 answer
206 views

How to solve TSP problem with more than 3 nodes in the tutorial of Max-Cut and Traveling Salesman Problem?

I had to try the example of qiskit’s Traveling Salesman Problem with 3 nodes and executing it at IBM backend called simulator_statevector.Can execute and get the result normally. But when trying to ...
  • 31
3 votes
1 answer
254 views

How fast is qiskit to_gate() method, which is used to convert circuit to gate?

I have prepared a quantum circuit, which is using 13 qubits. Now, I am converting this circuit to gate but it is taking around avg. 35s for conversion. It would have have been fine, if I require only ...
3 votes
0 answers
116 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: ...
  • 2,298
3 votes
0 answers
182 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 ...
3 votes
1 answer
163 views

What are the possible gates that I can use to vary input states before CNOT?

We know that the noise of the $\text{CNOT}$ gate varies depending on the input state before it. What are the gates that I can put in the place of the 4 identity gates above to change the input state ...
  • 79
3 votes
0 answers
740 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 ...
  • 145
3 votes
1 answer
600 views

ImportError when setting up PySCF driver

I have a problem when attempting to set up a PySCF driver for a hydrogen molecule from the QISKIT Chemistry tutorial: https://qiskit.org/documentation/tutorials/chemistry/01_electronic_structure.html. ...
  • 61
3 votes
1 answer
170 views

What is the convention of indices for the one and two-body integrals in qiskit

I was able to calculate the one and two-body integrals for the H2 with the following code ...
  • 880
3 votes
1 answer
271 views

VQE jobs do not appear in queue

I am trying to calculate the ground state energy of some simple molecules using 'MolecularGroundStateEnergy' tools in qiskit. When I run the calculations for very small molecules (e.g. H2, HeH+) the ...
  • 57
3 votes
0 answers
411 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 ...
3 votes
0 answers
152 views

Grover's algorithm for 3SAT problem gives erroneous results

I'm writing some code in python with Qiskit that implements Grover's algorithm to solve the 3-SAT problem, but when I run it it doesn't give the correct annswer. I've checked the circuit with the <...

1
2 3 4 5
8