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
0
votes
0answers
11 views

Solution to Qiskit textbook Lab 3. Accuracy of Quantum Phase Estimation

I am trying to verify the accuracy of the Quantum Phase Estimation as outlined in the Qiskit textbook lab 3 (https://qiskit.org/textbook/ch-labs/Lab03_AccuracyQPE.html). Please I wanted to know if ...
2
votes
0answers
31 views

Set the bounds for ansatz parameters in VQE

How can I make intervals for free parameters when I use VQE function? (https://qiskit.org/documentation/stubs/qiskit.algorithms.VQE.html) I have built a parametrized ($\theta_1,...,\theta_n$) circuit ...
2
votes
1answer
27 views

Add FreezeCoreOrbitals on ElectronicStructureProblem

I want to freeze core orbitals of my molecule and I know ElectronicStructureProblem has the possibility (es_problem = ElectronicStructureProblem(driver=driver, q_molecule_transformers=...
2
votes
1answer
38 views

Replacement of FermionicOperator from qiskit.chemistry in qiskit_nature

qiskit.chemistry.FermionicOperator here is very useful for converting fermionic operators to qubits operators. qiskit.chemistry ...
1
vote
1answer
29 views

Qiskit Portfolio Optimization : Does the resulting matrix show the stock combination to select?

The IBM Qiskit Portfolio Optimization sample finally provides an array similar to [1,0,1,1] representing the 4 digits as the stocks. So does the ...
2
votes
1answer
34 views

Time result for my algorithm

I've used the function result.time_taken to know the amount of time used to execute a task on the real chip, but I don't understand if the result is in seconds or ...
1
vote
1answer
24 views

How to import circuit libraries into qiskit

Im trying to put the QFT circuit in my qiskit circuit but im having trouble: ...
0
votes
0answers
44 views

How to simplify a circuit with repeated same parts?

If I have a circuit with 3 qubits and repeated gates as follow: ...
1
vote
1answer
56 views

Is there a way I can reduce the code for generating simple circuits with the same structure?

here's the code I'm using to generate 3 quantum circuits with the same structure (They're only differed by the first U3 gate on the qubit): ...
3
votes
2answers
46 views

Inverse of Statevector.from_label in Qiskit

In Qiskit I can construct a computational basis statevector in the following fashion ...
2
votes
1answer
57 views

configuration of FakeOpenPulse2Q

Can you help me to configure the FakeOpenPulse2Q() to produce more realistic pulses? The code below instantiates 2 circuits and generates the waveforms for each. ...
2
votes
1answer
53 views

Qiskit: Transpilation and the CircuitSampler

I am using Qiskit's opflow and its CircuitSampler to evaluate matrix elements / expectation values. Now, going beyond ...
2
votes
1answer
43 views

How do you compute the compiled unitary of a quantum circuit comprised of different $n$-input gates?

Given a quantum circuit consisting of two qubits, how is the compiled unitary of the circuit computed when we have different input type gates? (X-gate, H-gate are single-input gates, CNOT is a 2-input ...
2
votes
1answer
59 views

Qiskit logical to physical qubit mapping

I want to run a simulation using qasm with a realistic noise model from a backend, specifying a coupling_map as well as an ...
2
votes
1answer
48 views

Pulse waveform for 2-qubit circuit

I'm trying to reproduce the Bell-state pulse display as shown in this tutorial. The code is very short: ...
1
vote
1answer
50 views

Is there any way to obtain the number of qubits of a given backend in Qiskit?

I'm testing out a program in different IBMQ mock backends, and I want the program to use the maximum number of qubits in each case. Is there any function/method to extract the number of qubits of a ...
3
votes
2answers
232 views

Drawing the circuit in Qiskit - how to set same style as in Composer?

A quantum circuit can be visualized in Qiskit with circuit.draw. A drawing style can be set with parameter output which can have ...
3
votes
1answer
68 views

Why does running my circuit on Quantum Hardware produce such unexpected resultss?

I am using Jupyter Notebook with Qiskit. I have created a program that can add two 3-bit numbers together. When I simulate this program on a qasm_simulator it works as expected and I can add any two 3-...
2
votes
1answer
75 views

Why I am gettting this error when I try to open the Quantum Lab in the IBM Quantum experience?

I am using quantum labs in IBM Quantum Experience to my circuits. But from yesterday onwards (May-03-2021) this error message is being shown on my screen. Does anyone have any idea about this issue?
-1
votes
1answer
26 views

How to get the machine name on the IBM Quantum P.72 [closed]

I am proceeding the book titled ’IBMで学ぶ量子コンピュータ’ but I can not find the machine list on the right side of this book on page 72. Please let me know how to get the name of the machine and set it into ...
1
vote
0answers
68 views

Qiskit Tomography and Noise Mitigation with a Measurement Mid-Execution

I'm struggling to get a program running where I have a circuit with a measurement and reset mid-execution and I want to use noise mitigation and state tomography together. The circuit is defined ...
5
votes
1answer
72 views

What is the superop simulator in Qiskit for?

I'm trying to understand what the use case of a superop simulator would be. My understanding is that density matrix is generally more resource intensive than state vector, but it has additional ...
2
votes
1answer
38 views

Can I use the same qiskit account on two laptops?

I have two laptops with different accounts of Jupyter Notebook. I'm wondering can I use the same qiskit account (with the same token) on both laptops? I'm worried that if I run the token on my new ...
2
votes
2answers
61 views

Qiskit: count the type of gates on the qubit with the largest number of gates in a multi-qubit circuit

I would like to know the number and type of all the gates on the wire/qubit with the largest operations in a quantum circuit with multiple qubits. Is there any inbuilt functionality, or what is the ...
3
votes
1answer
67 views

Why does applying a Hadamard gate three times to $|0\rangle$ result in a tiny imaginary component in the $|1\rangle$ amplitude?

I'm using qiskit with the online IBM Quantum Lab and when I run the following code ...
3
votes
0answers
31 views

What are the correct eigenvalues to use in controlled rotation in HHL?

I'm studying the HHL algorithm from the qiskit textbook, but I don't understand what $\lambda$ we have to use. If my matrix $A$ has eigenvalues that can be written in a binary representation, then, ...
2
votes
0answers
40 views

How to turn a 'term' in a QuantumError into a QuantumError?

A QuantumError class may have many terms, and we can use .error_term(position) to have a look at each term. But it returns a list instead of another QuantumError ...
2
votes
1answer
29 views

Bernstein Vazirani Algorithm widget (bv_widget) in the Qiskit documentation

I'm new to quantum computing and Qiskit, so please be patient with me. I'm going through the info on Bernstein Vazirani. Here is the link to the section: https://qiskit.org/textbook/ch-algorithms/...
6
votes
1answer
78 views

Does Grover's algorithm always give the correct answer with 100% certainty for two-qubit states?

In the Qiskit tutorial on Grover's algorithm it is stated that with a 2 qubit algorithm the chance of measuring the "right" state is already 100%. But I thought that the algorithm would ...
2
votes
0answers
54 views

How accurate are Qiskit’s unitary and Statevector simulators for very large circuits?

Background: I wrote a code that takes a Qiskit circuit C as an input and outputs a random circuit C’ such that C and C’ have the same unitaries. I tested my code using Qiskit’s Statevector simulator ...
0
votes
1answer
44 views

Qiskit QFT matrix does not match with DFT matrix

The unitary matrix associated with the QFT circuit in Qiskit does not match the actual DFT matrix. In fact, all the imaginary components have their sign flipped (...
3
votes
1answer
42 views

Measuring second excited state |2> using “calibrations” not Open Pulse

I am tying to measure the second excited state in a system that does not support Open Pulse. Instead I am using calibrations. The method detailed here does not work. I get the error ...
5
votes
1answer
76 views

What algorithm does Qiskit use to decompose arbitrary n-qubit unitaries on Rotations + CNOT?

I found that Qiskit uses Unroll3qOrMore in the transpiler class function to decompose an arbitrary $n > 2$ unitary and represent it as a directed acyclic graph (DAG). But I can't find an algorithm (...
5
votes
1answer
116 views

Does the circuit with qubit-wise CZ gates compute the inner product of two states? If not, is there another circuit that does?

I've been searching for a quantum algorithm to compute the the inner product between two $n$-qubit quantum states, namely $\langle\phi|\psi\rangle$, which is in general a complex number. One can get $|...
0
votes
1answer
53 views

How to use qiskit transpile with Clifford + T basis? [duplicate]

How can I transpile using universal $Clifford + T$ gates set? I have only seen examples using rotations + $CNOT$. This is what I have tried ...
1
vote
1answer
77 views

How to keep angles in degrees into quantum circuit using qiskit?

Qubit in polar form $$\left|\psi\right\rangle=\cos(\theta/2)\left|0\right\rangle+\sin(\theta/2)\left|1\right\rangle $$ Now lets say i want to keep $\cos(\theta/2) = 50.400 $ degrees angle and $\sin(\...
1
vote
1answer
119 views

In the HHL alghoritm, how can I transform my hermitian matrix into a unitary operator?

I'm studying the HHL algorithm and I'm trying to do an his implementation but, there are some points that I don't understand how I can transform my hermitian Matrix into its unitary operator? In ...
3
votes
1answer
76 views

Calculating the ground states of an Ising Hamiltonian on a real quantum computer

I have followed this tutorial and based on it, I've written the following function in qiskit, which can explicitly calculate the ground states of a transverse-field Ising Hamiltonian. ...
2
votes
2answers
40 views

Error when attempting to visualize controlled hadamard gate state matrix with qiskit

I'm trying to get used to the qiskit module and quantum circuits in general, before tackling a QML project. So I'm going through the tutorial on the documentation page regarding gates. I've gotten as ...
0
votes
1answer
75 views

Cannot Repeat HHL Result [closed]

There is an HHL example in IBM Qiskit https://qiskit.org/textbook/ch-applications/hhl_tutorial.html If I run on that website (click "Try") in Section 4 and set ...
1
vote
1answer
45 views

Can I use Quantum lab during IBM Quantum certification exam? [closed]

Hello I am about to take the IBM Quantum Qiskit dev exam. I don't know if I can use the quantum lab (Qiskit) during the exam. Does anyone know?
0
votes
0answers
45 views

What does it mean to have a negative cost (aka loss) function?

In the Variational Quantum Linear Solver (VQLS) paper they define four cost functions (2 global and 2 local) and state in Appendix B that "all four cost functions are non-negative." However, ...
3
votes
1answer
87 views

Implementing 3-Qubit Grover Algorithm in Qiskit

The Qiskit tutorial on Grover's Algorithm shows an example of finding two marked solutions out of 8 items, produced by 3 qubits. Using the general diffuser code it provides, however, I realize that ...
1
vote
0answers
30 views

How to transform fermionic operators in qiskit

I encountered some problems when using the qiskit pakage to define the 2-electron reduced density matrix (2-RDM), which is a 4-index tensor, $\langle a_i^\dagger a_j^\dagger a_k a_l\rangle$. I need to ...
1
vote
1answer
46 views

How do I work with Gaussian in Qiskit?

I am trying to run this Qiskit Nature tutorial (Vibrational Structure) and it uses the GaussianForceDriver. Every time I run the Gaussian job from Qiskit I get this message: ...
0
votes
0answers
26 views

Source code for Hamiltonian measurement in qiskit [duplicate]

In variational quantum eigensolver, it is common to transform the Hamiltonian to a qubit form by Jordan-Wigner transformation, for example. After that, the algorithm needs to measure the qubit ...
2
votes
1answer
65 views

Can Qiskit decompose circuits into non-IBMQ basis gate sets?

Let circ be a QuantumCircuit object. Running circ.decompose() returns a circuit that ...
1
vote
2answers
79 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
55 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\...
1
vote
1answer
73 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 ...

1
2 3 4 5
19