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
2
votes
1answer
19 views

Qiskit: Error when importing libraries for ADMM optimizer

I would like to try and ADMM optimizer as shown in Qiskit Tutorial in Quantum Lab. Firstly, I imported necessary libraries (copy/paste from the Tutorial): ...
2
votes
0answers
26 views

Simulate a random quantum state time evolution in Qiskit Aqua

I am trying to evolve a quantum state through a PauliTrotterEvolution in aqua and I'm trying to do so by initializing a random state, by using ...
0
votes
0answers
29 views

How can I implement a circuit that simulates white noise on $n$ qubits?

I want to test an error model of the convex form $$t \times \text{ideal_state} + (1-t)\times \text{noisy_circuit}.$$ In terms of density matrices, this would look like $$t\rho_{\text{idealState}}+(1-t)...
2
votes
1answer
42 views

How to perform a time evolution of a quantum state with Qiskit Aqua?

How can we perform a time evolution of a quantum state for a given Hamiltonian with qiskit Aqua operator flow? I'm interested in it due to its higher efficiency.
1
vote
2answers
18 views

Can I get the job variable from the job_id?

Suppose I run the following code: job = execute(qc, backend = backend, shots = 1024, optimization_level = 0) Then the job takes a long time to run. We know that ...
0
votes
1answer
29 views

Inconsistency in Qiskit Aqua CircuitSampler from Operator Flow

I am trying to wrap my head around Qiskit Aqua Operators and I stumbled upon this: My code ...
-3
votes
0answers
69 views

How can I declare a big matrix on real quantum hardware(not simulator) [closed]

How can I declare a big matrix on real quntum hardware. Because I find how I can do it on simulator but I don't find it on real hardware. Maybe can you give a link. ...
0
votes
2answers
41 views

How to get the CNOT error rate between 2 qubits on a given IBMQ Backend?

How can the CNOT gate error between 2 qubits as shown on visual qubit coupling map on the IBMQ Dashboard be retrieved in Qiskit using the BackendProperties....
-1
votes
0answers
23 views

Qiskit density_matrix simulator and memory_profiler

I use jupyter notebook to simulate quantum dummpy code with 'density_matrix' method. Following is my code. Now, I want to check memory usage of it. So I use %memit operation to each functions. ...
1
vote
1answer
44 views

Unable to instantiate provider for research account locally

When I run IBMQ.load_account(). I have the error information: ...
0
votes
1answer
28 views

Converting 'string' to a function/gate in QisKit

I want to give a list of Quantum gates in a .txt file from user an apply them to a Quantum circuit but the gates in notepad .txt file have 'string' type while in Qiskit I need functions/methods. For ...
0
votes
1answer
17 views

How to re-execute failed jobs in qiskit?

When executing a batch of circuits using the IBMQJobManager and attempting to combine all the results of all jobs with combine_results I get the ...
0
votes
0answers
42 views

Different result between Q# and Qiskit

I'm running a search program with custom initial state. I wrote a program in Q# and one in Qiskit but I get different results even if the code seems to be peforming the same operations. The Q# result ...
-1
votes
1answer
50 views

Qiskit implementation for MPS

Now, I'm implementing Matrix product state method with QasmSimulation in Qiskit. following code The problem arise when I set number of qubits. When running it with 27qubits is very fast but, for 24, ...
0
votes
2answers
37 views

Generate a random bit sequence of 512 bits [duplicate]

How can I generate a random bit sequence of 512 bits on IBM Q experience using 3 or 5 qubits? Putting a hadammard gate and measuring would only give me smaller bit sequence due to limitation in number ...
2
votes
2answers
73 views

Generate a 3-qubit SWAP unitary in terms of elementary gates

I wish to generate the following unitary ...
0
votes
1answer
33 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 ...
0
votes
2answers
56 views

Custom Gate/Instruction with classical bits in Qiskit

