6
$\begingroup$

I submitted a job in the 0.5.0 version of QISKit using

job = execute(qc, 'ibmqx5', shots=shots)

This just submits the job, and does not wait for a result.

I then immediately tested whether the job was still running using

print(job.running)

This gave the result False. However, when I requested the result using

job.result()

This still took a while to get the result, suggesting that the job actually was still running after all. What is going on here?

$\endgroup$
4
$\begingroup$

There are three stages that the job goes through, as you'll see if you also print the status using print(job.status).

The first is an initialization stage. This returns False for job.running, because it hasn't started running yet.

Then your job actually will run, and so give True for job.running. Finally it will have finished running, and so job.running goes back to False.

So don't use job.running to test whether a result is ready.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.