Skip to content

qoolqit.devices.unit_converter

source module qoolqit.devices.unit_converter

Classes

  • UnitConverter A dataclass representing a unit converter in the Rydberg-Analog model.

source dataclass UnitConverter(C6: float = field(repr=False), time: float, energy: float, distance: float)

A dataclass representing a unit converter in the Rydberg-Analog model.

Includes three inter-dependent factors for TIME, ENERGY and DISTANCE conversion, also depending on the interaction coeffiecient C6. The converter checks the following invariants, based on the units used by Pulser:

Conversion invariants

  1. TIME * ENERGY = 1000 ( <=> TIME = 1000 / ENERGY )
  2. DISTANCE^6 * ENERGY = C6 ( <=> ENERGY = C6 / (DISTANCE ^ 6) )

Attributes

  • C6 : float Time conversion factor.

  • time : float Energy conversion factor.

  • energy : float Distance conversion factor.

  • factors : tuple[float, ...] Return the current conversion factors set.

Methods

  • validate_factors Returns True if the conversion invariants are respected.

  • from_time Instantiate from a reference C6 value and a reference time unit.

  • from_energy Instantiate from a reference C6 value and a reference energy unit.

  • from_distance Instantiate from a reference C6 value and a reference distance unit.

  • factors_from_time Get factors from a different reference time than the one set.

  • factors_from_energy Get factors from a different reference energy than the one set.

  • factors_from_distance Get factors from a different reference distance than the one set.

source method UnitConverter.validate_factors(time: float, energy: float, distance: float)bool

Returns True if the conversion invariants are respected.

source classmethod UnitConverter.from_time(C6: float, time: float)UnitConverter

Instantiate from a reference C6 value and a reference time unit.

source classmethod UnitConverter.from_energy(C6: float, energy: float)UnitConverter

Instantiate from a reference C6 value and a reference energy unit.

source classmethod UnitConverter.from_distance(C6: float, distance: float)UnitConverter

Instantiate from a reference C6 value and a reference distance unit.

source property UnitConverter.factors: tuple[float, ...]

Return the current conversion factors set.

source method UnitConverter.factors_from_time(time: float)tuple[float, ...]

Get factors from a different reference time than the one set.

source method UnitConverter.factors_from_energy(energy: float)tuple[float, ...]

Get factors from a different reference energy than the one set.

source method UnitConverter.factors_from_distance(distance: float)tuple[float, ...]

Get factors from a different reference distance than the one set.