Definition of `vecdot` is ambiguous in the complex case.
See original GitHub issueThe function linalg.vecdot
is defined as:
Computes the (vector) dot product of two arrays.
It is not clear what this means for complex vectors, as it could be \sum x_i y_i or it could be (as defined for a complex dot product) \sum \conj(x_i) y_i.
I am aware that the API does not cover complex tensors yet, but many of the libraries that are currently implementing this operation do support complex tensors, so it would be great to disambiguate the meaning of this operation now, so that libraries that implement it can safely implement the intended operation for complex tensors.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Support Batch Dot Product · Issue #18027 · pytorch ... - GitHub
I added a case in my PR that reduces to torch.dot as it is significantly faster ... Definition of vecdot is ambiguous in...
Read more >Why in complex dot product, →a⋅→b=0 when →a and →b ...
The definition of two vectors being orthogonal is that their dot product is zero. So you don't need to derive that a⋅b=0 implies...
Read more >Linear Algebra · The Julia Language
Dot function for two complex vectors, consisting of n elements of array X with stride incx and n elements of array U with...
Read more >Methods Julia 0.6官方教程 _w3cschool - 编程狮
To define a function with multiple methods, one simply defines the function ... In more complex cases, resolving method ambiguities involves a certain ......
Read more >Dot product - MATLAB dot - MathWorks
In this case, the dot function treats A and B as collections of vectors. ... An exception is when you take the dot...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue was discussed during the most recent consortium meeting (1-6-2021). Consensus there was that the definition of the vector dot product for complex number input should conjugate (i.e.,
x^H y
; similar to NumPy’svdot
).Implementors can begin their complex number
vecdot
implementations assuming that this will be added to the specification along with more general complex number guidance.You can indeed replicate the this behaviour resizing the inputs adding a dimension of size 1 in both inputs (see https://github.com/pytorch/pytorch/issues/18027) but this seems fairly clunky. There is no easy way to do this at the moment with the API.