count_nonzero#

cuqi.utilities.count_nonzero(x, threshold=1e-06)#

Returns the number of values in an array whose absolute value is larger than a specified threshold

Parameters:
  • x (np.ndarray) – Array to count nonzero elements of.

  • threshold (float) – Theshold for considering a value as nonzero.