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

2,099 questions
Filter by
Sorted by
Tagged with
78 views

### SX operator and superposition

I am running some tests using the probabilities we get from statevector to assert values in qiskit. For instance, with two qubits and a hadamard gate on the first one we have: ...
1 vote
129 views

### Symmetric Universal Quantum Cloning Machine (UQCM) N --> M for unknown states

Does it exist a schematic diagram of the quantum circuit implementing the symmetric UQCM N--> M for unknown states? If yes, does anyone know a Qiskit implementation of it?
13 views

### Background job in Qiskit not showing output on .ipynb file?

I've successfully run jobs to measure circuits on Qiskit (Shor's algorithm for $N=15$ or simpler). However, it appears when I close out of everything and leave, the output of the job doesn't show in ...
1 vote
89 views

### Calculating state fidelity and space complexity of Minimum Eigen Optimizers (VQE, QAOA and Grover Optimizer) in qiskit

I'm a beginner in using Qiskit and my Computer Science background is not extensive. But I understand the Quantum Physics aspects of it relatively well. I solved a QUBO problem in Qiskit using VQE (...
42 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 ...
87 views

### CCX (Toffoli) gate calculation

I expected |110> since we do a -> a b -> b c -> ab + c (mod 2) since x 0 -> 1 and 1+1 = 0 mod 2 we get 110. Why is qiskit returning 011?
1 vote
28 views

### How does Qiskit's oracle synthesizer work?

Qiskit provides a phase oracle method that takes a Boolean formula as input and returns a phase oracle circuit for that function as output. Their source code informed me that the synthesis uses the ...
1 vote
30 views

### Why EfficientSU2 in QGAN

In Qiskit's QGAN example, the parameterised quantum circuit to be trained is the EfficientSU2. I have not found any citation there on the choice of this circuit, and the only justification is that it ...
1 vote
409 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 ...
53 views

### How to simulate a $CNOT$ only using a single qubit?

I am looking to do a $CNOT$ on itself, i.e., if the qubit is in $|0\rangle$ it stays in $|0\rangle$ and if it is in $|1\rangle$ it becomes $|0\rangle$. We are allowed to use $H$, $X$, $Z$, and $CNOT$ ...
69 views

### Calculating the Expectation Value After Mid-Circuit Measurements in Qiskit

I've been trying to implement a QML algorithm but I've run into a problem with calculating the expectation value of a certain part of the circuit after doing mid circuit measurements. I have a ...
35 views

### Qiskit Aer.backends() resulting in memory error

When I run the following python code from qiskit import Aer Aer.backends() I get this error instead of a list of backends: ...
1 vote
26 views

### MissingOptionalLibraryError: "The 'pdflatex' library is required to use 'LaTeX circuit drawing' [closed]

Trying to run the below code block in a jupyter notebook in Windows 10: ...
1 vote
56 views

### Qiskit library.gaussian() does not accept parametric expression

I'm trying to build a gaussian pulse in qiskit where I keep the amplitude as a parameter but for the followig code ...
42 views

### Visualizing Y-gate operation to achieve quantum state

In the below snippet how qc.y(1) helps to achieve the quantum state $i|10\rangle$ ? ...
258 views

### Qiskit does not interpret qasm string as 3.0?

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

### How can I simulate EPR and Bell’s inequalities in qiskit?

According to Bernard Zygelman "A First Introduction to Quantum Computing and Information", I can compute the $QS|f\rangle$ with $|f\rangle = \frac{1}{\sqrt{2}} (|00\rangle -|11\rangle)$, ...
1 vote
202 views

### Unable to perform actions on initialized states in qiskit

I have the code below which initalized a state in a quantum circuit then tries to perform some simulation. This doesn't work if I keep the initialize line uncommented, but runs just fine if I comment ...
1 vote
72 views

### Representing networks with qubits as edges

I am looking to take a classical non-negative real valued network and generalize it to the quantum case for processing. A network is given by an adjacency matrix, essentially edge weights $e_{ij}$ for ...
137 views

### Encoding classical data to quantum space

I went through the link " https://learn.qiskit.org/course/ch-applications/hybrid-quantum-classical-neural-networks-with-pytorch-and-qiskit" where a hybrid of classical and quantum ...
107 views

### Parameterized circuits and Z expectation values - Qiskit

I have a simple parameterized quantum circuit which looks like the image attached. Here is the code used to create it: ...
48 views

### How to predict output counts in ibm qiskit

In the given circuit below : ...
1 vote
37 views

### Statevector from Density matrix of non-pure state

I have a state vector of a 16 qubit system. I want to get the wave function (in the form of a state vector) for half and quarter of this system. When I try to make a ...
22 views

### How can one obtain all calibration data which is needed to plot error_map of the ibm backend from few month ago?

