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
0answers
35 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
90 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
1answer
45 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
28 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 ...
2
votes
2answers
51 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
167 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
24 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
54 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
48 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
73 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
1answer
96 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
114 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
22 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
105 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
71 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
32 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
36 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
28 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: ...
1
vote
1answer
48 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
24 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
21 views

Layout Method in qiskit

Using transpile with optimization_level = 3, which is the layout method used by default?
1
vote
1answer
82 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
108 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
35 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
15 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
47 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
89 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 ...
4
votes
1answer
69 views

What is the relationship between Choi and Chi matrix 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
54 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
25 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
52 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
39 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
2answers
41 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
68 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
84 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
vote
0answers
23 views

Error in qiskit.aqua.operator

I want to implement this thing: Operator([[3, Pauli([1,0,0], [0,0,0])], [2, Pauli([0,0,0],[0,0,3])]]) But while doing this there is an error in ...
1
vote
1answer
40 views

Results of SAT on the Qiskit simulator

I computed SAT formula with the Grover search algorithm on the Qiskit simulator with default parameters, but I don't understand why the incorrect solutions don't have a probability of 0? The SAT ...
0
votes
1answer
74 views

AssertionError: wrong color format 'ansibrightred'

I am running my old qiskit code after a very long time it's not running now showing error wrong color format 'ansibrightred' and ...
0
votes
1answer
39 views

How to control the qubits in IBMQ

I am trying to perform OTOC for my 7 qubit protocol. I need to carefully control and use only 7 qubits but after making measurement in the 16 qubit Melbourne system (ibmq_16_melbourne) my protocol ...
3
votes
1answer
62 views

How to create states in Qiskit using complex phase angles?

How do we create an arbitrary vector of the following form in Qiskit? Say, we want to initialize a qubit with a vector, $$ \vert \psi \rangle = \frac{1+i}{\sqrt{3}}\vert 0 \rangle - \frac{i}{\sqrt{3}}...
1
vote
1answer
58 views

How does Inverse QFT work in Quantum Phase Estimation?

I'm trying to implement Quantum Phase Estimation from qiskit textbook. Below is the implementation circuit taken from the above-mentioned site: The output at position 2 will be as follows: $$|\psi ...
0
votes
2answers
55 views

Bernstein-Vazirani IBMQ error due to probably measurements

I'm using the following piece of python code: ...
2
votes
0answers
36 views

IBMQJob.result() returns KeyError: 'qObjectResult'

I'm running tomography job like I have done many times before. I send the job, and the job.status() is 'DONE'. But when I ask for ...
2
votes
1answer
72 views

Problem with HHL algorithm on Qiskit

I try to run HHL algorithm on quantum computer in Qiskit Notebooks on the site. I take it from here https://qiskit.org/textbook/ch-applications/hhl_tutorial.html but it doesn't work. The error message ...
0
votes
1answer
96 views

Updating qiskit doesn't update qiskit version from Spyder

I installed qiskit using directions at https://qiskit.org/documentation/install.html I also have ...
2
votes
1answer
77 views

Error using FixedIncomeExpectedValue sample

I am working with Aqua sample (qiskit-aqua/test/finance/test_readme_sample.py ) that uses the FixedIncomeExpectedValue and the <...
2
votes
1answer
94 views

Different results between qasm_simulator and quantum computer: how to normalize for only few states

I recently started developing circuits with Qiskit. I made a 5 qubit circuit in which the fourth qubit at the end of execution must always have value 1: When I do the simulation with qasm everything ...
3
votes
1answer
51 views

What are the differences between the different transpiler optimization levels in qiskit

I am currently running a simple algorithm using Qiskit and I am running it for various transpiler optimization levels (0-3). I wish to know what exactly occurs differently when for example I run the ...
1
vote
2answers
39 views

Design connectivity of qasm_simulator

About the qasm_simulator, does it have on its 32 qubits a qubit connectivity design like as ibmq_16_melbourne or as another real ...
0
votes
1answer
124 views

VQE for Beginners : Using Tutorial and Cirq

I have been following this tutorial: https://dkopczyk.quantee.co.uk/vqe/ I am using Cirq to try to teach myself VQE, replicate their results, and also try to understand more about ansatz for ...

1
2
3 4 5
9