Questions tagged [qiskit]

Quantum Software Development Kit for writing quantum computing experiments, programs, and applications. If appropriate, also use the [programming] tag.

Filter by
Sorted by
Tagged with
3
votes
2answers
78 views

Implementing Grover's oracle with multiple solutions in Qiskit

I want to turn a state $$ |\Psi_1⟩ = \frac{1}{\sqrt{8}}(|000⟩+|001⟩+|010⟩+|011⟩+|100⟩+|101⟩+|110⟩+|111⟩) $$ into $$ |\Psi_2⟩ = \frac{1}{\sqrt{8}}(|000⟩+|001⟩+|010⟩+|011⟩+|100⟩-|101⟩-|110⟩+|111⟩) $$ ...
0
votes
1answer
177 views

Is it possible to express $U_1(\lambda)$ through the gates $R_x, R_y, R_z$ while maintaining the phase? In Qiskit for example

Is it possible to express gate $U_1(\lambda)$ through the gates $R_x, R_y, R_z$ while maintaining the phase? Both in principle and in practice (in Qiskit for example)? The single gate $R_z(\lambda)$ ...
0
votes
0answers
19 views

How can I represent Pauli Measurements in Qiskit's QuantumCircuit object?

Is there a way to represent measurements in other bases in Qiskit? The default measurement is in the Z (computational) basis. Can I also depict measurement in X, Y and general Pauli Measurements? I ...
1
vote
1answer
84 views

Why do the qasm_simulator runtimes vary significantly for different IBMQ CouplingMap/NoiseModels?

I have been running VQE experiments locally using the qasm_simulator with actual IBMQBackend NoiseModels as shown in the Qiskit Textbook. I have noticed that the ...
4
votes
1answer
218 views

