Index
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.
AlignedWaveform ¶
Bases: Waveform
<padded waveform> ::= <waveform> | <waveform> <alignment> <value>
<alignment> ::= 'left aligned' | 'right aligned'
<value> ::= 'left value' | 'right value' | <scalar expr>
AnalogCircuit ¶
AnalogCircuit is a dummy type that bundle register and sequence together.
register property
¶
Get the register of the program.
Returns:
Type | Description |
---|---|
register (Union["AtomArrangement", "ParallelRegister"]) |
Note
If the program is built with [parallelize()
][bloqade.builder.emit.Emit.parallelize], The the register will be a ParallelRegister
. Otherwise it will be a AtomArrangement
.
show ¶
Interactive visualization of the program
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**assignments | assigning the instance value (literal) to the existing variables in the program | {} |
AtomArrangement ¶
Bases: ProgramStart
, TransformTrait
BoundedBravais ¶
Bases: AtomArrangement
Source code in src/bloqade/ir/location/bravais.py
__match_args__ class-attribute
instance-attribute
¶
Base classe for Bravais lattices AtomArrangement
.
n_dims property
¶
dimension of the lattice
Returns:
Name | Type | Description |
---|---|---|
int | dimension of the lattice |
coordinates ¶
calculate the coordinates of a cell in the lattice given the cell index.
Source code in src/bloqade/ir/location/bravais.py
scale ¶
Scale the current location with a factor.
(x,y) -> factor*(x,y)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
factor | str | Real | Decimal | Scalar | scale factor | required |
Returns:
Name | Type | Description |
---|---|---|
BoundedBravais | BoundedBravais | The lattice with the scaled locations |
Source code in src/bloqade/ir/location/bravais.py
Chain ¶
Bases: BoundedBravais
Chain lattice.
- 1D lattice
- primitive (cell) vector(s)
- a1 = (1,0).
- unit cell (1 atom(s))
- loc (0,0)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
L | int | number of sites in the chain | required |
lattice_spacing | (Scalar, Real) | lattice spacing. Defaults to 1.0. | 1.0 |
- Possible Next: continue with
.
to see possible next step in auto-prompt supported setting (IPython, IDE ...)
Source code in src/bloqade/ir/location/bravais.py
Constant ¶
Bases: Instruction
f(t=0:duration) = value
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value | Scalar | the constant value | required |
duration | Scalar | the time span of the constant waveform. | required |
Source code in src/bloqade/ir/control/waveform.py
Field ¶
Bases: FieldExpr
Field node in the IR. Which contains collection(s) of Waveform
canonicalize ¶
Canonicalize the Field by merging ScaledLocation
nodes with the same waveform.
Source code in src/bloqade/ir/control/field.py
show ¶
Interactive visualization of the Field
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**assignments | assigning the instance value (literal) to the existing variables in the Field | {} |
Honeycomb ¶
Bases: BoundedBravais
Honeycomb lattice.
- 2D lattice
- primitive (cell) vector(s)
- a1 = (1, 0)
- a2 = (½, sqrt(3)/2)
- unit cell (2 atom(s))
- loc1 (0, 0)
- loc2 (½, 1/(2*sqrt(3))
Parameters:
Name | Type | Description | Default |
---|---|---|---|
L | int | number of sites in linear direction. n_atoms = L * L * 2. | required |
lattice_spacing | (Scalar, Real) | lattice spacing. Defaults to 1.0. | 1.0 |
- Possible Next: continue with
.
to see possible next step in auto-prompt supported setting (IPython, IDE ...)
Source code in src/bloqade/ir/location/bravais.py
Kagome ¶
Bases: BoundedBravais
Kagome lattice.
- 2D lattice
- primitive (cell) vector(s)
- a1 = (1, 0)
- a2 = (½, sqrt(3)/2)
- unit cell (3 atom(s))
- loc1 (0, 0)
- loc2 (0.5, 0)
- loc3 (0.25 ,0.25sqrt(3))
Parameters:
Name | Type | Description | Default |
---|---|---|---|
L | int | number of sites in linear direction. n_atoms = L * L. | required |
lattice_spacing | (Scalar, Real) | lattice spacing. Defaults to 1.0. | 1.0 |
- Possible Next: continue with
.
to see possible next step in auto-prompt supported setting (IPython, IDE ...)
Source code in src/bloqade/ir/location/bravais.py
Lieb ¶
Bases: BoundedBravais
Lieb lattice.
- 2D lattice
- primitive (cell) vector(s)
- a1 = (1, 0)
- a2 = (0, 1)
- unit cell (3 atom(s))
- loc1 (0, 0)
- loc2 (0.5, 0)
- loc3 (0 ,0.5)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
L | int | number of sites in linear direction. n_atoms = L * L. | required |
lattice_spacing | (Scalar, Real) | lattice spacing. Defaults to 1.0. | 1.0 |
- Possible Next: continue with
.
to see possible next step in auto-prompt supported setting (IPython, IDE ...)
Source code in src/bloqade/ir/location/bravais.py
Linear ¶
Bases: Instruction
f(t=0:duration) = start + (stop-start)/duration * t
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start | Scalar | start value | required |
stop | Scalar | stop value | required |
duration | Scalar | the time span of the linear waveform. | required |
Source code in src/bloqade/ir/control/waveform.py
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 |
ParallelRegister ¶
Bases: ProgramStart
Parallel Register
Source code in src/bloqade/ir/location/base.py
Poly ¶
Bases: Instruction
f(t=0:duration) = c[0] + c[1]t + c[2]t^2 + ... + c[n-1]t^n-1 + c[n]t^n
Parameters:
Name | Type | Description | Default |
---|---|---|---|
coeffs | List[Scalar] | the coefficients c[] of the polynomial. | required |
duration | Scalar | the time span of the waveform. | required |
Source code in src/bloqade/ir/control/waveform.py
Pulse ¶
PythonFn ¶
Rectangular ¶
Bases: BoundedBravais
Rectangular lattice.
- 2D lattice
- primitive (cell) vector(s)
- a1 = (1,0)
- a2 = (0,1)
- unit cell (1 atom(s))
- loc (0,0)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
width | int | number of sites in x direction. | required |
height | int | number of sites in y direction. | required |
lattice_spacing_x | (Scalar, Real) | lattice spacing. Defaults to 1.0. | 1.0 |
lattice_spacing_y | (Scalar, Real) | lattice spacing in y direction. optional. | None |
- Possible Next: continue with
.
to see possible next step in auto-prompt supported setting (IPython, IDE ...)
Source code in src/bloqade/ir/location/bravais.py
Scalar ¶
Base class for all scalar expressions.
<scalar> ::= <literal>
| <variable>
| <default>
| <negative>
| <add>
| <mul>
| <min>
| <max>
| <slice>
| <inverval>
<mul> ::= <scalar> '*' <scalar>
<add> ::= <scalar> '+' <scalar>
<min> ::= 'min' <scalar>+
<max> ::= 'max' <scalar>+
<slice> ::= <scalar expr> '[' <interval> ']'
<interval> ::= <scalar expr> '..' <scalar expr>
<real> ::= <literal> | <var>
Sequence ¶
Bases: SequenceExpr
Sequence of a program, which includes pulses informations.
Source code in src/bloqade/ir/control/sequence.py
show ¶
Interactive visualization of the Sequence
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**assignments | assigning the instance value (literal) to the existing variables in the Sequence | {} |
Source code in src/bloqade/ir/control/sequence.py
Square ¶
Bases: BoundedBravais
Square lattice.
- 2D lattice
- primitive (cell) vector(s)
- a1 = (1,0)
- a2 = (0,1)
- unit cell (1 atom(s))
- loc (0,0)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
L | int | number of sites in linear direction. n_atoms = L * L. | required |
lattice_spacing | (Scalar, Real) | lattice spacing. Defaults to 1.0. | 1.0 |
- Possible Next: continue with
.
to see possible next step in auto-prompt supported setting (IPython, IDE ...)
Source code in src/bloqade/ir/location/bravais.py
Triangular ¶
Bases: BoundedBravais
Triangular lattice.
- 2D lattice
- primitive (cell) vector(s)
- a1 = (1, 0)
- a2 = (½, sqrt(3)/2)
- unit cell (1 atom(s))
- loc (0, 0)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
L | int | number of sites in linear direction. n_atoms = L * L. | required |
lattice_spacing | (Scalar, Real) | lattice spacing. Defaults to 1.0. | 1.0 |
- Possible Next: continue with
.
to see possible next step in auto-prompt supported setting (IPython, IDE ...)
Source code in src/bloqade/ir/location/bravais.py
Variable ¶
Bases: Real
Variable, which stores a variable name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | variable instance. | required |
Waveform ¶
Waveform node in the IR.
<waveform> ::= <instruction>
| <smooth>
| <slice>
| <append>
| <negative>
| <scale>
| <add>
| <record>
| <sample>
figure ¶
get figure of the plotting the waveform.
Returns:
Name | Type | Description |
---|---|---|
figure | a bokeh figure |
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
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] |