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
92 views

How to measure a qubit Hamiltonian in qiskit

I am using qiskit to get some measurement results of observables similar to the Hamiltonian. Can someone provide the way how qiskit measures the Hamiltonian (Jordan-Wigner transformed) when using VQE? ...
0
votes
1answer
81 views

Compute measurement values of observables by Qiskit

Is there a way to get certain measurement results by variational quantum eigensolver in qiskit? More specifically, I want to get measurement results for certain operators, like $\langle a^\dagger_ia_j\...
2
votes
1answer
97 views

PyTorch and Qiskit example from the Qiskit textbook seems broken

After executing the proceeding code blocks, when I try to copy the same code from Qiskit textbook on my jupyter notebook, I get the error as ...
2
votes
1answer
132 views

Symbolic computation with quantum circuits

What are my options for computing symbolic results for quantum circuits? I have identified some possibilities: SymPy (Python library, see also this), unfortunately, the software forces you to encode ...
1
vote
1answer
59 views

Unable to use iSWAP in Qiskit TwoLocal entangling_block

I would like to use a general entangler in the entanglement_block of the TwoLocal function. The function seems to work with 'cz', 'cx', 'swap' gates, but it fails for 'iswap' gate. Below is the error ...
2
votes
2answers
92 views

Re-initializing qubits in a circuit without losing superposition

So recently I was building some circuit made of subcircuits. My subcircuits happen to use auxiliary qubits, that are always initialized in the state $|0\rangle$ and are not used after the calculation. ...
2
votes
1answer
56 views

Is there any way to assign a colour for a single gate in Qiskit?

I'm drawing with Qiskit a big circuit with some predefined and custom gates. I want to colour some of them in non-default colours for a better reading of it. Is it possible to do it for predefined ...
2
votes
2answers
122 views

Which qiskit backend is faster in execution of the quantum circuit prepared?

I have a quantum circuit of 40 qubits with mutliple gate operations being applied to many of the qubits. Currently I am using qasm simulator which for shots=1 took 10 hour of time. Is there any other ...
0
votes
1answer
41 views

Getting the current variational parameters in Qiskit

I am right now using variational quantum eigensolver (VQE) to calculate the ground state of some molecules, like H2, by qiskit. The quesiton is that how to get the current parameters of the varaional ...
0
votes
0answers
39 views

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

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

What is the physical unit of the energy calculated using VQE on Qiskit?

Suppose there is any arbitrary ansatz producing variational energy for any arbitrary Hamiltonian. What is the physical unit corresponding to the energy? Since numerical algorithms only output a ...
-2
votes
1answer
41 views

How to calculate quantum circuit with given quantum state?

I have task to calculate this quantum circuit Where psi is: ...
-1
votes
1answer
56 views

Optimising Angle Code in Qiskit - Using the QAOAVarForm

I’ve got a bit of an elongated plea for aid here! I’ve got some code that finds the optimum angles for QAOA on the Maximum Independent Set Problem. It does however seem about ~10x slower than related ...
1
vote
0answers
61 views

Iterative Phase Estimation with noise vs standard Quantum Phase Estimation with noise

I am doing Qiskit Lab 4 about Iterative Phase Estimation. I created a circuit implementing IPE for theta = 1/3 (phase of 2pi/3). Here's the circuit: It seems to do okay if I run it without noise in a ...
2
votes
1answer
61 views

How to solve TSP problem with more than 3 nodes in the tutorial of Max-Cut and Traveling Salesman Problem?

I had to try the example of qiskit’s Traveling Salesman Problem with 3 nodes and executing it at IBM backend called simulator_statevector.Can execute and get the result normally. But when trying to ...
0
votes
1answer
92 views

Calculating the expected value of a weighted Pauli Operator in Qiskit

Following UT course on Quantum Machine Learning, they have a notebook on QAOA. As part of their lecture, they perform QAOA using Qiskit. Unfortunately, it seems the new versions of Qiskit have changed ...
1
vote
2answers
74 views

