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
1answer
32 views

How to split a Quantum Circuit on a barrier in Qiskit?

Let's say I have a QuantumCircuit with multiple barriers as shown in the visual below: How would I split up the ...
2
votes
1answer
20 views

Do I need to download Qiskit from IBM quantum experience?

Do I need to download Qiskit seperately or can I learn and write programs as well as practically view possible visualizatios in IBM quantum experiene itself?
-1
votes
1answer
31 views

What is a Qiskit stabilizer

I wonder what is a Qiskit stabilizer and why we need it. Also I want to know the difference between stabilizer and extended stabilizer.
0
votes
1answer
32 views

Qiskit plot_state_qsphere phase error

I'm trying to visualize a simple circuit in Qiskit. A single gate $Y$ is applied to the single-qubit register. The expected state is: $$ Y |0\rangle = \begin{bmatrix} 0 & -i \\ i & 0 \end{...
2
votes
1answer
50 views

Qiskit sample - Portfolio optimization

I've recently tried to run this sample from Qiskit (Portfolio Optimization) I was able to change RandomDataProvider to YahooDataProvider and able to run it on real stock prices. However, there is one ...
2
votes
1answer
104 views

How to measure in another basis

I am new to qiskit and I have to simulate a quantum circuit. I read this documentation https://qiskit.org/textbook/ch-states/single-qubit-gates.html where it is left as an exercise to the reader to ...
1
vote
1answer
37 views

How can I print out the probability of a certain state in histogram?

This is a simulation I did in my program. I'm hoping to print out the probability of the state |0001> (which is 0.052), and store this number in a letter (a). How can I do this? Thanks!!
0
votes
0answers
19 views

Qiskit function phase_amplitude_damping_error

I am reading about the noise models that can be simulated in Qiskit and I found out the phase_amplitude_damping_error function. I read about it and it seems to be a function that simulates a combined ...
1
vote
1answer
61 views

Examples of VQE on Qiskit

I'm a quantum beginner, and I really need some examples to help me understand quantum computing. In particular, how to get the ground energy of Hubbard or using model with VQE in Qiskit. Code examples ...
1
vote
1answer
74 views

How to add several parameters in qiskit circuit?

I want to construct an ansatz circuit in Qiskit, so I need some parameters to act on the gates (e.g. RX(a), RY(b)). In the Qiskit tutorials I find a way to implement a parameter: ...
0
votes
1answer
101 views

Command errored out with exit status 1 while installing the editable env for qiskit terra

I was installing the editable version of qiskit-terra from source in my conda environment using the following command pip install -e . and I got the following ...
1
vote
1answer
22 views

How to build an ExpectationBase object?

I'm trying to wrap my head around the expectation argument in Qiskit's VQE class, so to understand it I'm trying to create an ExpectationBase object to understand ...
1
vote
1answer
37 views

Can I append gates in a certain position in a Qiskit circuit

I have a question regarding modifying Qiskit circuits. I have a set of circuits that are pretty similar to each other. The only difference being some gates in the beginning of each circuit. I was ...
1
vote
1answer
27 views

Principal square root of Pauli Y gate in Qiskit?

I've seen a similar question asked (How do I compute the square root of the $Y$ gate?) but I'm trying to understand how I can use the gates $Y^{\frac{1}{2}}$ or $Y^{\frac{1}{4}}$ in Qiskit in terms of ...
2
votes
1answer
70 views

What is the best way to handle parametric circuits in Qiskit?

What is the best way to handle parametric circuits in Qiskit? When I create a variational form like TwoLocal and then do ...
3
votes
3answers
332 views

How can I create an arbitrary superposition state of two qubits in Qiskit?

I am trying to produce any arbitrary superposition state of two qubits, for example $a|00\rangle + b|01\rangle + c|10\rangle + d|11\rangle$, such that $a^2 + b^2 + c^2 + d^2 = 1$ . How can I do that ...
1
vote
1answer
67 views

controlled-Z rotation gates in symmetrical fashion

I was going through the qiskit textbook and in this chapter, i came across a statement under the topic "Kickback with the T-gate" related to the Controlled-Z gate that "the controlled-...
2
votes
1answer
35 views

