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
0
votes
1answer
16 views

Install qiskit in django project

I was wondering if it's possible to use qiskit inside a django project. I found some ways to install jupyter notebooks, but I am not sure what is happening with qiskit. Ideally I would like to import ...
0
votes
1answer
23 views

How to obtain the density matrix using tomography in the real device?

I am trying to run the QFT algorithm for n=5 (n number of qubits). The number of experiments that it generates is bigger than the one allowed by the IBM devices (i.e. 75). Therefore, I have tried to ...
1
vote
1answer
9 views

Problem with the API-token from IBM TypeError

English/Englisch: Hi, could anyone help me please?I have a problem with the API-token ...
1
vote
2answers
31 views

Generic 2-qubit gate in qiskit

I need to implement a 2-qubit gate of the following form in qiskit (I've barely started using it, so I'm happy to try a different package if that's worth it) $$ A(\vec c)=\prod_{j=1}^3[I\otimes I\cos(...
1
vote
1answer
18 views

Conversion of python code on Machine learning to realise on quantum processor

I need to realise a Python code program on Qiskit. It works on fuzzy logic. How should I realise the same using quantum processors using Qiskit? Is there any support on realising Python code for Fuzzy ...
2
votes
0answers
38 views

How to construct a multi-qubit controlled rotation with variable angle?

I'm trying to construct a circuit that performs the quantum transformation : Where $f$ is some function. Is there a way to do it without going through every possible value of $i$ ?
2
votes
1answer
24 views

Graphing T1 using Qiskit

I am trying IBM's code for graphing T1 and I keep getting the following error: ...
3
votes
2answers
30 views

IBMQfactory._initialize_providers Error

After a successful first run without problems, I found that I cannot connect any longer. Code: ...
0
votes
1answer
19 views

Modifying measurements in a Qiskit circuit

Assume my function Qiskit receives a certain circuit as an input. How do I check if this circuit already has some measurements appended to it? If so, how can I ...
0
votes
1answer
42 views

Angles of rotation in HHL example

I am trying to implement the 4-qubit example outlined in https://qiskit.org/textbook/ch-applications/hhl_tutorial.html#2.-The-HHL-algorithm (showed in Section 3 of the article). Does anyone know what ...
2
votes
1answer
29 views

How to plot custom labels for quantum registers in Qiskit?

How can I plot custom labels for specific qubits on the left and right side similar to the picture shown here (A, B, Sum ...):
1
vote
0answers
23 views

How to ignore spins is Qiskit chemistry package?

Is it possible to use built-in qiskit.chemistry tools, such as VQE, UCCSD, etc., without ...
3
votes
1answer
115 views

Quantum circuit for Szegedy quantum walk on a cyclic graph

I'm trying to implement an efficient circuit for the Szegedy quantum walk on a cyclic graph with number of nodes N = 8. I found the circuit in this thesis (page 39), the two images below show graph ...
0
votes
0answers
30 views

Creating qubit operators for optimization problem

There is DOcplex module that generates WeightedPauliOperator for the DOcplex Model by calling docplex.get_operator(model). I ...
1
vote
1answer
54 views

Creating Ising Hamiltonian with Qiskit

How to create Ising Hamiltonian and implement it with qiskit (the output should be in the form of WeightedPauliOperator) for the following problem: $$ H = A \big(...
0
votes
0answers
29 views

How to get running time for each circuit executed on IBM's quantum processors in one round?

I want to execute multiple circuits in one round on IBM's backends, especially the 16-qubit one, to save time. For instance, ...
0
votes
0answers
27 views

How should I understand that protocol has worked correctly by histogram?

I'm trying to simulate quantum secret sharing protocol HBB99 I've read the paper "Quantum secret sharing" by Hillery, Bužek and Berthiaume (Phys. Rev. A, 1999; preprint on arXiv) and I have a question ...
1
vote
2answers
35 views

In Qiskit quantum teleportation protocol, why they use CZ and CX gate at the end?

I understand the simple quantum teleportation protocol and why it uses X and Z gate at the end of the circuit. I was researching about the Qiskit and I came across this video https://www.youtube....
1
vote
1answer
91 views

Evaluating expectation values of operators in Qiskit

I'm wondering how in Qiskit one can calculate the expectation value of an operator given as a WeightedPauli (or, at least, of a single ...
0
votes
1answer
19 views

Real-device error mitigation with qiskit

I'm trying to do error mitigation in IBM-Q quantum computers with qiskit. I followed the tutorial here. My thought was that in order to make sure that I'm correcting the qubits that I'm actually using ...
1
vote
1answer
49 views

How to reduce unnecessary waiting time when using IBM's backend?

I'm working with a program, which needs iterations of quantum computation like this ...
1
vote
0answers
45 views

ibmq_qasm_simulator from IBMQ provider and qasm_simulator from Aer provider gives different results

I'm running an experiment first on qasm_simulator backend from Aer provider and the most frequent result is the correct one with ...
1
vote
1answer
60 views

Creating a custom VariationalForm in Qiskit

I would like to use the built-in Qiskit VQE() function, with my own variational form. What is the proper way to define it? I was expecting ...
1
vote
0answers
43 views

VQE restart from a previous computation

I'm running VQE algorithm on ibmq-qasm-simulator. I'm trying to implement a restart mechanism in order to be able to start a new computation from the result of a ...
3
votes
1answer
97 views

How to format a qiskit circuit to only have a high level abstraction?

Consider the following situation, we import a 3-bit Toffoli gate as follows: from qiskit.aqua.circuits.gates.multi_control_toffoli_gate import _cccx I further ...
2
votes
1answer
21 views

Specifying qubits to achieve measurement error mitigation on Qiskit

I'm learning how to do error mitigation on Qiskit as my experiment result differs from the simulated result. I read the tutorial here, but I have some questions about it. If I have understood it ...
1
vote
2answers
89 views

How to write decent code for oracle in Qiskit without custom circuit or long truth table?

I am now practising using Qiskit. The example of Grover's algorithm in tutorials suggests using logical expression, truth table or circuit to construct the oracle. In most textbooks on quantum ...
3
votes
3answers
57 views

Implementing controlled $\frac{\pi}{2}$ y and z rotation in Qiskit

I'm trying to implement a controlled $\frac{\pi}{2}$ rotation along y axis and z axis (two individual gates) in Qiskit but I'm stuck. My thought was calculating the square root of the y and z pauli ...
0
votes
0answers
26 views

QAOA with Qiskit: Is the initial state affected by the noise model?

I'm doing a simulation of the QAOA algorithm with noise via the QAOA class of Qiskit 0.19. Here's (part of) my code: ...
0
votes
3answers
35 views

How do I change the number of max_shots of Aer qasm_simulator in Qiskit running on my computer?

I want to do a circuit with more than 1 million shots. How do I change the number of max_shots of Aer qasm_simulator in Qiskit? When I run it, it said ...
0
votes
1answer
24 views

How can I find the most suitable IBMQ provider for my location? [duplicate]

I have been trying to run my code on IBM's quantum computers, so I used the following commands to associate a quantum computer to the component qcomp: ...
0
votes
0answers
39 views

Error with support vector machine code [closed]

I'm trying to run the algorithm below using a Parkinson's dataset but every time I run it, it either never goes in or produces that error. There are no errors in any of the other lines of code but ...
1
vote
1answer
39 views

Evaluated Standard deviation during QAOA/VQE optimization is always zero. Qiskit 0.19

I'm using qiskit 0.19.1, and I'm doing some simulation of QAOA, using the aqua class QAOA. I use a callback function in my program to see energy and std during optimization, but the evaluated standard ...
1
vote
1answer
21 views

Trying to get a provider from IBMQ but get 'No provider matches the criteria.'

I have created a circuit and then run the following: provider = IBMQ.get_provider('ibm-q') And this is what I get: ...
1
vote
2answers
20 views

Layout Method in qiskit

Using transpile with optimization_level = 3, which is the layout method used by default?
1
vote
1answer
43 views

ModuleNotFoundError: No module named 'qiskit.circuit.library'

I am importing from qiskit.circuit.library import MCMTVChain on python IDLE editor but it showing error ...
3
votes
1answer
86 views

How to make circuit for n-control Z gate( i.e $C^3Z$ )?

I am trying to make circuit for $C^3Z$ gate I have seen a circuit for $C^2Z$ or $CCZ$ gate made by using $CCX$ gate so is there any way to make circuit for $C^3Z$ in this similar manner( i.e by using $...
1
vote
1answer
32 views

SPSA max_trials

I'm using SPSA as an optimizer in VQE algorithm. The code runs on ibmq-qasm-simulator. I've set SPSA max_trials parameter to 500, but, when I run the code, it makes ...
1
vote
1answer
14 views

How can I make qiskit output raw data?

I am new to quantum computing, and I want to make a program to output 0 or 1 randomly by Hadamard gate, and use that information to make a GUI interface. For example, a coin flip program that output "...
2
votes
1answer
44 views

Implementing sum on Boolean with Grover algorithm

We are trying to implement a "sum over 4 booleans = k" in the spirit of Grover search. First, we have 4 qubits, one for each boolean q00, q01, q02, q03,; then 4 ...
3
votes
1answer
70 views

Deutsch's algorithm in Qiskit

I am trying to understand and implement the Deutsch algorithm. I follow the logic from Nielsen book and I started to implement it in Qiskit. For implementing the oracle, I use a CNOT gate and now I ...
3
votes
1answer
47 views

Choi and Chi matrices (in Qiskit)

I'm struggling with the framework for quantum process tomography on Qiskit. The final step of such a framework is running fit method of ...
1
vote
1answer
46 views

How to create a qubit in arbitrary state in qiskit

A QuantumCircuit() command creates a qubit with zero state always. I've seen some instructions about using Arbitrary Initialization but it is not accessible and ...
1
vote
1answer
22 views

Tomography library in Qiskit?

I am wondering what is the equivalent to the import bellow in the current version of Qiskit? import qiskit.tools.qcvv.tomography as tomography
1
vote
0answers
48 views

Creating Bell States with CNOT conditioned to the control qubit being set to zero

I was using qiskit to generate all of the Bell States. I created the following circuits for each state: $|\Phi^+\rangle :$ $|\Phi^-\rangle :$ $|\Psi^+\rangle :$ $|\Psi^-\rangle :$ The $|\Psi^\pm\...
2
votes
1answer
30 views

How do I get intermediate values of VQE algorithm using callback?

I'm new to using Qiskit Aqua, and I'm trying to get the intermediate values in the VQE algorithm to study the convergence. The documentation mentions an internal callback function, but I can't figure ...
1
vote
0answers
36 views

Implementing QPE in qiskit

I'm trying to implement the HHL algorithm in qiskit, but right now I'm stuck on the quantum phase estimation routine, the main problem being not knowing how to implement the unitary operator $U$. ...
1
vote
2answers
37 views

Angle in qiskit

I have been working on Qiksit. Is it possible to display just the angle of each gate in a circuit as an output? For example, if the below code is my circuit is it possible to just print the angle of ...
1
vote
2answers
66 views

Result of Grover on Qiskit simulator

I have executed this circuit and I don't understand why the result is $|11\rangle$ ? [q[0], q[1]] : solution register [q[2]] : ...
2
votes
1answer
77 views

Qiskit flipped representation of qubits in CNOT gate?

The conventional CNOT gate is shown on the right, and the Qiskit version is on the left. Since Qiskit defines it has a flipped representation kindly explain what is happening to the 11 position?

1
2 3 4 5
9