About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
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 (
Union
[float
,ParameterExpression
]) – The number to apply prefix to. - unit (
str
) – String prefix.
Return type
float
Returns
Converted value.
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.
Was this page helpful?
Report a bug or request content on GitHub.