How to define Q-operator in Quantum Amplitude Estimation

I'm trying to implement a circuit for Quantum Amplitude Estimation in Qiskit using elementary gates. I have created the circuit that represent my algorithm $A$ but now from the theory I know that I ...
2
votes
2answers
24 views

How to fix “QiskitChemistryError:PySCF is not installed”

I’m trying to simulate LiH using VQE. But I keep getting the error QiskitChemistryError:PySCF is not installed And I tried several ways to see whether my driver for the molecule was typed wrong. But ...
2
votes
1answer
79 views

Is this a Bell test?

Inspired by this article which uses a $|+\rangle$ state as a control for a $CSWAP$, I realised you can conditionally measure a qubit by (maybe) swapping it with an empty ancilla, measuring it and (...
4
votes
1answer
52 views

What are some current applications of Quantum Computing in drug discovery? Are there any test examples of this?

I am interested in applying the power of Quantum Computing to drug discovery. Although I realize that quantum computing is limited in regards to modeling drug-like compounds and their interactions ...
3
votes
1answer
39 views

When defining the state vector of a qubit in qiskit, what difference does putting “j” make?

I'm following the Qiskit textbook. I'm currently here: https://quantum-computing.ibm.com/jupyter/user/qiskit-textbook/content/ch-states/representing-qubit-states.ipynb Here's an example of my ...
0
votes
1answer
37 views

IBMQFactory object has not attribute backends

I try to run simple circuit measurement program using Qiskit in Visual Code. I received this error: AttributeError: 'IBMQFactory' object has no attribute 'backend' ...
2
votes
1answer
56 views

Unexpected Relative Phase while making the Toffoli Gate

I was trying to build the Toffoli gate using the following diagram (found in the qiskit textbook): So, I set V := Rx(pi/2) (as shown in the following diagram) (...
1
vote
1answer
55 views

Optimization using Quantum Logics

Is it possible to solve the following kind of optimization using Quantum Computing? Minimize 5*x1 - 7*x2 binary x1 x2 If yes, is it possible to have a sample code ...
2
votes
1answer
32 views

Optimize chains of single-qubit u1, u2, u3 gates by combining them into a single gate in Qikist

Can anyone explain how Qiskit does the merging of single-qubit gates for the purpose of optimization? u1(lambda1) * u1(lambda2) = u1(lambda1 + lambda2) ...
3
votes
1answer
60 views

Is there any way we get the state vector/density matrix of a noisy simulation in qiskit?

In Qiskit we can't use noise models in the 'state vector_simulator' or the 'unitary simulator', hence making it impossible to compute fidelity of the output of the noisy circuit and the noiseless ...
1
vote
0answers
50 views

Changing the Basis

I am attempting to use a VQE algorithm to find the ground state of a deuterium nucleus by applying a constructed hamiltonian to an ansatz state with one parameter created by a circuit. While I am ...
1
vote
0answers
48 views

Help Understanding Line in Source Code

In Qiskit's implementation of the HHL algorithm, they have the following line at the end of their code that allows them to compute the global phase we need to add on to the solution. ...
1
vote
1answer
42 views

Can we measure the quantum circuit sequently when using Qiskit?

In some quantum algorithms, the output of the quanutm circuit is probabilistic. For example. the measurement outcome (once) for a specific qubit "0" indicates success, which means that the ...
-2
votes
1answer
54 views

Grover's 3-qubits tutorial: Why we need the last X gates

I'm following the tutorial in Grover's Algorithm - Example 3 qubits I'm trying to understand the amplitude amplification using the reflection. But I cannot understand if we really need the step 3d (...
0
votes
2answers
58 views

Trouble importing Qiskit

When trying to import qiskit I obtain following error: ...
0
votes
1answer
54 views

Implementing block of gates at different times in a same qiskit program

I am implementing an Ising chain over 8 qubits. It involves pair-wise CNOT between all the qubits. In the first time step, I am doing CNOTs between qubits 0 and 1, 2 and 3, 4 and 5, and 6 and 7. In ...
0
votes
0answers
32 views

Why QuantumCircuit.diagonal does not provide global phase when it is used in a controlling circuit

When it is used in a controlling circuit, QuantumCircuit.diagonal() decomposition in Qiskit does not provide global phase (as a relative phase), but instead only identity operator is used. Here the ...
1
vote
1answer
49 views

Using QuantumCircuit.initialize() on a real quantum computer

Can the qiskit function QuantumCircuit.initialize be used to initiate any number of qubits (which exist currently on the quantum computers) and can it be used on a real quantum computer?
4
votes
1answer
94 views

Why are there such different UGate and U3Gate implementations in the Qiskit documentation?

The documentation for the new version Qiskit 0.20.0 states that: UGate is "Implemented using two X90 pulses on IBM Quantum systems: $U(θ,ϕ,λ)=RZ(ϕ−π/2)RX(π/2)RZ(π−θ)RX(π/2)RZ(λ−π/2)$" ...
2
votes
1answer
57 views

Is there a function in Qiskit to measure tensor products of Pauli operators?

Is there a function in Qiskit similar to this function in Q# which measures strings of Pauli operators applied to different qubits?
1
vote
0answers
21 views

How to implement gate error mitigation in Qiskit?

I have been using the Ignis module for performing error mitigation but it accounts only for the measurement errors. For this reason, I want to know if there is some way to perform gate error ...
7
votes
1answer
1k views

Would IBM's “compiler” turn my identity circuit into nothing?

If I were to create a circuit with the following gate: $$\tag{1}R_\phi = \begin{bmatrix} 1 & 0 \\ 0 & e^{i \phi} \end{bmatrix},$$ with $\phi$ specified to be equal to 0, then the gate that I ...
0
votes
0answers
11 views

There seems to be a bias against states with more 1s, in IBM's calibration matrix generator: What are the consequences and possible solutions?

Qiskit's function CompleteMeasFitter builds a calibration matrix in this way (2 qubit case): Everything is initialized in the state $|00\rangle$, which is the ...
1
vote
1answer
39 views

Qiskit IBMQ.load_account fails on version 0.20.0

So when trying to load my account I get this error: ...
2
votes
1answer
24 views

Defining dimension of an operator in qutip

My main question: Can someone please explain to me how the list of array is used to define the dimension in qutip ? context: If I have my density operator ...
0
votes
2answers
52 views

Updating qiskit doesn't update qiskit version using jupyter notebook/terminal

I installed qiskit using qiskit documents from here https://qiskit.org/documentation/install.html. When I first installed qiskit the version was 0.12.xx on ubuntu with python installed. Everything was ...
1
vote
0answers
26 views

Qiskit QSVM - Alphas and Support Vectors [closed]

I just started using Qiskit and I have implemented the QSVM example. However, I having trouble with the return. The qsvm.predict() results are reasonable but when ...
4
votes
1answer
44 views

Defining a custom parametric gate in Qiskit in terms of standard gates?

Here it is explained how to define a custom non-parametric gate in Qiskit. How do I define a new parametric gate? For example, I want to have the $CCR_y$ gate defined as in order to use it as ...
2
votes
1answer
25 views

Type object 'AllPairs' has no attribute 'params'

When I try QSVM over Iris data, it needs multiclass extension, but when I provide it, a following error is returned: ...
3
votes
3answers
145 views

Existence of multiple job monitor in qiskit

I can see in example code of qiskit, to implement job monitors on IBM Quantum machines, example uses any of the following ...
4
votes
1answer
72 views

Qiskit Portfolio Optimization Application

I recently got flung into the world of quantum computing and I'm a beginner at coding. I was assigned to do the Portfolio Optimization tutorial of the Qiskit Finance Tutorials and input real data. ...
2
votes
2answers
87 views

Qiskit error on get_backend()

Im trying to use IBM quantum machine instead of qiskit aer simulator with the following command: backend = IBMQ.get_backend('ibmq_16_melbourne', 'ibm-q') It's ...
0
votes
2answers
100 views

How to initialize a random state in Qiskit?

I know I can make a random_circuit, but I see that Qiskit has random_statevector. I'd like to optimize computation time by ...

1
2
3 4 5
12