pygsti.tools.matrixmod2.onesify

Contents

pygsti.tools.matrixmod2.onesify#

onesify(a, failcount=0, maxfailcount=100, rand_state=None)#

Returns M such that M a M.T has ones along the main diagonal

Parameters:
  • a (numpy.ndarray) – The matrix.

  • failcount (int, optional) – Internal use only.

  • maxfailcount (int, optional) – Maximum number of tries before giving up.

  • rand_state (np.random.RandomState, optional) – Random number generator to allow for determinism.

Return type:

numpy.ndarray