Skip to content
Snippets Groups Projects
Commit c428c4ca authored by Joseph Weston's avatar Joseph Weston
Browse files

simplify check for Hermiticity/antisymmetry

parent 0aa3e157
No related branches found
No related tags found
1 merge request!2change to 2-clause BSD
......@@ -309,9 +309,10 @@ class ContinuousGroupGenerator:
def __init__(self, R=None, U=None):
# Make sure that R and U have correct properties
if not ((R is None or (allclose(R, -R.T) and allclose(R, R.T.conj())))
and (U is None or allclose(U, U.T.conj()))):
raise ValueError('R must be Hermitian antisymmetric and U Hermitian or None.')
if R is not None and not is_hermitian(R) and not is_antisymmetric(R):
raise ValueError('R must be Hermitian antisymmetric')
if U is not None and not is_hermitian(U):
raise ValueError('U must be Hermitian')
self.R, self.U = R, U
def __repr__(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment