Repository navigation
Respect conjugate transpose in complex vector mode products - #696
Open
DiadkoShmek wants to merge 1 commit into
Open
DiadkoShmek wants to merge 1 commit into
DiadkoShmek wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #696 +/- ##
==========================================
+ Coverage 92.81% 92.82% +0.01%
==========================================
Files 133 133
Lines 8863 8879 +16
==========================================
+ Hits 8226 8242 +16
Misses 637 637 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
For complex vectors,
mode_dot(..., transpose=True)ignores conjugation in both tensor-algebra implementations. The coremulti_mode_dotalready conjugates vectors, while its einsum implementation does not. Consequently, a single mode product and its one-factor multi-mode equivalent disagree.For
X=[[1+2j,3-1j],[-2+1j,4+3j]]andv=[1+1j,2-1j], the Hermitian mode-0 contraction is[-2+1j,7+6j]; both single-mode implementations currently return[-4+7j,15+4j].Apply the existing Hermitian transpose convention to vector branches using the wrapped backend
conj. Update the relevant parameter documentation and add one compact parameterized regression covering both vector modes, transpose values and complex64/128. Default bilinear calls and real-vector values retain their semantics.Validation on exact main
cdde62f:CPU NumPy/PyTorch were tested; other backend and GPU matrices were not run. Repeated/negative modes and reordered skip behavior are outside this change. Implementation, testing and description were AI-assisted.