3.1.4. qupulse.utils package¶
3.1.4.1. Submodules¶
3.1.4.2. qupulse.utils.tree module¶
-
class
qupulse.utils.tree.
Node
(parent=None, children=None)[source]¶ Bases:
qupulse.comparable.Comparable
-
compare_key
¶ Implements
compare_key
.Return type: List
[~T]
-
debug
= False¶
-
3.1.4.3. qupulse.utils.types module¶
-
class
qupulse.utils.types.
HashableNumpyArray
[source]¶ Bases:
numpy.ndarray
Make numpy arrays hashable.
Example usage: my_array = np.zeros([1, 2, 3, 4]) hashable = my_array.view(HashableNumpyArray)
-
qupulse.utils.types.
TimeType
¶ alias of
fractions.Fraction
-
class
qupulse.utils.types.
DocStringABCMeta
[source]¶ Bases:
abc.ABCMeta
Metaclass that copies/refers to docstrings of the super class.
-
class
qupulse.utils.types.
SingletonABCMeta
(name, bases, dct)[source]¶ Bases:
qupulse.utils.types.DocStringABCMeta
Metaclass that enforces singletons
3.1.4.4. Module contents¶
-
qupulse.utils.
isclose
()¶ Determine whether two floating point numbers are close in value.
- rel_tol
- maximum difference for being considered “close”, relative to the magnitude of the input values
- abs_tol
- maximum difference for being considered “close”, regardless of the magnitude of the input values
Return True if a is close in value to b, and False otherwise.
For the values to be considered close, the difference between them must be smaller than at least one of the tolerances.
-inf, inf and NaN behave similarly to the IEEE 754 Standard. That is, NaN is not close to anything, even itself. inf and -inf are only close to themselves.