bloqade.analog.builder.waveform.Sliceable
← Module overview
class
method
source
classSliceable¶source
bloqade.analog.builder.waveform.Sliceable
class Sliceablemethodslice¶source
bloqade.analog.builder.waveform.Sliceable.slice
Signature
def slice(start: Optional[ScalarType] = None, stop: Optional[ScalarType] = None) -> SliceIndicate that you only want a portion of your waveform to be used in the program.
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 a program with a waveform of interest>>> from bloqade import start>>> prog = start.add_position((0,0)).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])# instead of using the full waveform we opt to only take the first 1 us>>> prog_with_slice = prog_with_wf.slice(0.0, 1.0)# you may use variables as well>>> prog_with_slice = prog_with_wf.slice("start", "end")- 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(...)- 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 | Default | Description |
|---|---|---|---|
start | Optional[ScalarType] | None | |
stop | Optional[ScalarType] | None |
Returns
Slice