openmmtools.utils.is_quantity_close¶
- openmmtools.utils.is_quantity_close(quantity1, quantity2, rtol=1e-10, atol=0.0)[source]¶
Check if the quantities are equal up to floating-point precision errors.
- Parameters:
- quantity1openmm.unit.Quantity
The first quantity to compare.
- quantity2openmm.unit.Quantity
The second quantity to compare.
- rtolfloat, optional
Relative tolerance (default is 1e-10).
- atolfloat, optional
Absolute tolerance (default is 0.0).
- Returns:
- True if the quantities are equal up to approximately 10 digits.
- Raises:
- TypeError
If the two quantities are of incompatible units.