qrunch.common.units.length

Available length units.

Functions

to_length_unit(unit)

Convert a string or Unit to a Length Unit.

Classes

Angstrom

Length unit type for Angstrom.

Bohr

Length unit type for Bohr radius.

Centimeter

Length unit type for centimeter.

DEFAULT_LENGTH_UNIT

alias of Angstrom

Length

Unit annotated float for length that holds the unit information and the actual float value.

Meter

Length unit type for meter.

Micrometer

Length unit type for micrometer.

Millimeter

Length unit type for millimeter.

Nanometer

Length unit type for nanometer.

class Angstrom

Bases: object

Length unit type for Angstrom.

float_with_unit_type

alias of Length

si_conversion: float = 1e-10
unit_string: str = 'Å'
class Bohr

Bases: object

Length unit type for Bohr radius.

float_with_unit_type

alias of Length

si_conversion: float = 5.2917721054482e-11
unit_string: str = 'Bohr'
class Centimeter

Bases: object

Length unit type for centimeter.

float_with_unit_type

alias of Length

si_conversion: float = 0.01
unit_string: str = 'cm'
DEFAULT_LENGTH_UNIT

alias of Angstrom

class Length

Bases: FloatWithUnit

Unit annotated float for length that holds the unit information and the actual float value.

__init__(unit: Unit[Any], value: float) None
Parameters:
  • unit (Unit[Any])

  • value (float)

Return type:

None

to_au() Length

Return length unit annotated float to the atomic unit (AU) Bohr.

Return type:

Length

to_si() Length

Return length unit annotated float to the SI unit Meter.

Return type:

Length

to_unit(new_unit: Unit[T]) T
Parameters:

new_unit (Unit[T])

Return type:

T

unit: Unit[Any]
value: float
class Meter

Bases: object

Length unit type for meter.

float_with_unit_type

alias of Length

si_conversion: float = 1.0
unit_string: str = 'm'
class Micrometer

Bases: object

Length unit type for micrometer.

float_with_unit_type

alias of Length

si_conversion: float = 1e-06
unit_string: str = 'µm'
class Millimeter

Bases: object

Length unit type for millimeter.

float_with_unit_type

alias of Length

si_conversion: float = 0.001
unit_string: str = 'mm'
class Nanometer

Bases: object

Length unit type for nanometer.

float_with_unit_type

alias of Length

si_conversion: float = 1e-09
unit_string: str = 'nm'
to_length_unit(unit: Literal['angstrom', 'bohr', 'nanometer', 'meter'] | Unit[Length]) Unit[Length]

Convert a string or Unit to a Length Unit.

Parameters:

unit (Literal['angstrom', 'bohr', 'nanometer', 'meter'] | ~qrunch.common.units._base.Unit[~qrunch.common.units.length.Length])

Return type:

Unit[Length]