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
2answers
88 views

Random 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 ...
2
votes
1answer
96 views

Measuring tensor products of Pauli operators

Is there a neat way to derive and efficiently implement a measurement circuit for tensor products of arbitrary Pauli operators like $XZZXZ$ in Qiskit ? I tried using the ...
1
vote
0answers
57 views

What is the right way to teleport qubits on a real quantum computer?

I've been using the teleportation protocol to teleport qubits and then using Qiskit state tomography for reconstructing my qubits. Using this circuit using open qasm I regularly obtain fidelity 0.9. ...
2
votes
0answers
34 views

Save output, wavefunction file and orbital information in Qiskit

I am going through LiH ground state energy calculation. I would like to know how to save the output file in Qiskit as one would do in classical computing using software like Gaussian or Psi4. Also, ...
3
votes
1answer
556 views

How to calculate state fidelity in Qiskit?

I have a circuit with different structures, now I'm trying to calculate the fidelity between those with the original one. How do I calculate the fidelity? I want also to initialize the state vector by ...
1
vote
1answer
51 views

Get the probability amplitudes of the 0 and 1 states of a single qubit in Qiskit considering a system of multiple qubits

I am looking for a method to get the values of $\alpha$ and $\beta$ probability amplitudes of each single qubit in a multiple qubit system. Is that possible? As you can see in the image, I have a 4-...
1
vote
1answer
99 views

Return only the measurements of a circuit

I have written the following program in jupyter: ...
0
votes
1answer
31 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 ...
0
votes
1answer
172 views
2
votes
1answer
100 views

HHL - the result is correct for one matrix but wrong for another one

I tried to run HHL algorithm in new version of Qiskit (0.29). Firstly I tried to solve a diagonal system 4x4 with matrix [[1,0,0,0],[0,2,0,0],[0,0,3,0],[0,0,0,4]] ...
3
votes
2answers
39 views

Normalization question in VQLS

I was studying VQLS in https://qiskit.org/textbook/ch-paper-implementations/vqls.html and run into the following normalization during the cost calculation. It says if $ |\Phi\rangle$ has a small norm....
2
votes
3answers
439 views

Are these two circuits equivalent in performing controlled time-evolution?

I want to perform the controlled time-evolution of some 2 or 3-qubit Hamiltonian. Say we have this example: $$ H= Z_0\otimes Z_1 + Z_1\otimes Z_2 $$ The circuit performing the time-evolution ...
2
votes
1answer
137 views

Finding Eigen Values from Quantum Phase Estimation - Using qiskit

I am trying to use the quantum phase estimation(EigsQPE) of qiskit to find the eigen values of a matrix. As I am new to quantum computing so I am confused what to measure in the circuit to derive the ...
2
votes
1answer
68 views

Quantum state inconsistency between book and IBM quantum composer

