AtomArrangement
- class braket.ahs.atom_arrangement.SiteType(*values)[source]
Bases:
Enum- VACANT = 'Vacant'
- FILLED = 'Filled'
- class braket.ahs.atom_arrangement.AtomArrangementItem(coordinate, site_type)[source]
Bases:
objectRepresents an item (coordinate and metadata) in an atom arrangement.
- Parameters:
coordinate (
tuple[Number,Number])site_type (
SiteType)
- coordinate: tuple[Number, Number]
- class braket.ahs.atom_arrangement.AtomArrangement[source]
Bases:
objectRepresents a set of coordinates that can be used as a register to an AnalogHamiltonianSimulation.
- add(coordinate, site_type=SiteType.FILLED)[source]
Add a coordinate to the atom arrangement.
- Parameters:
coordinate (tuple[Number, Number] | np.ndarray) – The coordinate of the atom (in meters). The coordinates can be a numpy array of shape (2,) or a tuple of int, float, Decimal
site_type (SiteType) – The type of site. Optional. Default is FILLED.
- Return type:
- Returns:
AtomArrangement – returns self (to allow for chaining).
- coordinate_list(coordinate_index)[source]
Returns all the coordinates at the given index.
- Parameters:
coordinate_index (Number) – The index to get for each coordinate.
- Return type:
list[Number]- Returns:
list[Number] – The list of coordinates at the given index.
Example
To get a list of all x-coordinates: coordinate_list(0) To get a list of all y-coordinates: coordinate_list(1)
- discretize(properties)[source]
Creates a discretized version of the atom arrangement, rounding all site coordinates to the closest multiple of the resolution. The types of the sites are unchanged.
- Parameters:
properties (DiscretizationProperties) – Capabilities of a device that represent the resolution with which the device can implement the parameters.
- Raises:
DiscretizationError – If unable to discretize the program.
- Return type:
- Returns:
AtomArrangement – A new discretized atom arrangement.
- classmethod from_square_lattice(spacing, canvas, site_type=SiteType.FILLED)[source]
Create a square lattice arrangement within a canvas.
- Parameters:
- Return type:
- Returns:
AtomArrangement – A new atom arrangement with atoms placed in a square lattice.
- Raises:
ValueError – If spacing is not positive.
- classmethod from_rectangular_lattice(spacing_x, spacing_y, canvas, site_type=SiteType.FILLED)[source]
Create a rectangular lattice arrangement within a canvas.
- Parameters:
spacing_x (Number) – Distance between adjacent atoms in x direction in meters.
spacing_y (Number) – Distance between adjacent atoms in y direction in meters.
canvas (Canvas) – Canvas defining the boundary where atoms can be placed.
site_type (SiteType) – The type of sites to create. Default is FILLED.
- Return type:
- Returns:
AtomArrangement – A new atom arrangement with atoms placed in a rectangular lattice.
- Raises:
ValueError – If either spacing is not positive.
- classmethod from_triangular_lattice(spacing, canvas, site_type=SiteType.FILLED)[source]
Create a triangular lattice arrangement within a canvas.
A triangular lattice has the same spacing between all nearest neighbors. The lattice vectors are (spacing, 0) and (spacing/2, spacing*sqrt(3)/2).
- Parameters:
- Return type:
- Returns:
AtomArrangement – A new atom arrangement with atoms placed in a triangular lattice.
- Raises:
ValueError – If spacing is not positive.
- classmethod from_honeycomb_lattice(spacing, canvas, site_type=SiteType.FILLED)[source]
Create a honeycomb lattice arrangement within a canvas.
A honeycomb lattice is a triangular Bravais lattice with a two-atom basis. The spacing parameter refers to the nearest neighbor distance.
- Parameters:
- Return type:
- Returns:
AtomArrangement – A new atom arrangement with atoms placed in a honeycomb lattice.
- Raises:
ValueError – If spacing is not positive.
- classmethod from_bravais_lattice(a1, a2, canvas, basis=None, site_type=SiteType.FILLED)[source]
Create a general Bravais lattice arrangement within a canvas.
- Parameters:
a1 (tuple[Number, Number]) – First lattice vector (x, y) in meters.
a2 (tuple[Number, Number]) – Second lattice vector (x, y) in meters.
canvas (Canvas) – Canvas defining the boundary where atoms can be placed.
basis (list[tuple[Number, Number]] | None) – Basis vectors for decorated lattice. If None, uses a single atom at (0, 0). Default is None.
site_type (SiteType) – The type of sites to create. Default is FILLED.
- Return type:
- Returns:
AtomArrangement – A new atom arrangement with atoms placed in a Bravais lattice.
- Raises:
ValueError – If lattice vectors are parallel or zero.