# 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.

1,212 questions
Filter by
Sorted by
Tagged with
20 views

### 'Internal error. Error code 9999' when running job on IBMQ

I'm trying to run a series of circuits in a job and I keep getting this error message which I haven't been able to find the meaning of anywhere in qiskit's documentation, online, etc. The job appears ...
36 views

### What is the default coupling map for qiskit

When creating a coupling map the parameters can be left empty, but what type of coupling map does this create. In the qiskit documentation it says "By default, the generated coupling has no nodes....
53 views

### Phase Oracle in Qiskit Solving Satisfiability Problems using Grover's Algorithm Section

In Qiksit Textbook, there is a section on solving satisfiability problems using Grover's Algorithm. For the 3SAT instance they construct the following phase oracle: Is there any reasoning behind ...
20 views

### Quantum PCA in qiskit [closed]

How do I implement QPCA in Qiskit. I have a machine learning algorithm where I want to apply QPCA.
23 views

### How to construct a parameterised UCCSD ansatz?

I want to try the UCC ansatz for problems other than quantum chemistry. For that I want to 'extract' the UCC ansatz (say from Qiskit) and supply it to my own VQE: I need a parameterised circuit where ...
52 views

### Get_counts() method in qiskit [closed]

The method get_counts seems to work in both ways: get_counts() or get_counts(qc). is the argument optional here? and does it take the QuantumCircuit defined earlier in the code. URL:https://qiskit.org/...
65 views

### Replace Gate with Known Identity in Quantum Circuit

I have a quantum circuit with 3 two-qubits gates XX, YY, and ZZ (as defined in the qiskit circuit library) with arbitrary angles on each gate. I'd like to replace the YY and ZZ gates with XXs. I know ...
42 views

### How could I choose cost function in Qiskit TwoLayerQNN?

So here is the problem, I've found that in a TwoLayerQNN, the backward gradient is only to minimize the expectation of observable I've chosen. But I'm not going to minimize the predict of the input, ...
38 views

### Bell state measurement IBM circuit composer

This is my first post in this forum so it is likely that I'll make some rookie mistakes here. In the simple Bell state circuit in IBM circuit composer we measure the first qubit and for this seed we ...
29 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 ...
426 views

### Can I initialize only one qubit in a 4-qubit circuit?

I wonder if there's a way we can initialize the quantum state only for part of the qubits in a quantum circuit. Say if I have a quantum circuit defined as ...
22 views

### sample openqasm3.0 program

I am trying to get my first openqasm3.0 program and I am getting error messages that I cannot interpret. Here is my program: ...
39 views

### How does the ZZ Feature Map influence the measurement?

I've been look at this Notebook from qiskit and trying to understand whats happening, but can't quite figure it out. From my understanding, rotations around the Z ...
95 views

### Qiskit Implementation of Grover's Algorithm to search a list

Suppose I have a list of numbers from 0 to 32, that is $[0,1,2....31, 32].$ I want to find a number $n$ in this list such that it satisfies a property, say $n$ is prime. How would I translate this to ...
27 views

### source code qiskit HHL [closed]

the old one that was linked in an answer to this same question used the qiskit aqua library. since qiskit aqua is now deprecated, i was searching for the source code of the HHL algorithm that would ...
43 views

### Understanding Qiskit 0.32 's $\texttt{AmplificationProblem()}$ behaviour

This is related to my previous question. To apply amplitude amplification in Qiskit, one needs to use AmplificationProblem() or ...
32 views

### How to return phase angles as seen in IBMQ composer using qiskit?

I recently transitioned from using the IBMQ composer and am using qiskit in the IBM lab. To start, I wanted to learn how to reproduce the computational basis states, probabilities and phase angles as ...
32 views

### What is the method to create arbitrary controlled circuits in Qiskit?

I am working on an implementation of an algorithm which uses ampitude estimation and amplification as a subroutine but we are not using qiskit but QuEST. QuEST doesn't have any direct method to ...
43 views

### queueinfo() module in Qiskit

I want to know how to use queueinfo() module in IBM Qiskit. When I type job.QueueInfo(), it says "QueueInfo" is not defined. How to import it? I'm trying to use queueinfo() to know the time ...
64 views

### Setting the $\texttt{state_preparation}$ for $\texttt{AmplificationProblem()}$ in the scope of Grover's algorithm

I am having trouble setting the state_preparation parameter of AmplificationProblem() from ...
15 views

### Is it possible to set quantum volume in IBM Quantum simulator?

A quantum volume serves as a metric of a quantum processor quality. So far, IBM Quantum provides processors with quantum volume up to 128. Freely accessbile processors have QV up to 32. A user using ...
43 views

### For the circuit below, could anyone explain the results I get?

This was sent to qasm_simulator, and the results look like: It seems qasm has added classical bits but why there are gates on the right side of the line. What do they mean? Also, what does the result ...
32 views

### In "from qiskit import *" , how can I check the entire spectrum of imports available [closed]

In some codes, I have seen "from qiskit import QuantumCircuit, aer, execute". Some say "From qiskit import *". This is python related, I understand, but with respect to Quantum ...
29 views

### I am a beginner and therefore, these three H terms are confusing. "Hemitian", "Hamiltonian", and "Hilbert"

I am a beginner and therefore, these three H terms are confusing. "Hemitian", "Hamiltonian", and "Hilbert". Could someone give proper context and explain these terms . ...
51 views

