bloqade.analog.builder.waveform.Recordable
classRecordable¶source
bloqade.analog.builder.waveform.Recordable
class Recordablemethodrecord¶source
bloqade.analog.builder.waveform.Recordable.record
def record(name: str) -> RecordCopy or “record” the value at the end of the waveform into a variable so that it can be used in another place.
A common design pattern is to couple this with .slice() considering
you may not know exactly what the end value of a .slice() is,
especially in parameter sweeps where it becomes cumbersome to handle.
If you specified a spatial modulation (e.g. uniform, location,scale)
previously without a waveform you will now have completed the construction
of a “drive”, one or a sum of drives creating a “field”
(e.g. Real-valued Rabi Amplitude/Phase).
If you have already specified a waveform previously you will now be appending this waveform to that previous waveform.
Usage Example:
Section titled “Usage Example:”# define program of interest>>> from bloqade import start>>> prog = start.rydberg.rabi.amplitude.uniform>>> prog_with_wf = prog.piecewise_linear(durations=[0.3, 2.0, 0.3],values=[0.0, 2.0, 2.0, 0.0])# We now slice the piecewise_linear from above and record the# value at the end of that slice. We then use that value# to construct a new waveform that can be appended to the previous# one without introducing discontinuity (refer to the# "Quantum Scar Dynamics" tutorial for how this could be handy)>>> prog_with_record = prog_with_wf.slice(0.0, 1.0).record("end_of_wf")>>> record_applied_prog = prog_with_record.linear(start="end_of_wf", stop=0.0, duration=0.3)- Your next steps include:
- Continue building your waveform via:
...slice(start, stop).linear(start, stop, duration): to append another linear waveform...slice(start, stop).constant(value, duration): to append a constant waveform...slice(start, stop).piecewise_linear(): to append a piecewise linear waveform...slice(start, stop).piecewise_constant(): to append a piecewise constant waveform...slice(start, stop).poly([coefficients], duration): to append a polynomial waveform...slice(start, stop).apply(wf:bloqade.ir.Waveform): to append a pre-defined waveform...slilce(start, stop).fn(f(t,...)): to append a waveform defined by a python function
- Begin constructing another drive by starting a new spatial modulation
(this drive will be summed to the one you just created):
...slice(start, stop).uniform: To address all atoms in the field...slice(start, stop).location(int): To address an atom at a specific location via index...slice(start, stop).scale(str)- To address an atom at a specific location via variable
- To address multiple atoms at specific locations by specifying a single variable and then assigning it a list of coordinates
- Assign values to pre-existing variables via:
...slice(start, stop).assign(variable_name = value): to assign a single value to a variable...slice(start, stop) .batch_assign(variable_name = [value1, ...]): to assign multiple values to a variable...slice(start, stop).args(["previously_defined_var"]): to defer assignment of a variable to execution time
- Select the backend you want your program to run on via:
...slice(start, stop).braket: to run on Braket local emulator or QuEra hardware remotely...slice(start, stop).bloqade: to run on the Bloqade local emulator...slice(start, stop).device: to specify the backend via string
- Choose to parallelize your atom geometry,
duplicating it to fill the whole space:
...slice(start, stop).parallelize(spacing)
- Start targeting another level coupling
...slice(start, stop).rydberg: to target the Rydberg level coupling...slice(start, stop).hyperfine: to target the Hyperfine level coupling
- Start targeting other fields within your current level coupling
(previously selected as
rydbergorhyperfine):...slice(start, stop).amplitude: to target the real-valued Rabi Amplitude field...slice(start, stop).phase: to target the real-valued Rabi Phase field...slice(start, stop).detuning: to target the Detuning field...slice(start, stop).rabi: to target the complex-valued Rabi field
Parameters
| Name | Type | Description |
|---|---|---|
name | str |
Returns
Record