Skip to content

Commit

Permalink
update example 5
Browse files Browse the repository at this point in the history
  • Loading branch information
ajberdy committed Nov 28, 2023
1 parent 448fda4 commit 55e2e7b
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"\n",
"import braket.experimental.autoqasm as aq\n",
"from braket.experimental.autoqasm import pulse\n",
"from braket.experimental.autoqasm.instructions import rx, rz, measure\n",
"from braket.experimental.autoqasm.instructions import rx, rz\n",
"\n",
"from braket.aws import AwsDevice\n",
"from braket.devices import Devices\n",
Expand Down Expand Up @@ -69,8 +69,12 @@
"metadata": {},
"outputs": [],
"source": [
"# TODO: determine if this example should make these variables inputs to the program\n",
"qubit = 0\n",
"idle_duration = 10e-6\n",
"\n",
"@aq.main\n",
"def idle(qubit: int, idle_duration: float):\n",
"def idle():\n",
" control_frame = device.frames[f\"q{qubit}_rf_frame\"]\n",
" pulse.delay(control_frame, idle_duration)\n",
" pulse.capture_v0(control_frame)"
Expand Down Expand Up @@ -104,7 +108,7 @@
}
],
"source": [
"print(idle(0, 10e-6).to_ir())"
"print(idle.to_ir())"
]
},
{
Expand Down Expand Up @@ -180,8 +184,12 @@
"metadata": {},
"outputs": [],
"source": [
"qubit = 0\n",
"idle_duration = 10e-6\n",
"n_cycles = 3\n",
"\n",
"@aq.main\n",
"def idle_with_dd(qubit: int, idle_duration: float, n_cycles: int = 1) -> None:\n",
"def idle_with_dd():\n",
" dd_spacing = idle_duration / (4*n_cycles)\n",
"\n",
" control_frame = device.frames[f\"q{qubit}_rf_frame\"]\n",
Expand Down Expand Up @@ -247,7 +255,7 @@
}
],
"source": [
"print(idle_with_dd(0, 10e-6, 3).to_ir())"
"print(idle_with_dd.to_ir())"
]
},
{
Expand Down

0 comments on commit 55e2e7b

Please sign in to comment.