Skip to content

ENH: test vecdot conjugation #342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions array_api_tests/test_linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,16 @@ def test_vecdot(x1, x2, data):
_test_vecdot(_array_module, x1, x2, data)


@pytest.mark.xp_extension('linalg')
def test_vecdot_conj():
# no-hypothesis test to check that the 1st argument is in fact conjugated
x1 = xp.asarray([1j, 2j, 3j])
x2 = xp.asarray([1, 2j, 3])

import cmath
assert cmath.isclose(complex(xp.linalg.vecdot(x1, x2)), 4 - 10j)


# Insanely large orders might not work. There isn't a limit specified in the
# spec, so we just limit to reasonable values here.
max_ord = 100
Expand Down