I want to plot the error map of an IBM Quantum backend from the calibration data I saved a month ago. The saved file just contain qubit properties and to plot error map I would need all information ...
37 views

### Visual the qubit state after amplitude encoding

I trying to visualize qubits state after amplitude encoding. I have the following code which takes the 8 feature [1/2, 1/2, 1/2, 1/2,1/2, 1/2,1/2,1/2] and encodes into 3 qubits. I now get the output [...
50 views

### How can visualise the old error map of Ibm backend if one save the calibration data of the backend at that time?

I have the calibration data of an Ibm backend and now I want to plot the error map of the device at that specific time. How can I do this?
21 views

### Step Optimize1qGatesDecomposition in qiskit transpilation

Is there a way to know what does it does qiskit in the step Optimize1qGatesDecomposition? What I can see is that each time qiskit wants to represent a rotation in ...
63 views

### How to represent two gates addition on Qiskit composer. we can do tensor product and multiplication but how to do Addition

How to represent two gates addition on Qiskit composer we can do it in python code by using qiskit library but I would like to visually see how addition of two operators look like in composer. I am ...
1 vote
50 views

### How to implement non-unitary operator in qiskit?

I am trying to make a operator for S-Box for AES. The matrix is non-unitary. When I use Operator command for declaring it as a function. It gives error, the matrix is non-unitary. Thus, the qiskit ...
23 views

### Retrive IQ Data from Fake Backend in Qiskit

Is it possible to retrieve IQ data from Fake Backends in Qiskit? I'm trying with the following code, but even by setting meas_level=1, I get only count vectors. <...
64 views

### Is it possible to get step-by-step information about qiskit transpilation?

Is it possible to get the information about the step by step transpilation? I have circuits that I know how it is more or less structured after the transpilation, but when I join them to create a ...
56 views

### Plotting the Bell state on a Bloch sphere

How can you plot the bell state on a Bloch sphere? bell = QuantumCircuit(2) bell.h(0) bell.x(1) bell.cx(0,1) Is there any good reference for understanding how ...
111 views

### How to get information about 'qubit location' or 'variable of qubit location' in qiskit docs?

I have something problem with using qiskit. I searched several qiskit docs to get 'qubit location' or 'variables' that represent qubit. I searched three documents below. ...
1 vote
53 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 ...
104 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
188 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 ...
32 views

### Given a COMPLEX unitary matrix, how can I construct a unitary gate in Qiskit?

It seems that it is fairly easy to construct a unitary gate given a real unitary matrix. However, I have tried several methods with a complex unitary matrix, but they all seem to be not working. How ...
42 views

### Half Adder using CNOT Gates

As per this schematic of qubits, how this explanation is correct --"If you look again at the four possible sums, you’ll notice that there is only one case for which this is 1 instead of 0: 1+1=10....
122 views

### Trouble re-creating quantum psuedo-telepathy

I am trying to replicate the results from this webpage here utilizing qiskit: http://twistedoakstudios.com/blog/Post6536_implementing-quantum-pseudo-telepathy Since the splitter gate mentioned in the ...
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 ...
17 views

### Optimizing Selection of the Optimal Qubit in a 30-Qubit Quantum Circuit

I am working with a quantum circuit consisting of 30 qubits, and for each qubit, I have allocated a dedicated classical register to record individual measurement results. When I execute this circuit ...
25 views

### Running multiple amplitude estimations simulations

I am working on a mini project investigating the scalability of quantum computing in the context of option pricing. I have been following the above Finance API from Qiskit as an introduction, however, ...
359 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 ...
38 views

### Converting Ising Hamiltonian to a Circuit in Qiskit

I tried to solve a 2-node TSP (travelling salesman problem) by implementing QAOA on Qiskit. The graph looks like: Then I used the related Qiskit functions to convert the graph to the QUBO and map it ...
119 views

### How to perform the measurements on a quantum circuit in W state basis?

I need to perform the measurements on a quantum circuit in the basis $\{ \eta^\pm,\zeta^\pm \}$. Where $\eta^\pm,\zeta^\pm$ are given as follows: \eta^\pm = \frac{1}{2}|001\rangle + \frac{1}{2}|...
165 views

### How to get the matrix of a quantum circuit when the ancilla qubit is set to a specific state?

I would like to get the matrix form of a quantum circuit, representing the operation on normal qubits, after specifying the ancilla qubit at a given state. Is there any way to realize this using ...
1 vote
32 views

### Building a problem unitary circuit for QAOA on Qiskit

I am trying to build a circuit for QAOA that solves a Traveling Salesman's Problem, which can be represented as a complete graph with 4 nodes. After formulating the problem as a QUBO and mapping it ...
108 views

### ImportError qiskit_ibm_runtime

When I try to import qiskit_ibm_runtime I get the following error: ...
1 vote