We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7a32b8 commit 00354d0Copy full SHA for 00354d0
1 file changed
src/openfermion/circuits/low_rank.py
@@ -150,8 +150,8 @@ def low_rank_two_body_decomposition(
150
interaction_array = numpy.reshape(chemist_two_body_coefficients, (full_rank, full_rank))
151
152
# Make sure interaction array is symmetric and real.
153
- asymmetry = numpy.sum(numpy.absolute(interaction_array - interaction_array.transpose()))
154
- imaginary_norm = numpy.sum(numpy.absolute(interaction_array.imag))
+ asymmetry = numpy.amax(numpy.absolute(interaction_array - interaction_array.transpose()))
+ imaginary_norm = numpy.amax(numpy.absolute(interaction_array.imag))
155
if asymmetry > EQ_TOLERANCE or imaginary_norm > EQ_TOLERANCE:
156
raise ValueError(
157
'The two-body coefficient tensor failed the symmetry or reality '
0 commit comments