resorting_cpp package

resorting_cpp module

Underlying C++ library for sorting neutral atoms

class resorting_cpp.ArrayBounds

Bases: pybind11_object

A class holding 4 values describing the start and end indices of a region. May hold either row/column or cross-/along channel values depending on context.

property firstColOrAC

First column or along-channel-dimension (AC) index. Inclusive

Type:

unsigned int

property firstRowOrXC

First row or across-channel-dimension (XC) index. Inclusive

Type:

unsigned int

property lastColOrACExcl

Last column or along-channel-dimension (AC) index. Exclusive

Type:

unsigned int

property lastRowOrXCExcl

Last row or across-channel-dimension (XC) index. Exclusive

Type:

unsigned int

class resorting_cpp.Config

Bases: pybind11_object

A class for configuring the sorting algorithm. At the moment, this is only used for configuring the logger.

property allowDiagonalMovement

Whether diagonal movement is allowed. Only relevant for sortParallel

Type:

bool

property allowMovesBetweenCols

Whether moves between columns are always allowed. Only relevant for sortParallel

Type:

bool

property allowMovesBetweenRows

Whether moves between rows are always allowed. Only relevant for sortParallel

Type:

bool

property allowMovingEmptyTrapOntoOccupied

Whether it is allowed to move empty traps onto occupied ones. Only relevant for sortParallel

Type:

bool

property allowMultipleMovesPerAtom

Whether an atom may be moved multiple times. Only relevant for sortParallel and sortLatticeGreedyParallel

Type:

bool

property alwaysGenerateAllAODTones

Whether all allowed tones should always be generated. If true, moves are extended to always use all tones. Only works if aodTotalLimit >= aodRowLimit * aodColLimit. May add negative tones or ones greater than the array size for sortParallel. Only relevant for sortParallel and sortLatticeByRowParallel

Type:

bool

property aodColLimit

How many column tones may be fed to the AOD. Only relevant for sortParallel, sortLatticeGreedyParallel, and sortLatticeByRowParallel

Type:

unsigned int

property aodRowLimit

How many row tones may be fed to the AOD. Only relevant for sortParallel, sortLatticeGreedyParallel, and sortLatticeByRowParallel

Type:

unsigned int

property aodTotalLimit

How many movable traps may be generated in total. Only relevant for sortParallel, sortLatticeGreedyParallel, and sortLatticeByRowParallel

Type:

unsigned int

property columnSpacing

Physical spacing between columns. Only relevant for lattice algorithms

Type:

double

flushLogs(self: resorting_cpp.Config) None
property greedyLatticeLoggerName

Name of the greedy-lattice logger

Type:

string

property latticeByRowLoggerName

Name of the by-row lattice logger

Type:

string

property logFileName

Name of the log file

Type:

string

property logLevel

String representation of log level (“trace”, “debug”, “info”, “warning”/”warn”, “error”/”err”, “critical”, “off”). Defaults to “off” if not recognised.

Type:

string

property maxSubmoveDistInPenalizedArea

Maximum distance that one may travel in area that is to be avoided, e.g, to minimize heating. Only relevant for sortLatticeGreedyParallel and sortLatticeByRowParallel

Type:

double

property minAodSpacing

Minimal physical spacing between generated tones. Only relevant for sortLatticeByRowParallel

Type:

double

property minDistFromOccSites

Minimum distance to keep from occupied sites at any time. Only relevant for sortLatticeGreedyParallel and sortLatticeByRowParallel

Type:

double

property moveCostOffset

Constant time demand per move. Only relevant for sortParallel and sortLatticeGreedyParallel

Type:

double

property moveCostOffsetSubmove

Constant time demand per submove. Only relevant for sortParallel and sortLatticeGreedyParallel

Type:

double

property moveCostScalingLinear

Time demand depending on submove distance linearly. Only relevant for sortParallel and sortLatticeGreedyParallel

Type:

double

property moveCostScalingSqrt

Time demand depending on square root of submove distance. Only relevant for sortParallel and sortLatticeGreedyParallel

Type:

double

property parallelLoggerName

Name of the parallel logger

Type:

string

readConfig(self: resorting_cpp.Config, filePath: str) bool

A function that allows for reading in a provided config file

Parameters:

filePath (string) – The path of the provided config file

Returns:

Whether reading was successful.

Return type:

bool

property recommendedDistFromEmptySites

Recommended distance from empty sites. May be temporarily infringed depending on maxSubmoveDistInPenalizedArea. Only relevant for sortLatticeGreedyParallel

Type:

double

property recommendedDistFromOccSites

Recommended distance from occupied sites. May be temporarily infringed depending on maxSubmoveDistInPenalizedArea. Only relevant for sortLatticeGreedyParallel

Type:

double

property rowSpacing

Physical spacing between rows. Only relevant for lattice algorithms

Type:

double

property sequentialLoggerName

Name of the sequential logger

Type:

string

property verticalSortingChannel

Whether the sorting channel should be vertical. If not set, it will be determined automatically. Only relevant for sortLatticeByRowParallel

Type:

optional[bool]

class resorting_cpp.MinimalArrayInformation

Bases: pybind11_object

A class holding the minimal information about the array to subsequently fix sorting mistake.

property bufferCols

List of columns that may be added to generate additional tones if alwaysGenerateAllAODTones is true

Type:

list[int]

property bufferRows

List of rows that may be added to generate additional tones if alwaysGenerateAllAODTones is true

Type:

list[int]

property dumpingIndicesAC

List of indices along sorting channel in which unusable atoms are to be dumped

Type:

list[int]

property normalIndices

Struct containing bounds within which no buffer or dumping zones are located

Type:

ArrayBounds

property vertical

Whether the sorting channel is vertical

Type:

bool

