modrozeleni
modrozeleni

Reputation: 1

Qiskit simulator intermediate results

Is it possible to get an intermediate result from qiskit simulator?

Let's suppose I have a really simple circuit.

OPENQASM 2.0;
include "qelib1.inc";

qreg q[2];
creg c[2];

h q[0];
z q[0];
measure q[0] -> c[0]; 

I would like to get the vector state after applying the H gate and then again after applying the Z gate. I can not use the measurement gate, because I would lose the qubit state.

Can I query the qubit/vector for each step in a circuit?

Upvotes: 0

Views: 179

Answers (1)

Geomon Joshy
Geomon Joshy

Reputation: 11

If you are using the Qiskit programing language:-
You could use
save_statevector() function to save intermediate values. But i believe you are speaking of OPENQASM.
In that case please surf through this Github respo to see if you can find an answer.

Upvotes: 1

Related Questions