Job Status : job is being initialized
\"),))" + "A Jupyter Widget" ] }, "metadata": {}, @@ -515,19 +467,20 @@ "source": [ "%%qiskit_job_status\n", "shots = 1024 # Number of shots to run the program (experiment); maximum is 8192 shots.\n", - "max_credits = 3 # Maximum number of credits to spend on executions. \n", + "max_credits = 3 # Maximum number of credits to spend on executions. \n", "\n", "job_exp = execute(circuit, backend=backend, shots=shots, max_credits=max_credits)" ] }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 18, "metadata": { "ExecuteTime": { "end_time": "2018-09-29T00:05:42.718830Z", "start_time": "2018-09-29T00:05:42.296069Z" - } + }, + "collapsed": true }, "outputs": [], "source": [ @@ -538,12 +491,12 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Like before, the counts from the execution can be obtained using ```get_counts('name')``` " + "Like before, the counts from the execution can be obtained using ```get_counts(circuit)``` " ] }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 19, "metadata": { "ExecuteTime": { "end_time": "2018-09-29T00:05:44.604801Z", @@ -554,17 +507,17 @@ { "data": { "text/plain": [ - "{'000': 62,\n", - " '001': 161,\n", - " '010': 121,\n", - " '011': 47,\n", - " '100': 77,\n", - " '101': 430,\n", - " '110': 49,\n", - " '111': 77}" + "{'000': 10,\n", + " '001': 121,\n", + " '010': 12,\n", + " '011': 56,\n", + " '100': 56,\n", + " '101': 530,\n", + " '110': 63,\n", + " '111': 176}" ] }, - "execution_count": 17, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -577,12 +530,15 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The job ID can be obtained using the following which you can use later to get the job if your experiment takes longer to run then you have time to wait around." + "## Retrieving a job\n", + "\n", + "If your experiment takes longer to run then you have time to wait around, or if you simply want to retrieve old jobs back, the IBMQ backends allow you to do that.\n", + "First you would need to save your job's ID:" ] }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 20, "metadata": { "ExecuteTime": { "end_time": "2018-09-29T00:05:57.842131Z", @@ -594,7 +550,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "JOB ID: 5bb8039cdc2ba1005273a488\n" + "JOB ID: 5bbab4081e05e30056b929e3\n" ] } ], @@ -608,13 +564,15 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The job can be gotten from the backend using retrieve_job" + "Given a job ID, that job object can be later reconstructed from the backend using retrieve_job:" ] }, { "cell_type": "code", - "execution_count": 19, - "metadata": {}, + "execution_count": 21, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "job_get=backend.retrieve_job(jobID)" @@ -629,23 +587,23 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{'000': 62,\n", - " '001': 161,\n", - " '010': 121,\n", - " '011': 47,\n", - " '100': 77,\n", - " '101': 430,\n", - " '110': 49,\n", - " '111': 77}" + "{'000': 10,\n", + " '001': 121,\n", + " '010': 12,\n", + " '011': 56,\n", + " '100': 56,\n", + " '101': 530,\n", + " '110': 63,\n", + " '111': 176}" ] }, - "execution_count": 20, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -653,13 +611,6 @@ "source": [ "job_get.result().get_counts(circuit)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -679,7 +630,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.4" + "version": "3.6.3" } }, "nbformat": 4,