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
3
votes
1answer
40 views

How to decompose/unroll a Qiskit Arbitrary initialization

I'm aware that to randomly initialize a quantum circuit with Qiskit, we can simply write qc.initialize(rand_state, q[0]...). However, when drawing the circuit, I see that the "initialize" ...
2
votes
1answer
38 views

Issue with Speed of Qiskit Arbitrary Initialization

I've been using a circuit that needs a specific initialization in the beginning, and to do so I've been using qc.initialize() as mentioned in previously asked similar questions (How can I create an ...
2
votes
1answer
94 views

Qiskit installation

I'm trying to get started with Qiskit but the installation process has been horrendous and the official instructions are unusable. The latest python doesnt work with the install instructions at: https:...
0
votes
1answer
69 views

Braket and Q# Simulators

I have implemented Shor's algorithm in Qiskit, and everything works as expected within the IBM Q experience for both the IBM qasm_simulator and real hardware. However, after I've implemented Shors in ...
3
votes
0answers
111 views

Implemented QAOA returns wrong result

I try to apply QAOA algorithm to find minimal energy state of the Hamiltonian: $H_A = \frac{1}{2}\sigma_z^1 + \frac{1}{2}\sigma_z^1\sigma_z^2$ It is expected that with p=2 my variational should ...
3
votes
1answer
44 views

Weird Grover's Algorithm Behavior

I am attempting to use Grover's to find elements in an array that satisfy a comparative query (=, <, >, etc). I am using Qiskit, and am using a qRAM to encode my array. I have experimented with ...
0
votes
0answers
56 views

How can I fix the BrokenProcessPool error in Qiskit?

I'm running a set of quantum circuits using the ibmq_qasm_simulator. However, sometimes my code works for the simulation, but sometimes it doesn't, and the system ...
2
votes
2answers
69 views

Qiskit Controlled S and Controlled T Gates

I was implementing controlled S and T gates in qiskit and was wondering if there is any difference between using the cu1 and crz ...
2
votes
1answer
33 views

Qiskit PauliWeightedOperator in the matrix representation?

Suppose we have a PauliWeightedOperator object from Qiskit. Is there any built-in method to convert it to the matrix representation in the computational basis? My search in the docs was not successful....
2
votes
0answers
30 views

Run VQE for parametrized quantum circuit with ancilla qubits

Let's say we have the following circuit (picture and code shown below), and now the $q_0$ is an ancilla qubit. If the system of interest has only two qubits, Is there a way to use only $q_{1,2}$ as my ...
0
votes
1answer
51 views

how to generate a random sequence [duplicate]

...
2
votes
1answer
47 views

How do Hadamard and CNOT gates work on Qiskit SDK? Why is the output reversed?

Here is the code that I have been using on IBM Q Experience (should be the latest version of Qiskit). From my understanding it seems like the outputs of Hadamard and CNOT gates are reversed in a 2-...
2
votes
1answer
48 views

How can I run a set of circuits, each of which has 100 shots?

I'm running simulations of my quantum circuit, which includes both parametrized variables and random numbers. The question I'm trying to solve is that for each parameterized variable, I will generate ...
2
votes
1answer
62 views

How does this represent modular multiplication

How does this circuit map $|x\rangle$ to $|7x \space mod15\rangle$? Looking into Shor's and I thought that phase kickback causes the modular exponentiation part to be mapped onto the measurement ...
0
votes
1answer
21 views

How can I fix this parametrization error in Qiskit?

I'm trying to use the parametrized circuits to run a single model of quantum circuit with different values. Here's part of my code: ...
1
vote
2answers
59 views

Shor's implementation problem on qiskit

If q4-7 are all supposed to be eigenstates of the operation, why is it just that q7 is in $|1\rangle$? Shouldn't all qubits 4 to ...
2
votes
0answers
185 views

Qiskit issues with Apple Silicon?

Edit/summary: Everything below this first paragraph is my original question posted several days ago and involves a lot of speculating on a problem I knew less about at the time. The purpose of this ...
0
votes
2answers
51 views
1
vote
1answer
36 views

Increase maximum shots on IBM Hardware when running Quantum Variational Algorithms

I am interested to know whether there is a quick and elegant way of increasing the number of shots (more than 8192 shots) on IBM hardware when running variational algorithms like VQE or QAOA. I know ...
3
votes
1answer
37 views

Kernel stopping when solving water molecule ground state

I'm new to QISKIT Aqua and I'm trying to follow the Ground State tutorial to solve the Water molecule ground state, but when I execute the calculations the kernel stops. I'm using IBM Q Experience ...
2
votes
1answer
60 views

What are the possible gates that I can use to vary input states before CNOT?

We know that the noise of the $\text{CNOT}$ gate varies depending on the input state before it. What are the gates that I can put in the place of the 4 identity gates above to change the input state ...
3
votes
1answer
67 views

XY Hamiltonian in a 1D Heisenberg Chain

I've been trying to implement the 1D Heisenberg chain (i.e. the XXZ model) on Qiskit but have been having trouble. To recap, the Heisenberg hamiltonian is as follows: $$H_{XXZ} = \sum^{N}_{i = 1} [J(S^...
2
votes
3answers
116 views

Computing the CDF with QAE in Qiskit

I want to load a lognormal distribution and then use an IntegerComparator to flip a qubit ($|0\rangle$ to $|1\rangle$) if its value is less than a threshold. Then I want to use an Quantum Amplitude ...
2
votes
2answers
63 views

Callback function in VQE do not return the intermediate values of the parameters

I tried to save all the intermediate values of the parameters when running the built-in VQE in qiskit. The callback function can save the mean values and counts, however it seems only save the very ...
2
votes
0answers
126 views

qiskit: Traveling Salesman Problem using QAOA fails for more than 3 cities

I tried to implement the traveling salesman problem (TSP) using QAOA with qiskit. I worked with this qiskit QAOA tutorial and this qiskit minimum eigen optimizer tutorial, where they implement a TSP ...
2
votes
1answer
48 views

Is it possible to measure “aux_operators” in built-in VQE with backend “qasm_simulator”

I am trying to measure the number operator, together with the ground state energy with the built-in VQE on Qiskit. However, if I pick the backend to be ...
4
votes
1answer
88 views

Expected value in a VQE qiskit

I'm learning VQE(variational quantum eigensolver) of qiskit, but I have a question about how it measures the expected value of the energy ($\left \langle H \right \rangle$). I saw in other question ...
1
vote
1answer
55 views

Trying to perform Quantum Phase Estimation on T-gate

I'm trying to perform QPE on the T-gate in Quirk but I'm not getting the correct result. For the T-gate, I should be measuring (001) with 100% probability, but instead, I'm getting the following: I'...
2
votes
1answer
60 views

Decomposition of 2-qubit Hamiltonian into standard gate set for QAOA

I try to decompose ansatz into gate set in order to create a circuit in qiskit for QAOA algorithm. I don't understand how represent parametrized 2 qubit ansatz as circuit. $ H{_B} = \sum_{j=1}^{n} {\...
3
votes
2answers
249 views

Does the Qiskit ADMM optimizer really run on quantum computers?

I read Qiskit quantum admm on this website. I doubt whether this Qiskit ADMM algorithm can run on a quantum computer. The code did import packages from Qiskit, but it doesn't create any quantum ...
4
votes
2answers
148 views

Get state vector of a single qubit in a circuit in Qiskit

I have two quantum circuits, and I would like to compare state vector of the first qubit and check if equals, what is the best way to do that in qiskit ? Let's say I have : ...
2
votes
1answer
71 views

Transpiler in IBM Quantum devices [duplicate]

I am having trouble understanding how the transpiler works in IBM quantum computers. I am studying the spatial noise correlation between two qubits in an IBM Q device. For that, I don't want the ...
0
votes
1answer
32 views

How can I resolve this get_count issue from running multiple circuits?

I'm running a couple of circuits at the same time using an array of variables. However, I met an issue regarding accessing the counts. Here's part of the code I have: ...
4
votes
1answer
111 views

How to effectively compute eigenvalue rotation in HHL

In the HHL algorithm, how do you efficiently do the $\lambda-$controlled rotation on the ancillary qubit ? It seems to me after reading around some answers that this can be done in two steps : First, ...
1
vote
1answer
61 views

IBMQ qiskit SSL error submitting job [duplicate]

...
2
votes
2answers
75 views

Conjugate transpose of a U-gate

I want to be able to create the circuit depicted below, but running the code below results in an empty circuit when viewing the job afterwards. ...
5
votes
3answers
438 views

Qubit Connectivity of IBM Quantum Computer

When simulating a quantum circuit using qiskit qasm_simulator, the qubits that you assigned to the quantum circuit can be ...
1
vote
1answer
62 views

Get a sparse matrix of quantum circuit

Is there a way that can obtain sparse matrix of quantum circuit? I used to check my quantum circuit with quantum_info.Operator, but for large number of qubits, it ...
0
votes
2answers
58 views

qiskit: How to get an operator acting on a certain qubit?

I have a system of $N$ qubits and want to construct a quantum operator $Z_i Z_j + Z_k$, where $Z_i$ denotes the Pauli-Z operator acting on the $i$th qubit. Is there any direct way in qiskit, how I ...
2
votes
1answer
34 views

Is Noise model for quantum prototypes accurate in Qiskit

We know that in Qiskit noise models modeling specific quantum machine prototypes exist and can be inserted into the code. However, are these models fixed in nature or they continuously improve ...
2
votes
1answer
68 views

Connectivity in Grover's algorithm on real quantum computers

Everytime I execute Grover's search algorithm on IBM real quantum computers I get a wrong answer (it doesn't find the correct winner state) unless I use only 2 qubits. For any higher number of qubits ...
1
vote
1answer
53 views

