Skip to content

Commit

Permalink
remove is_normal function
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyjmurray committed May 23, 2024
1 parent 4f47d1f commit 2cd29ab
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions pygsti/tools/matrixtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,6 @@ def gram_matrix(m, adjoint=False):
return out


def is_normal(m, tol=1e-9):
"""
Test whether m is a normal operator, in the sense that it commutes with its adjoint.
"""
if m.shape[0] != m.shape[1]:
return False
prefix_char, _, _ = _spl.blas.find_best_blas_type(dtype=m.dtype)
herk = BLAS_FUNCS["herk"][prefix_char]
trans = 2 if _np.iscomplexobj(m) else 1
mdagm = herk( 1.0, m, trans=trans )
mmdag = herk( -1.0, m, trans=0, c=mdagm, overwrite_c=True )
return _np.all(_np.abs(mmdag) <= tol)


def is_hermitian(mx, tol=1e-9):
"""
Test whether mx is a hermitian matrix.
Expand Down

0 comments on commit 2cd29ab

Please sign in to comment.