### What is the difference between the two entanglement circuits?

For a three qubits system to be in an entanglement(GHZ) state, the circuit can be built as per Qiskit, Here, the control bit of the second X gate is on q0. what if the control bit is shifted to q1. ...
65 views

### What is the difference between Qiskit Terra, Aer, Ignis and Aqua?

I am going through the Qiskit tutorials and they have an article on each of the above 4. however, As a beginner, I am not very clear. Could anyone share some insights on these?
49 views

### Hamiltonian of Qiskit QFT is not hermitian

I am trying to generate the Hamiltonian of a quantum Fourier transform by taking the log of the corresponding unitary using qiskit and scipy. I don't find a hermitian matrix. Why? ...
51 views

### Coupling maps in quantum computation

Perhaps a bit naive question from my side, but I could not find any satisfactory answer elsewhere: What exactly are the coupling maps in quantum computation and, more particularly, how do those maps ...
56 views

### Qiskit - Simpler way to create a Hamiltonian

I am looking for an efficient way to create a Hamiltonian in Qiskit. Following are my desired input and outputs input: 'ZZI' output: Z^Z^I, where Z and I are operators. Here is how I am doing it ...
45 views

### Tweak the parameter p of QAOA in qiskit

I am solving a QUBO using QAOA. It works flawlessly with default parameters for smaller instances of the problem, but my RAM is saturated when I try to solve a problem of size 15. I suspect this can ...
73 views

### Reading a classical register in OPENQASM

The IBM OpenQASM program below clones a state selected from an orthogonal pair. It seems to work but there is a mystery. I declare the classical register as an array c[1] but when I try to test its ...
34 views

### Binary classification using a very simple Neural Net with Qiskit and Pennylane

I implemented a simple Neural Net with Pennylane and Qiskit for classifying two half moons: notebook for two half moons (GitHub). It works somehow (not overwhelmingly by any means): I tried running ...
52 views

### QUBO defined in Qiskit/DOcplex: how to solve it using Pennylane?

I have a complex Integer Linear Programming model defined in DOcplex/Qiskit representing a combinatorial optimization problem. Using the Qiskit utils, it is possible to covert it to either an Ising ...
48 views

### Which observable $M$ provides the Absolute Average of a statevector?

My question should be fairly simple, though I did not find an answer to it here or anywhere else. I have been working on an algorithm which, similarly to the HHL algorithm, provides a state $|x\rangle$...
30 views

### Simulating readout errors on aer simulator

I'm trying to simulate quantum experiments using a customized noise model. Here's my code: ...
15 views

### Qiskit- Building an oracle to test on Qiskit's Grover

I want to build an oracle with multiple state solutions. For example: For n=4 qubits, I want the state solutions to be 1111, 1101, 1110 and 1100. So, as you can see, in all solutions, there are two ...
19 views

### Plots of the result for the qiskit HHL tutorial

Could anyone make explicit the code which gives the two plots at the end of the HHL tutorial. They show the results of the jobs on a real IBM quantum device.
41 views

### Getting the density matrix of a noisy state in Qiskit

Currently, it seems that qiskit can only compute the density matrix for a pure state. On the other hand, for noisy state, the known way to deal with it is to do sampling, which can induce great cost. ...
252 views

### Is the SWAP gate a Clifford Gate? How would I express it using the Clifford Gate generators?

By my calculations, it looks like the SWAP gate is a Clifford Gate. See the following table: I follow the same method as in this paper for showing a gate is a Clifford Gate. I got the above table by ...
28 views

### Using opflow, CircuitStateFn and CircuitSampler, is there any way to submit the expectation values for multiple, distinct states in the same IBMQ job

I am trying to find the expectation of a Hamiltonian w.r.t different states. I am creating my states using CircuitStateFn. Then, I am using ListOp() of CircuitStateFn. But this is giving me an error - ...
58 views

### How to multiply two vectors (kets) in qiskit?

Hi does anyone know how i could write a program to get the product of something like |1>|0>|0>?
51 views

### Ground state compute issue by qiskit

I use the following code to calculate the ground state for the LiH molecule in an active space. I come across two problems. The first is I found that the Hartree Fock state gave energy that is far ...
64 views

### Evaluating the derivative of a Quantum Circuit

After this post this weekend which got an excellent response, I've been trying to get into the solution that is given by the paper and applying it to my circuit. My original circuit is far bigger and ...
45 views

### How does qiskit's CircuitQNN calculate the gradients of circuits?

I'm trying to understand how the gradients are calculated for any given circuit using qiskits CircuitQNN and ...
25 views

### Measuring with a certain probability in Qiskit

I have the following quantum operation on two qubits: $$\mathcal{E}(\rho) = p \mathcal{T} \circ \mathcal{U}(\rho) + (1-p) \mathcal{U}(\rho) ​$$ where $p$ is some probability, $\mathcal{U}$ is some ...
30 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, ...
19 views

### In the HHL algorithm, does the controlled unitary depend on the Hermitian matrix coefficients?

In HHL algorithm, does the controlled unitary (Hamiltonian simulation part of Quantum phase estimation) depend on Hermitian matrix coefficients and how?
46 views

### Create your own n-qubit quantum gate in Qiskit

I need to create the 2-qubit gates that are not supported by Qiskit (Ex: Controlled - F gate). Is there any way to create a class/object and use it as other basic gates? Example: ...