def check_unitarity(self):
    # this function checks if all defined operators are unitary
    # in case one isn't unitary the program stops
    for k in range(len(self.M)):
      if (np.trace(self.M[k] * self.M[k].getH()) - 2 != 0):
        print "Operator " + self.name[k] + " (no. " + str(
          k) + ") isn't unitary!"
        exit()
dataset/ETHPy150Open jansel/opentuner/examples/unitary/cla_func.py/Op.check_unitarity/original