Skip to content

Commit a7ac211

Browse files
committed
TST: matmul does not conjugate; wrong?
1 parent c6f0281 commit a7ac211

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

numpy/_core/tests/test_ufunc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,10 @@ def test_vecdot_matvec_vecmat_complex(self, ufunc, shape1, shape2, conj):
868868
expected1 = np.array(((arr1.conj() if conj else arr1) * arr2).sum(),
869869
ndmin=min(len(shape1), len(shape2)))
870870
assert_array_equal(actual1, expected1)
871+
# This would fail for conj=True, since matmul omits the conjugate.
872+
if not conj:
873+
assert_array_equal(arr1.reshape(shape1) @ arr2.reshape(shape2),
874+
expected1)
871875

872876
actual2 = ufunc(arr2.reshape(shape1), arr1.reshape(shape2))
873877
expected2 = np.array(((arr2.conj() if conj else arr2) * arr1).sum(),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy