mindquantum.dtype.is_same_precision

View Source On Gitee
mindquantum.dtype.is_same_precision(dtype1, dtype2)[source]

Check whether two type is same precision or not.

Parameters
  • dtype1 (mindquantum.dtype) – The data type supported by mindquantum.

  • dtype2 (mindquantum.dtype) – The data type supported by mindquantum.

Examples

>>> from mindquantum import is_same_precision, complex128, float64
>>> is_same_precision(complex128, float64)
True