Pulse control on Amazon Braket - Amazon Braket

Pulse control on Amazon Braket

Pulses are the analog signals that control the qubits in a quantum computer. With certain devices on Amazon Braket, you can access the pulse control feature to submit circuits using pulses. You can access pulse control through the Braket SDK, using OpenQASM 3.0, or directly through the Braket APIs. First, let’s introduce some key concepts for pulse control in Braket.

Frames

A frame is a software abstraction that acts as both a clock within the quantum program and a phase. The clock time is incremented on each usage and a stateful carrier signal that is defined by a frequency. When transmitting signals to the qubit, a frame determines the qubit’s carrier frequency, phase offset, and the time at which the waveform envelope is emitted. In Braket Pulse, constructing frames depends on the device, frequency, and phase. Depending on the device, you can either choose a predefined frame or instantiate new frames by providing a port.

from braket.pulse import Frame # predefined frame from a device device = AwsDevice("arn:aws:braket:us-west-1::device/qpu/rigetti/Ankaa-2") drive_frame = device.frames["Transmon_5_charge_tx_frame"] # create a custom frame readout_frame = Frame(name="r0_measure", port=port0, frequency=5e9, phase=0)

Ports

A port is a software abstraction representing any input/output hardware component controlling qubits. It helps hardware vendors provide an interface with which users can interact to manipulate and observe qubits. Ports are characterized by a single string that represents the name of the connector. This string also exposes a minimum time increment that specifies how finely we can define the waveforms.

from braket.pulse import Port Port0 = Port("channel_0", dt=1e-9)

Waveforms

A waveform is a time-dependent envelope that we can use to emit signals on an output port or capture signals through an input port. You can specify your waveforms directly either through a list of complex numbers or by using a waveform template to generate a list from the hardware provider.

from braket.pulse import ArbitraryWaveform, ConstantWaveform cst_wfm = ConstantWaveform(length=1e-7, iq=0.1) arb_wf = ArbitraryWaveform(amplitudes=np.linspace(0, 100))

Braket Pulse provides a standard library of waveforms, including a constant waveform, a Gaussian waveform, and a Derivative Removal by Adiabatic Gate (DRAG) waveform. You can retrieve the waveform data through the sample function to draw the shape of the waveform as shown in the following example.

gaussian_waveform = GaussianWaveform(1e-7, 25e-9, 0.1) x = np.arange(0, gaussian_waveform.length, drive_frame.port.dt) plt.plot(x, gaussian_waveform.sample(drive_frame.port.dt))
Graph showing amplitude over time for two cases: ZaE = True (lower curve) and ZaE = False (top curve). The curves have a bell shape peaking around 0.5 seconds with an amplitude of 0.10 a. u..

The preceding image depicts the Gaussian waveforms created from GaussianWaveform. We chose a pulse length of 100 ns, a width of 25 ns, and an amplitude of 0.1 (arbitrary units). The waveforms are centered in the pulse window. GaussianWaveform accepts a boolean argument zero_at_edges (ZaE in the legend). When set to True, this argument offsets the Gaussian waveform such that the points at t=0 and t=length are at zero and rescales its amplitude such that the maximum value corresponds to the amplitude argument.

Now that we have covered the basic concepts for pulse-level access, next we’ll see how to construct a circuit using gates and pulses.