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
1
vote
2answers
55 views

How to run VQE experiments on IBMQ Backends?

The VQE.run method only takes a quantum_instance of type QuantumInstance or BaseBackend and ...
0
votes
1answer
31 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 ...
1
vote
2answers
58 views

Why is there a significant variation between the exact and VQE energy results?

When running the VQE simulation for $H_2$ over a range of distances as detailed in the Simulating Molecules using VQE section of the Qiskit Textbook, the VQE energy deviation from the exact energy ...
1
vote
1answer
65 views

Why is circuit inverse not working for EfficientSU2?

For some reason I get the following error when attempting to find the inverse of the EfficientSU2 VQE variational form: TypeError: 'NoneType' object is not ...
0
votes
1answer
31 views

Information about two algorithms of Matrix product state

In qiskit backends, there is Matrix_product_state. With this backend, I can simulate circuit for several qubits. And I found some mysterious problem about MPS. With 25,26,27 qubits, the simulating ...
1
vote
1answer
53 views

On number of parameters and operators in UCCSD in qiskit

I have two questions on UCCSD in qiskit, please see the code below. ...
1
vote
1answer
57 views

Why is local qasm simulation taking so long for VQE?

I've successfully run the $LiH$ VQE simulation detailed in Simulating Molecules using VQE using the statevector_simulator, however when attempting to run the same ...
2
votes
1answer
31 views

How is the Hartree accuracy calculated between the exact and VQE results?

In the Simulating Molecules using VQE section of the Qiskit textbook it states an accuracy of $0.0016$ Hartree between the exact and ...
2
votes
1answer
49 views

Change the position of a gate in Qiskit for better representation

I'm using Qiskit to demonstrate some circuits, and I want to change the position of some gates for better representation. For example, look at this circuit: I'd like for the last $R_x(\frac{-\pi}{2})$...
1
vote
0answers
36 views

Report measurement components for a given Hamiltonian measurement

I was wondering if there is a possibility to report measurement components when reporting the final expectation values of a qubit operator. For example, if we look at a simple Hydrogen molecule ...
1
vote
1answer
36 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
1answer
62 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
37 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
78 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
30 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
40 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 ...
0
votes
2answers
58 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
vote
1answer
88 views

Unable to instantiate provider for research account locally

When I run IBMQ.load_account(). I have the error information: ...
0
votes
1answer
31 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
28 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
51 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
57 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
71 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
84 views

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

I wish to generate the following unitary ...
0
votes
1answer
53 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
89 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
48 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 ...
2
votes
1answer
50 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
55 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
83 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
56 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
195 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
49 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
124 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
324 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
73 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 ...
3
votes
1answer
100 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
37 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
vote
1answer
43 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
44 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
22 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
41 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
24 views

Qiskit job not giving the right result after execution

Here is my code ...
1
vote
2answers
71 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
207 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
91 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
75 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
32 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
58 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
32 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: ...

1 2
3
4 5
14