Skip to content

Commit

Permalink
review nits
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat-thotakura committed Oct 12, 2023
1 parent fab0cdc commit d301c28
Showing 1 changed file with 69 additions and 32 deletions.
101 changes: 69 additions & 32 deletions docs/source/get_started/access_info/access_info_css.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
{
"data": {
"text/plain": [
"'$136.85'"
"'20 credits'"
]
},
"execution_count": 3,
Expand Down Expand Up @@ -223,14 +223,14 @@
"## Job Information\n",
"Jobs submitted through Superstaq contain the following information:\n",
"\n",
"* `job_id()`: Unique identifier for the job\n",
"* `status()`: Status of the job (either Queued, Running, Done)\n",
"* `target()`: Device the job was run on\n",
"* `counts()`: Counts from the result of the job run\n",
"* `num_qubits()`: Number of qubits for the job\n",
"* `repetitions()`: Number of repetitions for the job\n",
"* `input_circuit()`: Retrieves original (i.e., not compiled) circuit for job. Note this returns a list and you must specify the index if you want to retrieve a single circuit.\n",
"* `compiled_circuit()`: Retrieves compiled circuit from submitted job. Note this returns a list and you must specify the index if you want to retrieve a single circuit.\n",
"* `job_id()`: Unique identifier for the job.\n",
"* `status()`: Status of the job (either Queued, Running, Done).\n",
"* `target()`: Device the job was run on.\n",
"* `counts()`: Counts from the result of the job run. Note this can return a list, so you must specify an index if you want to retrieve a specific corresponding counts dictionary.\n",
"* `num_qubits()`: Number of qubits for the job. Note this can return a list, so you must specify an index if you want to retrieve corresponding number of qubits to a particular circuit. \n",
"* `repetitions()`: Number of repetitions for the job.\n",
"* `input_circuits()`: Retrieves original (i.e., not compiled) circuit(s) for job. Note this returns a list and you must specify an index if you want to retrieve a single/specific circuit.\n",
"* `compiled_circuits()`: Retrieves compiled circuit(s) from submitted job. Note this returns a list and you must specify an index if you want to retrieve a single/specific circuit.\n",
"\n",
"Note that jobs live in our database for a limited amount of time. Typically, they have a lifespan of 1 year."
]
Expand All @@ -251,7 +251,7 @@
" cirq.measure(qubits[1]),\n",
")\n",
"\n",
"# Submitting the circuit to the IBM Q QASM Simulator\n",
"# Submitting the circuit to the IBMQ QASM Simulator\n",
"job = service.create_job(\n",
" circuit, repetitions=100, method=\"dry-run\", target=\"ibmq_qasm_simulator\"\n",
") # Specify \"dry-run\" as the method to submit & run a Superstaq simulation"
Expand All @@ -266,7 +266,7 @@
{
"data": {
"text/plain": [
"'dbe1b9fd-afe0-42e8-b093-854035d4d518'"
"'95cd5adf-0ff7-4da2-9306-e63419f0200c'"
]
},
"execution_count": 7,
Expand Down Expand Up @@ -331,7 +331,7 @@
{
"data": {
"text/plain": [
"{'00': 47, '11': 53}"
"{'00': 49, '11': 51}"
]
},
"execution_count": 10,
Expand All @@ -340,7 +340,7 @@
}
],
"source": [
"job.counts()"
"job.counts(index=0)"
]
},
{
Expand All @@ -361,7 +361,7 @@
}
],
"source": [
"job.num_qubits()"
"job.num_qubits(index=0)"
]
},
{
Expand Down Expand Up @@ -392,29 +392,53 @@
"metadata": {},
"outputs": [
{
"ename": "AttributeError",
"evalue": "'Job' object has no attribute 'input_circuit'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[13], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mjob\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minput_circuit\u001b[49m(index\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m)\n",
"\u001b[0;31mAttributeError\u001b[0m: 'Job' object has no attribute 'input_circuit'"
]
"data": {
"text/html": [
"<pre style=\"overflow: auto; white-space: pre;\">0: ───H───@───M───\n",
"\n",
"1: ───────X───M───</pre>"
],
"text/plain": [
"0: ───H───@───M───\n",
"\n",
"1: ───────X───M───"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"job.input_circuit(index=0)"
"job.input_circuits(index=0)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 14,
"id": "d9882d03",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/html": [
"<pre style=\"overflow: auto; white-space: pre;\">0: ───cirq.circuits.qasm_output.QasmUGate(theta=0.5, phi=0.0, lmda=1.0)───@───M───\n",
"\n",
"1: ───────────────────────────────────────────────────────────────────────X───M───</pre>"
],
"text/plain": [
"0: ───cirq.circuits.qasm_output.QasmUGate(theta=0.5, phi=0.0, lmda=1.0)───@───M───\n",
"\n",
"1: ───────────────────────────────────────────────────────────────────────X───M───"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"job.compiled_circuit(index=0)"
"job.compiled_circuits(index=0)"
]
},
{
Expand All @@ -427,20 +451,33 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 15,
"id": "560076e9",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"[0: ───H───@───M───\n",
"\n",
"1: ───────X───M───]"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"job_id = job.job_id() # Here we use the job ID from above, but this can be any old job ID\n",
"job_old = service.get_job(job_id)\n",
"job_old.input_circuit()"
"job_old.input_circuits()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -454,7 +491,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.9.16"
}
},
"nbformat": 4,
Expand Down

0 comments on commit d301c28

Please sign in to comment.