Is it possible to get the value of a measurement stored in the classical register in qiskit? Say that I have

q = QuantumRegister(9)
c = ClassicalRegister(9)
circuit = QuantumCircuit(q, c)

And I measure each qubit as


Then what I see when I print out any value in c[i] is Clbit(ClassicalRegister(9, 'c3'), 0). I'm wondering how I can see what the actual value of the individual classical bit is? Can I do it without having to first execute the job (i.e. so that I can utilize the value in a mid-circuit measurement scenario)?

  • $\begingroup$ Do you mean to extract classical bit values after execution of the job? $\endgroup$ May 10 at 5:39
  • $\begingroup$ @MartinVesely No, I mean can we get the values stored in the classical register without having to execute the job. Like, if I wanted to perform operations dependent on the classical register before executing $\endgroup$ May 10 at 5:42
  • 1
    $\begingroup$ Qiskit allows you to perform mid-circuit measurement and to act accordingly to what was measured: quantumcomputing.stackexchange.com/questions/28010/… However, you do need to execute a job to get the values. Think about it: the classical register contains the result of a measurement performed on a quantum state. In order for this state to have been created, it is of course required that a job has been run. $\endgroup$ May 10 at 8:11


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.