-
-
Notifications
You must be signed in to change notification settings - Fork 11k
DOC: Changed vdot docs as suggested #26406
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
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4dfc890
changed vdot docs as suggested
geetaakshata 346f5fa
DOC: vdot: adjustments per review
mdhaber 4c13f5e
Merge remote-tracking branch 'upstream/main' into gh26406
mdhaber d9517e3
remove extraneious '.' [skip azp][skip actions][skip cirrus]
mattip File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -830,18 +830,22 @@ def dot(a, b, out=None): | |
|
||
@array_function_from_c_func_and_dispatcher(_multiarray_umath.vdot) | ||
def vdot(a, b): | ||
""" | ||
r""" | ||
vdot(a, b, /) | ||
|
||
Return the dot product of two vectors. | ||
|
||
The vdot(`a`, `b`) function handles complex numbers differently than | ||
dot(`a`, `b`). If the first argument is complex the complex conjugate | ||
of the first argument is used for the calculation of the dot product. | ||
The `vdot` function handles complex numbers differently than `dot`: | ||
if the first argument is complex, it is replaced by its complex conjugate | ||
in the dot product calculation. `vdot` also handles multidimensional | ||
arrays differently than `dot`: it does not perform a matrix product, but | ||
flattens the arguments to 1-D arrays before taking a vector dot product. | ||
|
||
Note that `vdot` handles multidimensional arrays differently than `dot`: | ||
it does *not* perform a matrix product, but flattens input arguments | ||
to 1-D vectors first. Consequently, it should only be used for vectors. | ||
Consequently, when the arguments are 2-D arrays of the same shape, this | ||
function effectively returns their | ||
`Frobenius inner product <https://en.wikipedia.org/wiki/Frobenius_inner_product>`_ | ||
(also known as the *trace inner product* or the *standard inner product* | ||
on a vector space of matrices). | ||
|
||
Parameters | ||
---------- | ||
|
@@ -883,7 +887,7 @@ def vdot(a, b): | |
>>> 1*4 + 4*1 + 5*2 + 6*2 | ||
30 | ||
|
||
""" | ||
""" # noqa: E501 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only needed for the URL. Perhaps Sphinx would allow a line break there, but I wasn't sure. |
||
return (a, b) | ||
|
||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not needed after all.