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.

213 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
1answer
154 views

API error when trying to access IBM Quantum Computer using IBMQ API Token

I'm trying to write a code so that if the token exists then it loads the account or else it asks the user for the API token. Below is the code for reference: ...
2
votes
0answers
76 views

Calculating energy function with 1&2-RDM (reduced density matrix) in Qiskit

I am now working on designing quantum error mitigation with variational quantum eigensolvers (VQE). I need to get the 1&2-RDM from Qiskit, which has already been realized by Openchemist pakages ...
2
votes
0answers
65 views

Getting Choi-matrix of a subsystem

In Qiskit, for a given QuantumCircuit object, you can compute its Choi-matrix via the corresponding Choi object, for example: <...
2
votes
0answers
84 views

HHL example solution on Qiskit

In the example on the Qiskit page (https://qiskit.org/textbook/ch-applications/hhl_tutorial.html#A.-Some-mathematical-background) section 3 for the HHL algorithm the author is trying to solve the ...
2
votes
1answer
217 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. ...
2
votes
1answer
243 views

Qiskit BasicAer & Aer

While I'm simulating grover's algorithm, I found that with BasicAer backend it works well but with Aer it is not. What is the difference between ...
2
votes
1answer
90 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 ...
2
votes
0answers
69 views

Deriving Expression For QAOA Optimal Trial State Parameters

I am going through the QAOA section in the Qiskit Textbook - QAOA and am stuck in one of the steps. In section 5.2, the method for getting the Optimal Trial State Parameters are discussed. I do not ...
2
votes
1answer
64 views

Qiskit IBMQ.load_account fails on version 0.20.0

So when trying to load my account I get this error: ...
2
votes
0answers
69 views

What is the maximum circuit depth for Qiskit Aer Simulator?

I'm running some simulator circuit on my computer, and I see that (using 3 qubits, and thousands of classical registers), the max cap seems to be about qc.depth() ...
2
votes
0answers
69 views

What is the buffer time between gates of the ibmq_essex in nanoseconds?

This is a question that I asked on Qiskit ignis section of slack, with a very interesting answer by A Kapila, but I also need to get a short answer in nanoseconds. I want to evaluate decoherence in ...
2
votes
0answers
73 views

QFT on timeseries Data and compare results with classical FFT

Intention - To learn and apply QFT on time-series data and compare the result with classical FFT. Data Used - Small timeseries data of 16 points - ...
2
votes
0answers
57 views

IBMQJob.result() returns KeyError: 'qObjectResult'

I'm running tomography job like I have done many times before. I send the job, and the job.status() is 'DONE'. But when I ask for ...
2
votes
2answers
131 views

qiskit: IQFT acting on subsystem of reversed-ordered qubits state

I have a state psi as an ndarray of shape (2 ** 3,) s.t. psi[0]= amplitude of 000 ...
2
votes
0answers
44 views

How to simulate spin-1 systems with qiskit or on the IBMQ platform?

I am wondering how to simulate spin-1 systems with qiskit or on the IBMQ platform? I want to initialize a qudit (a spin-1 system), and then define the usual operations (such as Sx, Sy, and Sz) on the ...
2
votes
0answers
500 views

Decomposition of an arbitrary gate using given matrix in Qiskit

If I have an arbitrary non-unitary matrix of say $$ U = \begin{pmatrix} 1.5 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1.6 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ \end{...
2
votes
0answers
273 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 ...
2
votes
3answers
183 views

Pauli I in eoh procedure doesn't become a global phase gate in qiskit evolution_instruction method. Possible consequences

If one has two qubits in arbitrary stats and wishes to apply a controlled version of some global phase gate $P(\varphi) = \begin{pmatrix} e^{i\varphi} & 0 \\ 0 & e^{i\varphi} \end{pmatrix}$ ...
2
votes
0answers
65 views

OpenPulse: Where to get current pulse definitions for standard gates?

Is backend.defaults().cmd_def and backend.defaults().pulse_library kept updated regularly? Is this the correct place to pull the best calibrated pulses for the standard gates? I am working on a ...
2
votes
0answers
113 views

Is it possible to simulate or replicate a cryptographic algorithm using Qiskit?

I would like to know if it is possible to recreate or simulate a cryptographic encryption algorithm like DES or AES using the quantum computing platform Qiskit from IBM?
2
votes
0answers
132 views

Running HHL tutorial on real backend

I tried to follow the HHL tutorial. Since the 8x8 problem is not realistically simulable (I stopped after a few minutes), I tried to make it run on another backend, starting on the easiest example: <...
2
votes
0answers
163 views

Error ERROR_TRANSPILING_JOB when trying to simulate the circuit

I'm trying to implement an algorithm (https://dl.acm.org/citation.cfm?id=1128034, basically a simple Grover Algorithm in which the oracle is made of a Fitness operator- some CNOT gates- and 2 adders) ...
2
votes
0answers
276 views

Why does Qiskit swap gate accept registers, but cswap doesn't?

In Qiskit, I am trying to perform controlled-Swap (cswap) of two registers, but an error occurs: ...
2
votes
0answers
53 views

Hybrid classical-quantum linear solver based on the Neumann-Ulam method

I read this article on quantum linear solver based on the Neumann-Ulam method (here is a lesson about it). But the article has not a lot of details. Therefore I don't understand what is the algorithm ...
2
votes
0answers
980 views

How to run quantum SVM algorithm from Qiskit in real IBM Quantum Computer using IBMQ?

I'm trying to run QSVM algorithm in IBMQ experience, want to run in one of those real quantum computers. ...
1
vote
0answers
19 views

Solving Particle in Box problem using Qiskit

I am new to quantum computing, I would like to ask how can I solve simple particle in box problem using qiskit which allows to compute the bound states in finite quantum well. Finite quantum well
1
vote
1answer
20 views

Difference between Aer.get_backend('aer_simulator') and AerSimulator()

In Qiskit, there are several ways to choose simulator: one is from qiskit import Aer backend = Aer.get_backend('aer_simulator') result = backend.run(circ).result() ...
1
vote
0answers
23 views

Adding trainable weights to feature inputs for a CircuitQNN?

Currently I'm trying to get together a QNN that can be trained to classify the normalized (-1, 1) IRIS Dataset on all 3 classes. For this I am using Qiskit's ...
1
vote
1answer
35 views

unsymmetric observable estimation by Qiskit

Assume $|i\rangle,i\in[1,m]$ is a set of state, 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 qubit ...
1
vote
0answers
37 views

Qiskit's classifier is not optimising the weights

I am using qiskit's VQC to build a classifier. Dimensionality of the data is 2 and number of classes are 4. The feature map I used is ZZFeatureMap and ansatz is the RealAplitudes. Then entanglement ...
1
vote
1answer
36 views

How to write a code to made envelope function equal to $\pi$ to result in an X gate?

$$ \hat U_d = \exp\Big( -i\underbrace{\frac{Q}{2}\int_0^T A(t^\prime)\mathop{dt^\prime}}_{\Theta(t)} \hat\sigma_x \Big) $$ This equation is a Unitary transformation applied to a qubit from time $t = 0$...
1
vote
0answers
51 views

Working with higher energy states in Qiskit Experiments

I'm looking at the source code for the Qiskit Experiments module and see that the EFRabi class subclasses the Rabi class with the intent of calibrating rotations between the 1 and 2 states instead of ...
1
vote
0answers
25 views

from hello_qiskit import run_puzzle results in error

I am working my way through the beta version of the Qiskit textbook. Everything was going fine until I got to the Visualizing Entanglement section and had some exercises to complete. All of the ...
1
vote
1answer
24 views

Qiskit noise model question (from textbook)

I'm reading the chapter Introduction to Quantum Error Correction using Repetition Codes and a code example demonstrates how to add depolarizing and pauli error. I have several questions. Is it not ...
1
vote
1answer
59 views

How to apply gates based on a random decision on the IBM quantum computer?

I want to run a circuit on an IBM quantum computer, and this circuit involves gates that are either applied or not based on a (classical) random decision. As a minimal example, imagine a circuit with ...
1
vote
0answers
35 views

Callback in VQC does not return correct float value for objective function evaluation

The callback for the VQC class is defined as: callback (Optional[Callable[[ndarray, float], None]]) – a reference to a user’s callback function that has two ...
1
vote
0answers
25 views

What is the input for the interpret of Quantum Variational Regressors?

I'm trying to implement my first variational regressor using qiskit. I would like to understand how the interpret of a CircuitQNN works. I need to define an interpret that works on the amplitudes of a ...
1
vote
1answer
61 views

Qiskit: How did they use Haar measure in random_statevector?

I have read this article to understand sampling state vectors from Haar measure: Understanding the Haar Measure. Qiskit uses Haar measure to sample state vectors, but when I looked at the source code ...
1
vote
0answers
22 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 ...
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. ...
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 ...
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
0answers
76 views

Qiskit Portfolio Optimization

After running this code: I have an error: ...
1
vote
0answers
52 views

Applying a projector or a general nonunitary gate in the middle of a circuit using qiskit

Is there a way to implement a projector gate in a middle of a circuit?. For instance, assuming I have a Bell state $|00\rangle+|11\rangle$, I'd like to apply a projector on the first qubit onto state $...
1
vote
0answers
40 views

Transform Fermionic operators to quantum circuit in qiskit

I am trying to realize a modified version of the UCCSD algorithm, which consists of combining multiple fermionic opeators to form a unitary tranformation U to act ...
1
vote
0answers
56 views

Thoughts in coding large and repetitive/non-repetitive quantum circuits?

Just out of curiosity, are there advances or directions on how to write a program (e.g. in qiskit) for a large number of qubits? Assuming that the number of gates ...
1
vote
0answers
35 views

How do you verify the output of an X Gate within the Pulse gates framework?

I have found out how to create an X gate for a constant pulse within the Pulse gates framework found on this link: https://qiskit.org/documentation/tutorials/circuits_advanced/05_pulse_gates.html My ...
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
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 ...
1
vote
1answer
57 views

how can we save a model using qiskit_machine_learning?

How can we save a trained model using Qiskit Machine Learning library? I've built a VQC classification model and once finished, I'd like to save the different models to be loaded later. There is a <...