Skip to content
This repository was archived by the owner on Aug 21, 2023. It is now read-only.

Commit f83617c

Browse files
committed
Properties section, done
1 parent 8f7e2ae commit f83617c

1 file changed

Lines changed: 45 additions & 21 deletions

File tree

qiskit/advanced/terra/programming_with_pulses/gathering_system_information.ipynb

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -259,48 +259,72 @@
259259
"cell_type": "markdown",
260260
"metadata": {},
261261
"source": [
262-
"It is a matter of style and personal preference whether you use `config.drive(0)` or `DriveChannel(0)`."
262+
"It is a matter of style and personal preference whether you use `config.drive(0)` or `DriveChannel(0)`.\n",
263+
"\n",
264+
"## Properties\n",
265+
"\n",
266+
"The `backend` properties contain data that was measured and optionally reported by the provider. Let's see what kind of information is reported for qubit 0."
263267
]
264268
},
265269
{
266-
"cell_type": "markdown",
270+
"cell_type": "code",
271+
"execution_count": 10,
267272
"metadata": {},
273+
"outputs": [],
268274
"source": [
269-
"## Properties"
275+
"props = backend.properties()"
270276
]
271277
},
272278
{
273279
"cell_type": "code",
274-
"execution_count": 10,
280+
"execution_count": 11,
275281
"metadata": {},
276-
"outputs": [],
282+
"outputs": [
283+
{
284+
"name": "stdout",
285+
"output_type": "stream",
286+
"text": [
287+
"Qubit 0 has a \n",
288+
" - T1 time of 179.20855318949387 microseconds\n",
289+
" - T2 time of 207.08071658715147 microseconds\n",
290+
" - U2 gate error of 0.0006168554137126238\n",
291+
" - U2 gate duration of 142.22222222222226 nanoseconds\n",
292+
" - resonant frequency of 4.9742936409604575 GHz\n"
293+
]
294+
}
295+
],
277296
"source": [
278-
"# Conversions from standard SI\n",
279-
"us = 1e6\n",
280-
"GHz = 1e-9\n",
281-
"props = backend.properties()\n",
282-
"# Qubit 0 T1 time in microsec\n",
283-
"q0_t1_us = props.t1(0) * us\n",
284-
"# Qubit 0 T2 time in microsec\n",
285-
"q0_t2_us = props.t2(0) * us\n",
286-
"# # Gate error for CNOT on qubits 0, 1\n",
287-
"# cx_error = props.gate_error('cx', (0, 1))\n",
288-
"# Resonant frequency of qubit 0\n",
289-
"q2_freq_ghz = props.frequency(0) * GHz\n",
290-
"# Duration of the X gate on qubit 0\n",
291-
"q1_x_duration_us = props.gate_length('u2', 0) * us"
297+
"def describe_qubit(qubit, properties):\n",
298+
" \"\"\"Print a string describing some of reported properties of the given qubit.\"\"\"\n",
299+
"\n",
300+
" # Conversion factors from standard SI units\n",
301+
" us = 1e6\n",
302+
" ns = 1e9\n",
303+
" GHz = 1e-9\n",
304+
"\n",
305+
" print(f\"Qubit {qubit} has a \\n\"\n",
306+
" f\" - T1 time of {properties.t1(qubit) * us} microseconds\\n\"\n",
307+
" f\" - T2 time of {properties.t2(qubit) * us} microseconds\\n\"\n",
308+
" f\" - U2 gate error of {properties.gate_error('u2', qubit)}\\n\"\n",
309+
" f\" - U2 gate duration of {properties.gate_length('u2', qubit) * ns} nanoseconds\\n\"\n",
310+
" f\" - resonant frequency of {properties.frequency(qubit) * GHz} GHz\")\n",
311+
"\n",
312+
"describe_qubit(0, props)"
292313
]
293314
},
294315
{
295316
"cell_type": "markdown",
296317
"metadata": {},
297318
"source": [
298-
"## Defaults"
319+
"Properties are not guaranteed to be reported, but backends without Pulse access typically also provide this data.\n",
320+
"\n",
321+
"## Defaults\n",
322+
"\n"
299323
]
300324
},
301325
{
302326
"cell_type": "code",
303-
"execution_count": 11,
327+
"execution_count": 12,
304328
"metadata": {},
305329
"outputs": [
306330
{

0 commit comments

Comments
 (0)