qiskit.utils.apply_prefix
apply_prefix(value, unit)
Given a SI unit prefix and value, apply the prefix to convert to standard SI unit.
Parameters
- value (float | ParameterExpression) – The number to apply prefix to.
- unit (str) – String prefix.
Returns
Converted value.
Return type
float
Note
This may induce tiny value error due to internal representation of float object. See https://docs.python.org/3/tutorial/floatingpoint.html for details.
Raises
ValueError – If the units
aren’t recognized.
Return type
float
Was this page helpful?
Report a bug or request content on GitHub.