How do I get the Unitary matrix of this circuit without using 'unitary_simulator'? [duplicate]

I am using jupyter notebook and qiskit. I have a simple quantum circuit and I want to know how to get the unitary matrix of the circuit without using 'get_unitary' from the Aer unitary_simulator. i.e.:...
4
votes
1answer
84 views

I don't understand unitary of ${e^{iAt}}$ from HHL algorithm

I tried to implement the following circuit in the image below but with the red circled gates replaced with a unitary controlled ${e^{iAt/2}}$ and controlled ${e^{iAt/4}}$ The image came from this ...
0
votes
1answer
28 views

Why is my unitary matrix using linear algebra not matching the 'get_unitary' simulation?

I am using jupyter notebook and qiskit. I have a simple quantum circuit and I want to know how to get the unitary matrix of the circuit without using 'get_unitary' from the Aer unitary_simulator. i.e.:...
2
votes
4answers
135 views

How do I get the Unitary matrix of a circuit without using the 'unitary_simulator'?

I am using jupyter notebook and qiskit. I have a simple quantum circuit and I want to know how to get the unitary matrix of the circuit without using 'get_unitary' from the Aer unitary_simulator. i.e.:...
4
votes
1answer
113 views

Qiskit - Circuit drawing esthatics - can i force the measurements in my circuit 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 ...
0
votes
2answers
51 views

Issue in running the qiskit tutorial for QSVM

I am trying to run this QSVM tutorial using qiskit from my Python environment using Jupyter Notebook Firstly it gives me an error that I have to install ...
1
vote
1answer
46 views

how to implement Quantum tomography on an arbitrary state using Qiskit?

Can quantum tomography helps to reconstruct the state? How is this possible with arbitrary quantum state? For example if I have a $$|\psi\rangle= (0.24506+0.9633i)|0\rangle + (0.0046238+0.10943i)|1\...
1
vote
1answer
88 views

How to get_statevector() with defined gates in Qiskit?

I'm learning Qiskit for my QC lectures and I'm not able to run the following code: ...
0
votes
1answer
50 views

Error “too many subscripts in einsum”, UnitaryGate()

I'd like to build a multi qubit controlled gate in the following way. The circuit has $n+1$ qubits, the first qubit is the control qubit, and the operation on the rest $n$ qubits is the tensor product ...
1
vote
1answer
72 views

From logical universal gate set to physical one, Qiskit

Among the several universal gate sets, the Clifford$+T$ set seems the most important one (since it should provide fault-tolerant computing). However, that set is logical and it differs from physical ...
1
vote
1answer
52 views

Quantum SVM with large feature set

I am trying to practice QSVM from the following tutorial Introduction into Quantum Support Vector Machines The author has used 2 feature_dimension with 2 component PCA ...
3
votes
1answer
116 views

Bloch Sphere of Qiskit logo

Trying to plot the Bloch Sphere of the IBM Qiskit logo ...
2
votes
2answers
49 views

What is the minimal delay between gates on IBM devices?

Suppose I create the very simple circuit OPENQASM 2.0; include "qelib1.inc"; qreg q[1]; x q[0]; barrier q[0]; x q[0]; and submit it to an IBM backend. ...
1
vote
0answers
12 views

Need Help in QGAN function to load higher dimentional data

I have a query that I am using qiskit.aqua.algorithms.QGAN library and using the qgan function and I am having difficulty in loading data of dimension 1000 rows x 10 columns. I am following qiskit's ...
1
vote
1answer
77 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 ...
1
vote
1answer
83 views

In quantum teleportation, Is it possible for bob to just see the state vector after receiving it from Alice without measuring it?

I was reading about quantum teleportation using Qiskit. Alice wants to teleport some quantum state to Bob. My question is Is it possible for bob just to see the state vector after receiving it from ...
1
vote
3answers
155 views

Incorrect rendering of a circuit by draw method

Executing from qiskit import * circuit = qiskit.QuantumCircuit(3, 3) circuit.draw(output="mpl") in ipython notebook gives the following image Which ...
1
vote
1answer
52 views