class resorting_cpp.ParallelMove

Bases: pybind11_object

A class holding information about a parallel move.

property steps

Individual steps of the move

Type:

list[ParallelMoveStep]

class resorting_cpp.ParallelMoveStep

Bases: pybind11_object

A class holding information about a parallel move step.

property colSelection

List of column tones to activate at this step

Type:

list[double]

property rowSelection

List of column tones to activate at this step

Type:

list[double]

class resorting_cpp.SequentialMove

Bases: pybind11_object

A class holding information about a sequential move.

property distance

Total move length

Type:

double

property sites_list

Coordinates of movable tweezer at each step

Type:

list[(double,double)]

class resorting_cpp.TargetState

Bases: pybind11_object

Members:

Empty

Occupied

Irrelevant

Empty = <TargetState.Empty: 0>
Irrelevant = <TargetState.Irrelevant: 2>
Occupied = <TargetState.Occupied: 1>
TargetState.name -> str
property value
resorting_cpp.fixLatticeByRowSortingDeficiencies(stateArray: numpy.ndarray[bool[m, n], flags.writeable], targetGeometry: numpy.ndarray[numpy.uint32], arrayInfo: resorting_cpp.MinimalArrayInformation) list[resorting_cpp.ParallelMove] | None

A function that fixes deficiencies that arose while sorting using sortLatticeByRowParallel

Parameters:
  • stateArray (numpy.ndarray[bool[m, n], flags.writeable]) – The array of boolean values to be sorted

  • targetGeometry (numpy.ndarray[TargetState[m, n]]) – Array of TargetState values of size equal to stateArray specifying target occupancy

  • arrayInfo (MinimalArrayInformation) – Information about the array to be fixed. Returned from sortLatticeByRowParallel

Returns:

A list of moves to sort array or None if sorting has failed.

Return type:

list[ParallelMove] | None

resorting_cpp.sortLatticeByRowParallel(stateArray: numpy.ndarray[bool[m, n], flags.writeable], targetGeometry: numpy.ndarray[numpy.uint32]) tuple[list[resorting_cpp.ParallelMove], resorting_cpp.MinimalArrayInformation] | None

A function that sorts atoms in a lattice in parallel towards a given geometry

Parameters:
  • stateArray (numpy.ndarray[bool[m, n], flags.writeable]) – The array of boolean values to be sorted

  • targetGeometry (numpy.ndarray[TargetState[m, n]]) – Array of TargetState values of size equal to stateArray specifying target occupancy

Returns:

A list of moves to sort array or None if sorting has failed.

Return type:

pair[list[ParallelMove],MinimalArrayInformation] | None

resorting_cpp.sortLatticeGreedyParallel(stateArray: numpy.ndarray[bool[m, n], flags.writeable], compZoneRowStart: int, compZoneRowEnd: int, compZoneColStart: int, compZoneColEnd: int, targetGeometry: numpy.ndarray[bool[m, n], flags.writeable]) list[resorting_cpp.ParallelMove] | None

A function that sorts atoms in a lattice in parallel towards a given geometry

Parameters:
  • stateArray (numpy.ndarray[bool[m, n], flags.writeable]) – The array of boolean values to be sorted

  • compZoneRowStart (int) – Start row of computational zone (inclusive)

  • compZoneRowEnd (int) – End row of computational zone (exclusive)

  • compZoneColStart (int) – Start column of computational zone (inclusive)

  • compZoneColEnd (int) – End column of computational zone (exclusive)

  • targetGeometry (numpy.ndarray[bool[m, n], flags.writeable]) – Array of boolean values of size (compZoneRowEnd - compZoneRowStart) x (compZoneColEnd - compZoneColStart) specifying target occupancy

Returns:

A list of moves to sort array or None if sorting has failed.

Return type:

list[ParallelMove] | None

resorting_cpp.sortParallel(stateArray: numpy.ndarray[bool[m, n], flags.writeable], compZoneRowStart: int, compZoneRowEnd: int, compZoneColStart: int, compZoneColEnd: int, targetGeometry: numpy.ndarray[bool[m, n], flags.writeable]) list[resorting_cpp.ParallelMove] | None

A function that sorts an array of atoms in parallel

Parameters:
  • stateArray (numpy.ndarray[bool[m, n], flags.writeable]) – The array of boolean values to be sorted

  • compZoneRowStart (int) – Start row of computational zone (inclusive)

  • compZoneRowEnd (int) – End row of computational zone (exclusive)

  • compZoneColStart (int) – Start column of computational zone (inclusive)

  • compZoneColEnd (int) – End column of computational zone (exclusive)

  • targetGeometry (numpy.ndarray[bool[m, n], flags.writeable]) – Array of boolean values of size (compZoneRowEnd - compZoneRowStart) x (compZoneColEnd - compZoneColStart) specifying target occupancy

Returns:

A list of moves to sort array or None if sorting has failed.

Return type:

list[ParallelMove] | None

resorting_cpp.sortSequentiallyByRow(stateArray: numpy.ndarray[bool[m, n], flags.writeable], compZoneRowStart: int, compZoneRowEnd: int, compZoneColStart: int, compZoneColEnd: int) list[resorting_cpp.SequentialMove] | None

A function that sorts an array of atoms sequentially row by row

Parameters:
  • stateArray (numpy.ndarray[bool[m, n], flags.writeable]) – The array of boolean values to be sorted

  • compZoneRowStart (int) – Start row of computational zone (inclusive)

  • compZoneRowEnd (int) – End row of computational zone (exclusive)

  • compZoneColStart (int) – Start column of computational zone (inclusive)

  • compZoneColEnd (int) – End column of computational zone (exclusive)

Returns:

A list of moves to sort array or None if sorting has failed.

Return type:

list[Move] | None