Skip to content
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

Change the behavior of dot to not conjugate, and introduce an inner (product) function #22227

Closed
jebej opened this issue Jun 5, 2017 · 6 comments
Labels
linear algebra Linear algebra

Comments

@jebej
Copy link
Contributor

jebej commented Jun 5, 2017

As briefly discussed in #22220 (with relevance to #20978), I suggest removing the conjugating behavior from dot, and introducing an inner function which does take the adjoint. This is consistent with numpy. The dot notation seems to rarely be used for complex numbers, for which the general inner product terminology ⟨a,b⟩ is more common. Of course, for real numbers, we have inner == dot.

I'm not sure where the discussion concerning the recursiveness of the dot product should go. It's been mentioned in #20978, but that doesn't seem to be the main point of that issue.

@stevengj stevengj added the linear algebra Linear algebra label Jun 5, 2017
@stevengj
Copy link
Member

stevengj commented Jun 5, 2017

This seems wrong to me (and will be breaking). dot should denote an inner product. (The recursiveness is essential for it to be an inner product.)

If you want an unconjugated sum, we could define dotu analogous to BLAS. (In fact, we already have a non-exported dotu function.)

@stevengj
Copy link
Member

stevengj commented Jun 5, 2017

See also #8300.

@jebej
Copy link
Contributor Author

jebej commented Jun 5, 2017

I suppose the name change is not too important, especially with how breaking it would be. I still think inner is more appropriate a name however. I guess I can do const inner = dot if I really want to.

(The recursiveness is essential for it to be an inner product.)

I'm not an expert, but I'd be curious to learn more about this. The only required properties of an inner product space are conjugate symmetry, linearity and positive-definiteness. Would a non-recursive inner product not satisfy those properties?

@stevengj
Copy link
Member

stevengj commented Jun 5, 2017

An inner product for a vector space needs to give an element of the scalar field. Since scalar multiplication is done recursively, so must the inner product.

@jebej
Copy link
Contributor Author

jebej commented Jun 6, 2017

I'll close this since most of the discussion is now happening on the PR.

@ettersi
Copy link
Contributor

ettersi commented May 8, 2018

Sorry if this is a stupid question, but did this discussion reach a conlusion? I haven't found any PR where the discussion was continued.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra
Projects
None yet
Development

No branches or pull requests

3 participants