Index
RB_C6 module-attribute
¶
The C6 constant for the Rydberg Interaction of two Rubidium atoms in units of: rad μm^6/μs
start module-attribute
¶
A Program starting point, alias of empty [ListOfLocations
][bloqade.ir.location.list.ListOfLocations].
- Next possible steps to build your program are:
- Specify which level coupling to address with:
- continue/start building your geometry with:
start.add_position()
: to add atom(s) to current register. It will accept:- A single coordinate, represented as a tuple (e.g.
(5,6)
) with a value that can either be:- integers:
(5,6)
- floats:
(5.1, 2.5)
- strings (for later variable assignment):
("x", "y")
Scalar
objects:(2*cast("x"), 5+cast("y"))
- integers:
- A list of coordinates, represented as a list of types mentioned previously.
- A numpy array with shape (n, 2) where n is the total number of atoms
- A single coordinate, represented as a tuple (e.g.
Literal ¶
Bases: Real
value instance-attribute
¶
Scalar Literal, which stores a decimaal value instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value | Decimal | decimal value instance | required |
Variable ¶
Bases: Real
Variable, which stores a variable name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | variable instance. | required |
cast ¶
-
cast Real number (or list/tuple of Real numbers) to
Scalar Literal
. -
cast str (or list/tuple of Real numbers) to
Scalar Variable
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
py | Union[str, Real, Tuple[Real], List[Real]] | python object to cast | required |
Returns:
Type | Description |
---|---|
Scalar | Scalar |
Source code in src/bloqade/ir/scalar.py
constant ¶
Create a Constant waveform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration | ScalarType | Duration of the Constant waveform. | required |
value | ScalarType | Value of the Constant waveform.s | required |
Returns:
Name | Type | Description |
---|---|---|
Constant | Constant | A Constant waveform. |
Source code in src/bloqade/factory.py
dumps ¶
Serialize object to string
Parameters:
Name | Type | Description | Default |
---|---|---|---|
o | Any | the object to serialize | required |
use_decimal | bool | use decimal.Decimal for numbers. Defaults to True. | True |
**json_kwargs | other arguments passed to json.dumps | {} |
Returns:
Name | Type | Description |
---|---|---|
str | str | the serialized object as a string |
Source code in src/bloqade/serialize.py
linear ¶
Create a Linear waveform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration | ScalarType | Duration of linear waveform | required |
start | ScalarType | Starting value of linear waveform | required |
stop | ScalarType | Ending value of linear waveform | required |
Returns:
Name | Type | Description |
---|---|---|
Linear | Linear | Linear waveform |
Source code in src/bloqade/factory.py
load ¶
Load object from file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fp | Union[TextIO, str] | the file path or file object | required |
use_decimal | bool | use decimal.Decimal for numbers. Defaults to True. | True |
**json_kwargs | other arguments passed to json.load | {} |
Returns:
Name | Type | Description |
---|---|---|
Any | the deserialized object |
Source code in src/bloqade/serialize.py
loads ¶
Load object from string
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s | str | the string to load | required |
use_decimal | bool | use decimal.Decimal for numbers. Defaults to True. | True |
**json_kwargs | other arguments passed to json.loads | {} |
Returns:
Name | Type | Description |
---|---|---|
Any | the deserialized object |
Source code in src/bloqade/serialize.py
piecewise_constant ¶
Create a piecewise linear waveform.
Create a piecewise constant waveform from a list of durations and values. The value duration[i]
corresponds to the length of time for the i'th segment with a value of values[i]
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
durations | List[ScalarType] | The duration of each segment | required |
values | List[ScalarType] | The values for each segment | required |
Raises:
Type | Description |
---|---|
ValueError | If the length of |
Returns:
Name | Type | Description |
---|---|---|
Waveform | Waveform | The piecewise linear waveform. |
Source code in src/bloqade/factory.py
piecewise_linear ¶
Create a piecewise linear waveform.
Create a piecewise linear waveform from a list of durations and values. The value duration[i]
is of the linear segment between values[i]
and values[i+1]
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
durations | List[ScalarType] | The duration of each segment | required |
values | List[ScalarType] | The values for each segment | required |
Raises:
Type | Description |
---|---|
ValueError | If the length of |
Returns:
Name | Type | Description |
---|---|---|
Waveform | Waveform | The piecewise linear waveform. |
Source code in src/bloqade/factory.py
rydberg_h ¶
rydberg_h(
atoms_positions,
detuning=None,
amplitude=None,
phase=None,
static_params={},
batch_params=[],
args=[],
)
Create a rydberg program with uniform detuning, amplitude, and phase.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
atoms_positions | Any | Description of geometry of atoms in system. | required |
detuning | Optional[Waveform] | Waveform for detuning. Defaults to None. | None |
amplitude | Optional[Waveform] | Waveform describing the amplitude of the rabi term. Defaults to None. | None |
phase | Optional[Waveform] | Waveform describing the phase of rabi term. Defaults to None. | None |
static_params | Dict[str, Any] | Define static parameters of your program. Defaults to {}. | {} |
batch_params | Union[List[Dict[str, Any]], Dict[str, Any]] | Parmaters for a batch of tasks. Defaults to []. | [] |
args | List[str] | List of arguments to leave till runtime. Defaults to []. | [] |
Returns:
Name | Type | Description |
---|---|---|
Routine | Routine | An object that can be used to dispatch a rydberg program to multiple backends. |
Source code in src/bloqade/factory.py
save ¶
Serialize object to file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
o | Any | the object to serialize | required |
fp | Union[TextIO, str] | the file path or file object | required |
use_decimal | bool | use decimal.Decimal for numbers. Defaults to True. | True |
**json_kwargs | other arguments passed to json.dump | {} |
Returns:
Type | Description |
---|---|
None | None |
Source code in src/bloqade/serialize.py
tree_depth ¶
Setting globally maximum depth for tree printing
If depth=None
, return current depth. If depth
is provided, setting current depth to depth
Parameters:
Name | Type | Description | Default |
---|---|---|---|
depth | int | the user specified depth. Defaults to None. | None |
Returns:
Name | Type | Description |
---|---|---|
int | current updated depth |
Source code in src/bloqade/__init__.py
var ¶
cast string (or list/tuple of strings) to Variable
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
py | Union[str, List[str]] | a string or list/tuple of strings | required |
Returns:
Type | Description |
---|---|
Variable | Union[Variable] |