code: def controlled(m: np.ndarray) -> np.ndarray:
      
      rows, cols = m.shape
      assert rows == cols
      n = rows
      I = np.eye(n)
      Z = np.zeros((n, n))
      controlled_m = np.bmat([[I, Z],
                              [Z, m]])
      return controlled_m
docs: Make a one-qubit-controlled version of a matrix.
  
      :param m: A matrix.
      :return: A controlled version of that matrix.