$ \newcommand{\ket}[1]{|#1\rangle} \newcommand{\tens}[1]{% \mathbin{\mathop{\otimes}\limits_{#1}} }$I'm trying to self-learn quantum information basics by reading Dancing with Qubits by Robert Sutor....
2
votes
1answer
104 views

How to formulate Dynamical Decoupling passes in Qiskit to improve result upon circuit execution

First, let me say that I am not familiar with the idea of Dynamical Decoupling. The goal of this question is to understand how to set up a circuit with dynamical decoupling to improve my hardware ...
2
votes
1answer
120 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 ...
0
votes
1answer
47 views

Pad get_counts() with zeros for unmeasured states? (Qiskit)

After executing a job on qiskit, the typically procedure to get the measurement data from the quantum computer is to call get_counts() like so... ...
0
votes
1answer
41 views

How to execute a qiskit circuit from strangeworks hub? [closed]

I would like to execute a circuit in the strangeworks hub on IBM's "ibm_nairobi" system. Could someone just please send me a general layout of execute and provide a command for stangeworks ...
3
votes
1answer
52 views

How to obtain control and drift Hamiltonians for device in Qiskit?

I would like to play around with Qiskit OpenPulse and the publicly available IBMQ quantum computer that supports OpenPulse. My humble goal is to use Qutip's optimal control libraries to get a pulse ...
2
votes
1answer
30 views

Different statevectors with different quantity of complex numbers for same single-qubit states in Qiskit

I have several questions, but before ask, I want to write some theoretical. As we know, we can represent any single-qubit quantum state by the next representation: $$ |\psi\rangle=c_0|0\rangle+c_1|1\...
4
votes
2answers
195 views

Cannot get a provider from IBMQ

My code is: from qiskit import IBMQ IBMQ.load_account() provider = IBMQ.get_provider('ibm-q') qcomp = provider.get_backend('ibmq_16_melbourne') but ...
0
votes
0answers
53 views

Import error to do with tweedledum

I am on MacOS 10.14.6. Installed Python3.9, create env with venv and installed qiskit. When I import qiskit, I get the ImportError, see below: ...
2
votes
1answer
29 views

Why can two target superconducting processors with the same layout get different transpilation results?

I compile and run the same small Grover circuit for 6 different processors. ibmq_santago, manila and bogota all have a linear layout, while quito, belem and lima have qubits arranged in a T-shape. I ...
1
vote
0answers
25 views

How to measure the error rate (or fidelity) of a particular gate (such a H, T) by Qiskit

We know the calibration data of IBM's quantum devices can be retrieved through the randomized benchmarking method, which is included in Qiskit. However, the calibaration data about gates just gives ...
3
votes
1answer
120 views

Molecular orbitals in Qiskit

During the same minute as asking this question, I also asked this at Matter Modeling SE. In Qiskit, each qubit corrrespond to one spin orbital. For example, the $\text{N}_2$ molecule have 10 molecular ...
3
votes
1answer
158 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 ...
2
votes
0answers
57 views

How can I add custom pulse gate to the Qiskit circuit?

I tried to make my pulse and get the pulse into the circuit. But it seems not working properly. The code and the result are below. Just change the 'x' to the 'h' (hadamard) with the same piecewise ...
0
votes
0answers
29 views

Quantum check sample implementation

I've been trying to figure out how to create a simple circuit in Qiskit to create a check (cheque ) generation and verification as described in this paper. I started with 3 qubits, first one with the ...
2
votes
1answer
199 views

Grover's algorithm for the real problem of finding the index of an array element

Good day. I am interested in an IMPLEMENTED, not theoretical, example of code for solving the problem of finding the INDEX of an element in an uncorrected array using Grover's Algorithm. The task ...
1
vote
1answer
111 views

How to design Multi qubit Controlled Z rotations

I need some help in multi-qubit controlled -Z rotation. Below is the qiskit code of triple controlled z rotation ...
0
votes
1answer
84 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. ...
0
votes
1answer
41 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?
0
votes
1answer
42 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 ...
1
vote
0answers
53 views

How do I find the qubit trajectory on the Bloch sphere when implementing an RY rotation on an IBM backend?

Suppose I use Qiskit to prepare the $| + \rangle$ state using a RY rotation, ...
1
vote
1answer
72 views

Simulating OpenQASM 2.0 in Qiskit?

I'm just getting started with OpenQASM, but I'm feeling a bit confused. Is there a way to run the .qasm file I've written in Qiskit (i.e. in Python), or is OpenQasm ...
0
votes
1answer
119 views

Qiskit not finding CPLEX

I'm trying to use the CPLEX library alongside Qiskit but keep getting the error. ...
0
votes
1answer
164 views

Parallel shots on Qiskit

I am running variational algorithms using QuasmSimulator, which means I am performing a classical optimization where the cost function is computed running a quantum circuit. Moreover, for the ...
1
vote
1answer
62 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?
16
votes
1answer
4k views

What is a "barrier" in Qiskit circuits?

I just started studying IBM Qiskit, and cannot find details about the barrier method on the QuantumCircuit class. It is shown in the circuit drawing, but I never heard about it after reading quantum ...
1
vote
1answer
113 views

Can someone explain using H and T gates repeatedly?

The Qiskit textbook says it is used because $R_x$, $R_y$, and $R_z$ are not accurate single qubit rotations. Can someone elaborate what the repeated $H$ and $T$ gates actually do? In what scenario ...
5
votes
1answer
134 views

Qiskit - Circuit drawing aesthetics - Can I force the measurements in my circuit to show at the end?

I'm studying an introduction course to quantum computation at my uni and we got homework to draw a certain circuit using qiskit. I managed to understand how to do what is asked from me, and this is ...
1
vote
0answers
76 views

Qiskit Portfolio Optimization

After running this code: I have an error: ...
6
votes
0answers
79 views

AWS Braket Backend for Qiskit?

Is there a working AWS Braket backend provider for Qiskit 0.29 that can be used with the MinimumEigenOptimizer interface? The qiskit-aws-braket-provider package is unfortunately not working.
1
vote
1answer
55 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
6answers
2k views

Installing qiskit with `pip install qiskit` gives `ERROR: Command errored out with exit status 1`

I have created a virtual environment by virtualenv (not conda) and tried to install qiskit by: ...
1
vote
2answers
142 views

Question on qiskit.circuit.library.PiecewiseChebyshev Qiskit circuit library

This question follows the post https://quantumcomputing.stackexchange.com/posts/15070/. I am working on an implementation of HHL algorithm, to do so, I need to map $|\lambda\rangle\mapsto |\arcsin(\...
8
votes
1answer
655 views

What is the relationship between Choi and Chi matrix in Qiskit?

I'm struggling with the framework for quantum process tomography on Qiskit. The final step of such a framework is running fit method of ...
3
votes
1answer
56 views

How can I prepare and measure spins in arbitrary directions in qiskit?

I'm just starting with Qiskit and I would like to reproduce basic results about spin measurements. For that I want to prepare multiple spins each in arbitrary directions and measure them in arbitrary ...
2
votes
0answers
84 views

Applying projectors with mid-circuit measurements

I am trying to apply a non-unitary projector (see image) to my two-qubit quantum circuit using mid-circuit measurements. $$ \begin{pmatrix} 0 & 0 & 0 & 0 \ 0 & 1 & 0 & 0 \ 0 &...
0
votes
1answer
62 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 2
3
4 5
24