How the arguments of $U_3$ gate are converted when they're not lying in the expected range?

From the qiskit documentation (here), a general form of a single qubit unitary is defined as $$ U(\theta, \phi, \lambda) = \begin{pmatrix} \cos\left(\frac{\theta}{2}\right) & -e^{i\lambda} \sin\...
2
votes
1answer
110 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 ...
0
votes
1answer
41 views

Make a controlled gate from a QuantumCircuit that uses append in Qiskit

Here is a minimal example for what I want to do: ...
1
vote
1answer
36 views

How do I export the rightmost state of circuit wires (qbits and cbits) in a qiskit simulation

qiskit has a quantum teleportation tutorial which winds up with this simulation code: ...
2
votes
2answers
95 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
65 views

Function in Qiskit to get the quantum circuit

Is there any way to view the quantum circuit of pre implemented quantum algorithm in Qiskit? In the Qiskit textbook, there is an example given for HHL algorithm. Is there any function in Qiskit which ...
3
votes
1answer
112 views

What is Qiskit's Transpiler method for unitary synthesis?

As I could found in here how the transpile works in qiskit, I understood that transpile gets arbitrary Unitary gate $U$ and some set of basis gates as input, and produce some quantum circuit of $U$ ...
3
votes
1answer
80 views

How to read a Q sphere representation?

I'm trying to understand the Q-sphere representation of a 3-qubit system. I get that the 3-qubits are in a superposition of 2 different states. The first qubit (rightmost) is in a superposition of <...
3
votes
2answers
78 views

Source code for a Qiskit algorithm: HHL Algorithm

Is it possible to view the source code of one of the Qiskit's algorithm? Actually, I am trying to find how Qiskit implements the HHL algorithm. I want to see the source code for this algorithm.
2
votes
1answer
43 views

From Qiskit QuadraticProgram to problem model accepted by d'wave ocean

Is there a way to convert QuadraticProgram (qiskit.optimization.problems.QuadraticProgram) to BQM used in D'wave ocean (e.g. <...
1
vote
1answer
83 views

How to read QASM files for parametrized circuits (in QISKIT)? both from_qasm_file() and from_qasm_str() fail

I am trying to work with parametrized circuits in QISKIT. I can simply create parameterized circuits, bind value(s) to parameter(s), and execute/run all instances (after binding values for parameters) ...
1
vote
0answers
60 views

How to divide one quantum circuit into multiple sub-circuits in qiskit?

While I'm simulating one Big quantum circuit in Qiskit, I wonder how we can divide one big quantum circuit into several sub-circuits. I looked in Qiskit API documents, but I couldn't find it. Is there ...
1
vote
1answer
54 views

Qiskit: 3 applications of identity with arbitrary SU(2) is universal?

We know that the CNOT gate together with arbitrary SU(2) gates can be used to perfectly implement arbitrary SU(4) gates with 3 applications of the CNOT. I am using the Qiskit library and testing how ...
1
vote
1answer
38 views

Operation conditioned on measurement result

I have a 2 qubit circuit where I wish to measure the first qubit and the measurement outcome determines what operation to implement on qubit 2. The whole process can be simulated using the following ...
5
votes
1answer
73 views

Can I simultaneously plot 2 vectors on a single Bloch sphere and rotate the angle of visualization?

I'm trying to plot 2 vectors on the same Bloch sphere. From the qiskit documentation here, we can find ...
5
votes
3answers
139 views

Can I find the axis of rotation for any single-qubit gate?

Suppose I have an arbitrary qiskit $U_3$ gate: $U_3(\theta,\phi,\lambda)$. Is there a way I can find which axis the gate is rotating around? In other words, given any real numbers $\theta,\phi,\lambda$...
0
votes
1answer
69 views

Qiskit not finding CPLEX

I'm trying to use the CPLEX library alongside Qiskit but keep getting the error. ...

1 2
3
4 5
20