Use Qiskit in other programming languages (C#, JavaScript and Lua)

I am exploring using Qiskit in other programming languages for game development, such as C# (for Unity game engine), JavaScript (Phaser.io) and Lua (LÖVE2D). Is there a general way to call Qiskit ...
0
votes
2answers
120 views

Does anyone know how to get a list of all the Qiskit ML datasets, and if they can also be used for classical machine learning?

I am trying to create a Quantum Classifier and would like to try to test it out using a Qiskit ML dataset. However, I only know of the breast cancer dataset and I would like to try it on another ...
1
vote
0answers
26 views

Why does the Qiskit tutorial for the Variational Quantum Linear Solver not work properly?

I am following this very nice qiskit tutorial on how to implement a simple variational quantum linear solver (VQLS). There are 3 examples implemented in the tutorial all of which are solving the $Ax=b$...
1
vote
1answer
39 views

Error while running Qiskit code on real quantum computer

I was trying to run this code on a quantum computer but I was getting an error can anyone suggest how to resolve this error? ...
0
votes
1answer
42 views

Need some help with simulating molecules with VQE

I have studied the example of the simulation of LiH molecule in Learning Quantum Computation using Qiskit. It is available on this link: https://qiskit.org/textbook/ch-applications/vqe-molecules.html#...
3
votes
1answer
54 views

Statevector Simulation of QAOA always finds exact solution

My question is simple: does applying QAOA with a statevector simulation always result in a perfect solution? I'm trying to calculate the best $\gamma$ & $\beta$ that solve certain problems but my ...
2
votes
1answer
39 views

How to make a half adder for x number of qubits with min. cost?

How to make a half adder for N inputs and getting the output on another x+1 output. Where x ...
1
vote
2answers
154 views

Can I run Cirq on IBMQ?

Google's quantum computer is not yet available for the public. Is it possible to run Cirq on IBM's quantum computers, instead of Qiskit? And if so, how can I do it? Thank you!
0
votes
2answers
44 views

What are the libararies for Machine Learning on NISQ Chip? And What are the roadmaps?

Nowadays quantum learning is hiring. And we can see mainly two different area. One of them is variational algorithms part. And the other one is classical learning for quantum systems like NISQ. (Some ...
2
votes
1answer
56 views

Can I keep data into qubit and teleport?

I was reading about teleportation I have some question about it. Can I keep normalized data (some customized data) on probability amplitudes (which are complex numbers) of a qubit (Alice's side)? ...
15
votes
6answers
5k views

How do I build a gate from a matrix on Qiskit?

I'm creating a gate for a project and need to test if it has the same results as the original circuit in a simulator, how do I build this gate on Qiskit? It's a 3 qubit gate, 8x8 matrix: $$ \frac{1}{...
0
votes
3answers
33 views

Quantum Error Correction implementation in Qiskit, OpenQASM or other languages based on Python

Where can we find example(s) of implementation code in a programming language of Quantum Error Correction, whether with the standard method of measurement or the automatic method without measurement (...
1
vote
1answer
34 views

Can I see Probability in complex form after measuring the state of the qubit on quantum computer?

Let's say I have a qubit $$\left| \psi \right> = (\alpha_1 + i\alpha_2 ) \left|0\right> + (\beta_1 + i\beta_2 )\left|1\right>$$ so when we measure it will calculate $|\alpha_1 + i\alpha_2|^2$...
0
votes
1answer
28 views

Textbook 2.5 (Qiskit) - Unitary and Hermitian matrices

In section 2.5 of the Qiskit textbook, it states that $X$, $Y$, $Z$ and $H$ are examples of unitary Hermitian matrices. As I understand it, this means that the following rule applies: $$UU^\dagger=U^\...
1
vote
1answer
88 views

from qiskit.aqua import… ImportError: DLL load failed: The specified module could not be found

Dear team and developers. I am using qiskit on Python 36, windows 64bits I have the same identical problem of Import from qiskit-aqua error But the suggested solution (installing Numpy+mkl, I did ...
0
votes
1answer
46 views

How do I get sate vector for each shot running on a quantum computer?

I was running this code on a quantum computer how can I generate a state vector for each shot while running on a quantum computer? qikit code ...
3
votes
1answer
71 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: ...
2
votes
0answers
23 views

QISKit not installing in PyCharm

I am attempting to setup a PyCharm project to study and work through the QISKit textbook. However I seem to be running into a propblem seting it up. I have setup a python enviroment via anaconda (...
3
votes
1answer
78 views

How do I Initiate with my own alpha and beta values instead of starting form qubit in state zero in IBM Q?

Let's say I have normalized values of $\alpha$ and $\beta$ as $\alpha =(0.27524094128159016+0.8257228238447705j)$ $\beta =(-0.22019275302527214+0.4403855060505443j)$ How do I initialize my circuit ...
1
vote
1answer
29 views

How can we code a ccz (control control z, equivalent of Toffoli on Z and not on X) gate in Qiskit language?

How can we code in Qiskit, a ccz gate ? In python (in https://qiskit.org/textbook/ch-algorithms/grover.html), we see three instructions : qc.h(nqubits-1) qc.mct(list(range(nqubits-1)), nqubits-1) # ...
2
votes
3answers
163 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}$ ...
0
votes
1answer
122 views

How to obtain the density matrix using tomography in the real device?

I am trying to run the QFT algorithm for n=5 (n number of qubits). The number of experiments that it generates is bigger than the one allowed by the IBM devices (i.e. 75). Therefore, I have tried to ...
0
votes
1answer
73 views

How to get running time for each circuit executed on IBM's quantum processors in one round?

I want to execute multiple circuits in one round on IBM's backends, especially the 16-qubit one, to save time. For instance, ...
0
votes
1answer
25 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?
0
votes
1answer
42 views

Why is the local qasm_simulator significantly slower than the statevector_simulator?

I've been running VQE experiments locally using both the statevector_simulator and qasm_simulator, however I've noticed that the ...
2
votes
1answer
58 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
1answer
44 views

Is it better to initialize quantum circuits in Qiskit by passing QuantumRegister and ClassicalRegister objects?

From the perspective of building quantum computation software based on Qiskit, which approach to defining quantum circuits is more robust? ...
2
votes
2answers
83 views

How can I convert exponentials of pauli matrices to circuits of this form in Qiskit?

For example the following circuit is for $e^{-i(Z\otimes Z\otimes Z)\Delta t} $ I know this can even be done without the ancilla qubit, having the CNOTs control the last qubit and applying an RZ on ...
3
votes
1answer
143 views

How can we construct a control-control y-rotation (CCRy) gate in Qiskit?

Qiskit has a CRy gate, however I couldn't find a CCRy (double control Ry) gate implementation. How can we construct the CCRy circuit given below in Qiskit without any ancillary qubits? Edit: A quick ...
1
vote
0answers
33 views

Qiskit: is there a quick way to work out the spherical coordinates for a given qubit statevector?

I am trying to calculate the spherical coordinates of different qubit states (i.e. working out $\theta$ and $\phi$ from: $|\psi\rangle = e^{-i\phi/2}\cos(\theta/2)|0\rangle + e^{i\phi/2}\sin(\theta/2)|...
2
votes
1answer
40 views

Qiskit: how can you use a different state for each shot in a quantum circuit? [duplicate]

I am trying to run a quantum circuit many times, each time using a different random state - a single qubit i.e. $|\psi\rangle= a|0\rangle + b|1\rangle$ with different $a$ and $b$. Once each qubit has ...
1
vote
1answer
84 views

How can I find the fidelity of preparation?

I want to know the fidelity (or error rate) of the preparation of $|0\rangle$. How can I obtain it?
2
votes
0answers
55 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: <...
1
vote
1answer
29 views

In VQE, what ansatz would be best used for a maximally entangled $n$-qubit $H$?

What ansatz would be best used for a maximally entangled n qubit H? I came across this question in the Qiskit textbook and I really don't know how I would answer it.
2
votes
1answer
37 views

How does MCPhaseGate/MCU1Gate works internally in qiskit?

I was curious about the implementation of MCPhase/MCU1Gate and how it works without ancilla qubits. I ended up checking the code of the some auxiliary (?) function ...
0
votes
2answers
46 views

Phase Kickback - factoring Dirac representation

In section 2.3 of the Qiskit textbook (Phase Kickback), there's an example where a controlled-T gate is applied to $|1+\rangle$. You're asked to attempt the same thing with $|0+\rangle$. I've done ...
2
votes
2answers
108 views

Qiskit: Taking a QUBO matrix into `qubit_op'

I'm trying to solve the maximum independent set problem using Qiskit and the QAOA. I've a nice QUBO Matrix for this simple path graph: as so: My question is, how do I convert this into a general ...
1
vote
2answers
39 views

Multiple Providers on IBMQ

I am attempting to run parallel computations on two different backends from within the same Jupyter notebook, though it appears these two jobs are running sequentially. I understand the jobs will be ...
3
votes
1answer
110 views

Implementing QFT

I would like to know if there is a way to: Implement Quantum 'Functions' e.g the QFT of QFT* containing several single-qubit operations? Implement such operations on an arbitrary number of qubits and ...
1
vote
1answer
62 views

What is a good program to practice using a quantum algorithm? Should I use Cirq or Qiskit?

I am starting to learn about Quantum Computers and Quantum Algorithms. I also started reading about Qiskit and Cirq. I really like learning about them and hopefully I can be a Software Engineer with ...
-2
votes
1answer
35 views

IBMQ.load_account() fails with “403 Client Error” [closed]

I alredy save an account but when I want to laod it I get a error like this how can I fix it ? ...
2
votes
2answers
47 views

How to implement $\sqrt{iSWAP}$ in Qiskit

I want to implement the $\sqrt{iSWAP}$ operator using simple operations in Qiskit such as it is done for the $iSWAP$ here or $\sqrt{SWAP}$ gate here. How can I do this? If possible I would like to ...
2
votes
1answer
74 views

How to implement the swap test with the help of qiskit?

It's creating a real confusion for me especially the parameterized circuit which I have to create. Can anybody please solve this for me? I want to create this circuit.
1
vote
1answer
44 views

processing between sequential executions

Regarding real quantum computers of IBM, can one execute a circuit that contains measurements and afterwards get counts and then, based on the results of measurements (from counts), decide if to build ...
2
votes
1answer
51 views

How can I compose a list of quantum circuits onto different qubits in one command?

This is a follow-up question on composing the quantum circuits. Say if I have the following circuit element: ...
0
votes
1answer
36 views

Qiskit textbook - exercise 2.2 - why doesn't the correct answer give the same statevector?

In the Qiskit textbook, I'm stuck on one of the exercises in section 2.2. The question is: Write the state: as two separate qubits. The answer has already been covered in this question here, and is ...

1
2 3 4 5
17