diff --git a/doc/decorators.md b/doc/decorators.md index 89ad017..d58f7d9 100644 --- a/doc/decorators.md +++ b/doc/decorators.md @@ -108,9 +108,9 @@ def cal_1(theta: float): # The calibration is applicable for any rotation angle, # so we accept it as an input argument pulse.barrier("$0") - pulse.shift_frequency(q0_rf_frame, -321047.14178613486) - pulse.play(q0_rf_frame, waveform(theta)) - pulse.shift_frequency(q0_rf_frame, 321047.14178613486) + pulse.shift_frequency(control_frame, -321047.14178613486) + pulse.play(control_frame, waveform(theta)) + pulse.shift_frequency(control_frame, 321047.14178613486) pulse.barrier("$0") ``` diff --git a/examples/5_Pulse_programming_and_dynamical_decoupling.ipynb b/examples/5_Pulse_programming_and_dynamical_decoupling.ipynb index 3dbf1cf..aa5237b 100644 --- a/examples/5_Pulse_programming_and_dynamical_decoupling.ipynb +++ b/examples/5_Pulse_programming_and_dynamical_decoupling.ipynb @@ -23,7 +23,7 @@ "id": "2eeb58e3", "metadata": {}, "source": [ - "We start with basic imports, and initialize the Rigetti Aspen-M-3 device which is the targeted device for this example notebook." + "We start with basic imports, and initialize the Rigetti Ankaa-2 device which is the targeted device for this example notebook." ] }, { @@ -53,7 +53,7 @@ "metadata": {}, "outputs": [], "source": [ - "device = AwsDevice(Devices.Rigetti.AspenM3)" + "device = AwsDevice(Devices.Rigetti.Ankaa2)" ] }, { @@ -70,7 +70,7 @@ "metadata": {}, "source": [ "## Customize delay with pulse programming\n", - "As a hello-world example, the pulse program below includes a `delay` instruction on the frame of the physical qubit `$0` followed by a capture instruction on the same frame. The pulse program represents measuring a qubit after a variable idling duration. It can be used quantify the decoherence of a qubit by comparing the measured state and the initial state after certain idling duration." + "As a hello-world example, the pulse program below includes a `delay` instruction on the drive frame of the physical qubit `$0` followed by a capture instruction on the readout frame of the same qubit. The pulse program represents measuring a qubit after a variable idling duration. It can be used to quantify the decoherence of a qubit by comparing the measured state and the initial state after a certain idling duration." ] }, { @@ -86,9 +86,11 @@ "\n", "@aq.main\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)" + " drive_frame = device.frames[f\"Transmon_{qubit}_charge_tx\"]\n", + " pulse.delay(drive_frame, idle_duration)\n", + "\n", + " readout_frame = device.frames[f\"Transmon_{qubit}_readout_rx\"]\n", + " pulse.capture_v0(readout_frame)" ] }, { @@ -112,8 +114,8 @@ "OPENQASM 3.0;\n", "bit __bit_0__;\n", "cal {\n", - " delay[10.0us] q0_rf_frame;\n", - " __bit_0__ = capture_v0(q0_rf_frame);\n", + " delay[10.0us] Transmon_0_charge_tx;\n", + " __bit_0__ = capture_v0(Transmon_0_readout_rx);\n", "}\n" ] } @@ -151,7 +153,7 @@ "id": "814647c1", "metadata": {}, "source": [ - "First, we create the X and Y $\\pi$ pulse in terms of the native gates of Rigetti Aspen-M-3 device. " + "First, we create the X and Y $\\pi$ pulse in terms of the native gates of Rigetti Ankaa-2 device. " ] }, { @@ -206,19 +208,19 @@ "def idle_with_dd():\n", " dd_spacing = idle_duration / (4 * n_cycles)\n", "\n", - " control_frame = device.frames[f\"q{qubit}_rf_frame\"]\n", + " drive_frame = device.frames[f\"Transmon_{qubit}_charge_tx\"]\n", "\n", - " pulse.delay(control_frame, dd_spacing)\n", + " pulse.delay(drive_frame, dd_spacing)\n", " for _ in aq.range(n_cycles):\n", " x_pulse(qubit)\n", - " pulse.delay(control_frame, 2 * dd_spacing)\n", + " pulse.delay(drive_frame, 2 * dd_spacing)\n", " y_pulse(qubit)\n", - " pulse.delay(control_frame, 2 * dd_spacing)\n", + " pulse.delay(drive_frame, 2 * dd_spacing)\n", " x_pulse(qubit)\n", - " pulse.delay(control_frame, 2 * dd_spacing)\n", + " pulse.delay(drive_frame, 2 * dd_spacing)\n", " y_pulse(qubit)\n", "\n", - " pulse.delay(control_frame, dd_spacing)" + " pulse.delay(drive_frame, dd_spacing)" ] }, { @@ -241,29 +243,29 @@ "text": [ "OPENQASM 3.0;\n", "cal {\n", - " delay[833.333333333333ns] q0_rf_frame;\n", + " delay[833.333333333333ns] Transmon_0_charge_tx;\n", "}\n", "for int _ in [0:3 - 1] {\n", " rx(3.141592653589793) $0;\n", " cal {\n", - " delay[1.666666666667us] q0_rf_frame;\n", + " delay[1.666666666667us] Transmon_0_charge_tx;\n", " }\n", " rz(-1.5707963267948966) $0;\n", " rx(3.141592653589793) $0;\n", " rz(1.5707963267948966) $0;\n", " cal {\n", - " delay[1.666666666667us] q0_rf_frame;\n", + " delay[1.666666666667us] Transmon_0_charge_tx;\n", " }\n", " rx(3.141592653589793) $0;\n", " cal {\n", - " delay[1.666666666667us] q0_rf_frame;\n", + " delay[1.666666666667us] Transmon_0_charge_tx;\n", " }\n", " rz(-1.5707963267948966) $0;\n", " rx(3.141592653589793) $0;\n", " rz(1.5707963267948966) $0;\n", "}\n", "cal {\n", - " delay[833.333333333333ns] q0_rf_frame;\n", + " delay[833.333333333333ns] Transmon_0_charge_tx;\n", "}\n" ] } diff --git a/examples/6_Customize_gate_calibrations.ipynb b/examples/6_Customize_gate_calibrations.ipynb index 64cfc9a..c0b14fa 100644 --- a/examples/6_Customize_gate_calibrations.ipynb +++ b/examples/6_Customize_gate_calibrations.ipynb @@ -9,7 +9,7 @@ "\n", "The pulse implementation of a gate is called \"gate calibration\". Gaining access to gate calibrations empowers you to experiment with quantum gate designs and execute quantum programs with customized, improved gate calibrations. This notebook shows you how to access the native gate calibrations provided by quantum hardware providers, and shows you how to define custom gate calibrations for your quantum programs.\n", "\n", - "We start with basic imports, and initialize the Rigetti Aspen-M-3 device which is the targeted device for this example notebook." + "We start with basic imports, and initialize the Rigetti Ankaa-2 device which is the targeted device for this example notebook." ] }, { @@ -41,7 +41,7 @@ "metadata": {}, "outputs": [], "source": [ - "device = AwsDevice(Devices.Rigetti.AspenM3)" + "device = AwsDevice(Devices.Rigetti.Ankaa2)" ] }, { @@ -90,11 +90,9 @@ "text": [ "OPENQASM 3.0;\n", "cal {\n", - " waveform wf_drag_gaussian_1 = drag_gaussian(24.0ns, 2.547965400864ns, 2.3223415460834803e-10, 0.28585537029609, false);\n", + " waveform wf_drag_gaussian_153 = drag_gaussian(40.0ns, 8.49321800288ns, -2.618211817882948e-10, 0.19930451095449803, false);\n", " barrier $0;\n", - " shift_frequency(q0_rf_frame, -321047.14178613486);\n", - " play(q0_rf_frame, wf_drag_gaussian_1);\n", - " shift_frequency(q0_rf_frame, 321047.14178613486);\n", + " play(Transmon_0_charge_tx, wf_drag_gaussian_153);\n", " barrier $0;\n", "}\n" ] @@ -127,12 +125,7 @@ "OPENQASM 3.0;\n", "cal {\n", " input float theta;\n", - " barrier $1;\n", - " shift_phase(q1_rf_frame, -1.0 * theta);\n", - " shift_phase(q0_q1_xy_frame, 0.5 * theta);\n", - " shift_phase(q1_q2_xy_frame, 0.5 * theta);\n", - " shift_phase(q1_q16_xy_frame, 0.5 * theta);\n", - " barrier $1;\n", + " shift_phase(Transmon_1_charge_tx, -1.0 * theta);\n", "}\n" ] } @@ -202,15 +195,15 @@ "wf = DragGaussianWaveform(\n", " 24e-9, 2.547965400864e-9, 2.370235498840002e-10, 0.293350447987059, False, \"wf_drag_gaussian_1\"\n", ")\n", - "q0_rf_frame = device.frames[\"q0_rf_frame\"]\n", + "q0_control_frame = device.frames[\"Transmon_0_charge_tx\"]\n", "\n", "\n", "@aq.gate_calibration(implements=rx, target=\"$0\", theta=np.pi / 2)\n", "def my_rx_cal():\n", " pulse.barrier(\"$0\")\n", - " pulse.shift_frequency(q0_rf_frame, -321047.14178613486 - 100)\n", - " pulse.play(q0_rf_frame, wf)\n", - " pulse.shift_frequency(q0_rf_frame, 321047.14178613486 + 100)\n", + " pulse.shift_frequency(q0_control_frame, -321047.14178613486 - 100)\n", + " pulse.play(q0_control_frame, wf)\n", + " pulse.shift_frequency(q0_control_frame, 321047.14178613486 + 100)\n", " pulse.barrier(\"$0\")" ] }, @@ -277,9 +270,9 @@ "}\n", "defcal rx(1.5707963267948966) $0 {\n", " barrier $0;\n", - " shift_frequency(q0_rf_frame, -321147.14178613486);\n", - " play(q0_rf_frame, wf_drag_gaussian_1);\n", - " shift_frequency(q0_rf_frame, 321147.14178613486);\n", + " shift_frequency(Transmon_0_charge_tx, -321147.14178613486);\n", + " play(Transmon_0_charge_tx, wf_drag_gaussian_1);\n", + " shift_frequency(Transmon_0_charge_tx, 321147.14178613486);\n", " barrier $0;\n", "}\n", "rx(1.5707963267948966) $0;\n", @@ -309,13 +302,13 @@ "metadata": {}, "outputs": [], "source": [ - "q1_rf_frame = device.frames[\"q1_rf_frame\"]\n", + "q1_control_frame = device.frames[\"Transmon_1_charge_tx\"]\n", "\n", "\n", "@aq.gate_calibration(implements=rz, target=\"$1\")\n", "def my_rz_cal(theta: float):\n", " pulse.barrier(\"$1\")\n", - " pulse.shift_frequency(q1_rf_frame, -1.0 * theta)\n", + " pulse.shift_frequency(q1_control_frame, -1.0 * theta)\n", " pulse.barrier(\"$1\")" ] }, @@ -343,14 +336,14 @@ "}\n", "defcal rx(1.5707963267948966) $0 {\n", " barrier $0;\n", - " shift_frequency(q0_rf_frame, -321147.14178613486);\n", - " play(q0_rf_frame, wf_drag_gaussian_1);\n", - " shift_frequency(q0_rf_frame, 321147.14178613486);\n", + " shift_frequency(Transmon_0_charge_tx, -321147.14178613486);\n", + " play(Transmon_0_charge_tx, wf_drag_gaussian_1);\n", + " shift_frequency(Transmon_0_charge_tx, 321147.14178613486);\n", " barrier $0;\n", "}\n", "defcal rz(angle[32] theta) $1 {\n", " barrier $1;\n", - " shift_frequency(q1_rf_frame, -1.0 * theta);\n", + " shift_frequency(Transmon_1_charge_tx, -1.0 * theta);\n", " barrier $1;\n", "}\n", "rx(1.5707963267948966) $0;\n",