Two questions on circuit composer on IBM Q Experience [closed]

I have two (unrelated) questions when I run circuits on IBM Q Expierence. The first one is encountered, when I run the built-in function VQE (for H2 molecule). It seems two circuits were run, and the ...
1
vote
4answers
98 views

How to transpile a circuit using Qiskit as done in IBMQ experience

When I create a circuit using Qiskit and then transpile it using transpiled_circuit = transpile(circuit, ibm_backend, optimization_level=1) then I open my IBMQ ...
2
votes
1answer
87 views

How to get subspace of quantum circuit?

How can I get a subspace of a quantum circuit? More precisely, I'm dealing with quantum circuit with data qubits ('q') and ancilla qubits ('anc'), such as $(q_0,q_1,...,q_n,anc_0,..anc_m)$. After some ...
2
votes
1answer
114 views

How to run a OpenQASM 3.0 file?

When uploading a QASM-file with ÒPENQASM 3.0; as first line, the code editor on quantum-computing.ibm.com will throw an error. However the qiskit Python library ...
0
votes
1answer
36 views

Device Repitition Rate on Melbourne

I've been receiving "Circuit runtime is greater than the device repetition rate [8020]" errors when running a relatively simple circuit on ibmq_16_Melbourne, but have had no issues ...
0
votes
2answers
59 views

Coping values based on indicator qubit in Qiskit

Give the following input: $$ A: 1110 \\ B: 0111 \\ \text{indicator}: 0 \text{ or } 1 $$ How do I copy the value of A or B to target qubits if indicator is 0 or 1 respectively? In the image below, the <...
1
vote
1answer
33 views

Mechanism of measurement in IBM quantum devices

I am trying to find out about the mechanism of measurement in IBM Q devices. To be specific, if I apply two Hadamard gates on the first qubit and identity on the second then is it possible to ...
3
votes
1answer
114 views

Using Qiskit VQE for solving an eigenvalue problem

I am a new user of Qiskit and I believe there is a simple answer to my question but I have had a very hard time finding a straightforward answer. I am trying to transform a given $3 \times 3$ (...
2
votes
2answers
247 views

Maximum number of qubits suppoted by the Qasm simulator

By using the Qiskit qasm-simulator, I want to simulate a quantum circuit of 40 qubits. However, the number of qubits 40 is greater than maximum number (24) for qasm-simulator. Is there any possibility ...

1 2
3
4 5
17