In Qiskit, I need to define a custom gate or instruction that, once decomposed, turns into a series of basis gates, including measurements and classically controlled gates (this is the part that I can'...
1
vote
1answer
40 views

How can I use the quantum volume to design the scale of my experiment?

I am designing an experiment which involves solving a linear system of equations of the form $Ax=b$. To do this, I am using the HHL algorithm on the IBMQ system. My experiment is scalable such that ...
1
vote
1answer
42 views

Quadratic optimization in Qiskit: Error when QuadraticProgram with quadratic constraint converted to QUBO

I prepared a quadratic optimization task with binary and integer variables and linear and quadratic constraints. I fed it into QuadraticProgram in Qiskit. After ...
1
vote
1answer
48 views

Hadamard gate for three qubits; inconsistency between IBM and Matlab

I am trying to build a large and quite complex three qubit quantum circuit on IBMs quantum computer. I have a specific unitary which I am trying to implement and I am building a circuit following the ...
2
votes
2answers
53 views

My IBMQ job hangs forever?

I am running a very simple script just to learn how to use IBMQ, but my job will hang indefinitely and I am forced to terminate it. ...
2
votes
1answer
51 views

How can I convert the unitary matrix $e^\frac{i\pi}{2}$ into a quantum circuit in Qiskit?

How can I put the unitary matrix $$e^\frac{i\pi}{2}I$$ to the quantum circuit? I don't know if it is belong to $$U3(\theta, \phi, \lambda), U2(\phi, \lambda), U1(\lambda)$$ Thanks a lot.
0
votes
1answer
51 views

How to get state vector from QasmSimulator in Qiskit

I'm currently able to get state vector in Qiskit using state_vector backend using something like : ...
2
votes
1answer
41 views

Is it required to input full matrix when using Qiskit HHL algorithm for sparse matrices?

I am working with a very sparse matrix and it seems inefficient to load the full matrix as input into the Qiskit HHL algorithm. Is it possible to input only the non-zero elements, instead ? I am ...
0
votes
0answers
88 views

Can one use a quantum circuit as a pathfinding algorithm?

I've been learning about quantum computing, and I noticed that another way to describe the state vector is as a path in a binary tree where each level of tree represents another qubit, each node ...
-1
votes
3answers
106 views

Google Colab - ImportError: The class MatplotlibDrawer needs pylatexenc

When I run the following command qc.draw(output='mpl') for my circuit qc, I get this error: ...
0
votes
1answer
48 views

How to code a projector operator in qiskit?

I'm new to qiskit and I want to know how do I define a projector operator in qiskit? Specifically, I have prepared a 3 qubit system, and after applying a whole lot of gates and measuring it in a state ...
2
votes
1answer
58 views

Test equivalence of circuits exactly on qiskit

I have two circuits that I believe are equivalent. How can one check this on qiskit? Currently, I am executing both circuits and verifying that the counts are close (which they are) but I would like ...
1
vote
1answer
31 views

Is there a way to generate random circuits in qiskit with only certain allowed gates?

It seems like I can use https://qiskit.org/documentation/stubs/qiskit.circuit.random.random_circuit.html but I would like to control the gates that are allowed. What is an efficient way to make random ...
-1
votes
0answers
38 views

Why are there 2 different versions of qiskit installed in anaconda?

When running pip show qiskit-ibmq-provider in the Anaconda Prompt I get the following: ...
1
vote
1answer
30 views

What is the significance of varying the number of shots while running a circuit in a quantum machine and qasm simulator?

what is the significance of varying the number of shots while running a circuit in a quantum machine and qasm simulator? Does more number of shots give better/accurate result? I am running a simple 2 ...
1
vote
0answers
30 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 ...
0
votes
1answer
21 views

Is the combine_results method deprecated in qiskit v0.20.0

According to the ManagedResults Documentation the class has a combine_results method, however when attempting to use it as follows: ...
0
votes
2answers
29 views

How many shots are executed when using the IBMQJobManager?

When using qiskit execute it is possible to stipulate the number of shots for each experiment/...
-1
votes
1answer
22 views

Qiskit job not giving the right result after execution

Here is my code ...
1
vote
2answers
64 views

quantum random number generator implementation in quantum lab

How can I generate and print a 32 bit sequence of 0s and 1s in Qiskit or IBM Q experience quantum lab using quantum random number generator implementation?
0
votes
2answers
140 views

How to initialise a qubit in the state $\frac{1}{\sqrt2}(|0\rangle+|1\rangle)$ in qiskit?

In qiskit, how can I initialise a qubit in a complex state, specifically in the state: $$\left|q\right> = \frac{1}{\sqrt2} \left|0\right> + i \frac{1}{\sqrt2} \left|1\right>$$
1
vote
2answers
37 views

How to execute many circuits on an IBMQ backend?

I attempted to execute a list of $3200$ QuantumCircuits in Qiskit, each with the max_shots ...
2
votes
2answers
55 views

Having trouble finding angles for Bloch vector

I am doing the 5th exercise on https://qiskit.org/textbook/ch-states/representing-qubit-states.html#Quick-Exercise (all the way at the bottom). Which states find the angle for the vector $\frac{1}{\...
2
votes
1answer
26 views

Qiskit: Add a standard gate to circuit from a string

Given a circuit, if one wishes to add a gate, it is done through a line like the one below mycircuit.cx(0, 1) Here, we have added a control-X gate on the 0 and 1 ...
1
vote
0answers
25 views

What is the advantage of QSVM over the classical SVM?

I am mainly talking about QSVM from Qiskit (https://qiskit.org/documentation/stubs/qiskit.aqua.algorithms.QSVM.html#qiskit.aqua.algorithms.QSVM) versus a classical SVM. Is it just a time complexity ...
0
votes
1answer
26 views

Error associated with HTTPSConnectionPool

How can I solve this situation? I'm using the IBMQX2 chip. When I run my simulation some circuits are executed and the following WARNING message is displayed: ...
2
votes
1answer
35 views

Qiskit: Get gates from circuit object

Is there a way in Qiskit to take a circuit object and return a list of tuples where each tuple consists of a gate and the qubit(s) they act on? The list obeys some partial order since the gate order ...
1
vote
1answer
27 views

Error while running Qiskit code on real quantum hardware

I started to learn Qiskit, so sorry if my question is very basic. So far I used qasm_simulator or state_vectorsimulator, ...
0
votes
1answer
36 views

QiskitError: 'No statevector for experiment

This is the code that I have used. Why can't i use get_statevecto when i use quantum computer. I got a state_vector when i have used qasm_simulator. ...
0
votes
0answers
35 views

qiskit - MCMT - base gate acting on only one qubit

I want to reduce the depth of a ucrz gate acting on multiple qubits with ancilla qubits in qiskit. One way to do this could be the mcmt implementation with ...
0
votes
1answer
38 views

How do I compute the fidelity on the IBM Q using qiskit without the statevector simulator?

I want to compare the fidelity of a circuit implemented on IBMQ Santiago with the ideal circuit simulated using the statevector backend. Is there a way to do this? So far I have only seen examples ...
0
votes
2answers
32 views

How to remove last n layers of Quantum Circuit in Qiskit?

Let's say I have a QuantumCircuit with depth $d$ layers. How can I generate a new ...
1
vote
1answer
24 views

Getting an error running a program in IBM Q Experience Quantum lab

Running the program in Quantum Lab, it shows error. I am looking for solution. Here is a code I run: ...

1
2 3 4 5
12