Skip to content

Choice of conjugation in complex inner product #616

@lezcano

Description

@lezcano
Contributor

vecdot is defined for complex vectors as

Unable to render expression.

$\langle x, y \rangle = \sum_i x_i \overline{y_i}$
. This can be written as
Unable to render expression.

$\langle x, y \rangle = y^H x$
(note how the order of the parameters is swapped).

In PyTorch we define it as

Unable to render expression.

$\langle x, y \rangle = x^H y$
. This notation is more common in physics, while the previous notation is more common in complex geometry. For a short discussion see this wikipedia page.

I would argue that numerical libraries are more targeted to physics people than to pure math people, so perhaps it'd be better to stick with the physics notation?

Activity

asmeurer

asmeurer commented on Apr 3, 2023

@asmeurer
Member

I've transferred this issue to the array-api repo.

kgryte

kgryte commented on Apr 4, 2023

@kgryte
Contributor

What is the ask here? Is this just a question about updating the docs or something else?

lezcano

lezcano commented on Apr 4, 2023

@lezcano
ContributorAuthor

It's a question about the definition of vecdot for complex inputs in the array API (should it conjugate the first or the second input?)

added this to the v2023 milestone on Jun 29, 2023
kgryte

kgryte commented on Dec 18, 2023

@kgryte
Contributor

This issue has been closed by #723. During the workgroup meeting on 30 Nov, we discussed this issue and consensus was to align the definition of the complex inner product with PyTorch and NumPy, as described in the OP. The definition previously in the spec was an oversight, and the changes have been backported to the 2022 revision of the API standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @asmeurer@rgommers@kgryte@lezcano

        Issue actions

          Choice of conjugation in complex inner product · Issue #616 · data-apis/array-api