def matrix_dagger(e):
 if isinstance(e, Matrix):
  return e.H
 elif isinstance(e, (numpy_ndarray, scipy_sparse_matrix)):
  return e.conjugate().transpose()
 raise TypeError(('Expected sympy/numpy/scipy.sparse matrix, got: %r' % e))

def matrix_dagger ( e ) : if isinstance ( e , Matrix ) : return e . H elif isinstance ( e , ( numpy_ndarray , scipy_sparse_matrix ) ) : return e . conjugate ( ) . transpose ( ) raise TypeError ( ( 'Expected sympy/numpy/scipy.sparse matrix, got: %r' % e ) )
return the dagger of a sympy/numpy/scipy .