braket.ahs.atom_arrangement module

class braket.ahs.atom_arrangement.SiteType(value)[source]

Bases: Enum

An enumeration.

VACANT = 'Vacant'
FILLED = 'Filled'
class braket.ahs.atom_arrangement.AtomArrangementItem(coordinate: tuple[Number, Number], site_type: SiteType)[source]

Bases: object

Represents an item (coordinate and metadata) in an atom arrangement.

coordinate: tuple[Number, Number]
site_type: SiteType
class braket.ahs.atom_arrangement.AtomArrangement[source]

Bases: object

Represents a set of coordinates that can be used as a register to an AnalogHamiltonianSimulation.

add(coordinate: tuple[Number, Number] | ndarray, site_type: SiteType = SiteType.FILLED) AtomArrangement[source]

Add a coordinate to the atom arrangement.

Parameters:
  • coordinate (Union[tuple[Number, Number], 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.

Returns:

AtomArrangement – returns self (to allow for chaining).

coordinate_list(coordinate_index: Number) list[Number][source]

Returns all the coordinates at the given index.

Parameters:

coordinate_index (Number) – The index to get for each coordinate.

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: DiscretizationProperties) AtomArrangement[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.

Returns:

AtomArrangement – A new discretized atom arrangement.