Skip to content

Fix return value in einsum_path for simple contractions#3232

Merged
angeloskath merged 3 commits intoml-explore:mainfrom
MillaFleurs:pr-3222-clean
Mar 10, 2026
Merged

Fix return value in einsum_path for simple contractions#3232
angeloskath merged 3 commits intoml-explore:mainfrom
MillaFleurs:pr-3222-clean

Conversation

@MillaFleurs
Copy link
Contributor

@MillaFleurs MillaFleurs commented Mar 9, 2026

Proposed changes

#3222

Describe the bug
User-visible API output (einsum_path info string) can be incorrect and nondeterministic for common equations with one or two operands. The output produced is garbage and should be fixed.

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

Copy link
Member

@angeloskath angeloskath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output produced is garbage and should be fixed.

I think the language is a bit harsh but I do appreciate the fix 🤣

But seriously, thanks for the fix.

@angeloskath
Copy link
Member

Ah sorry, linter again. Will merge after.

@MillaFleurs
Copy link
Contributor Author

Sorry about that I had set up the pre-commit to run on any pushes upstream but it seems it was not working

@MillaFleurs
Copy link
Contributor Author

MillaFleurs commented Mar 9, 2026 via email

@MillaFleurs
Copy link
Contributor Author

MillaFleurs commented Mar 9, 2026 via email

@zcbenz zcbenz changed the title PR#3222 Fix for path info Fix corrupted path in einsum_path when invalid string is passed Mar 10, 2026
@angeloskath angeloskath changed the title Fix corrupted path in einsum_path when invalid string is passed Fix return value in einsum_path for simple contractions Mar 10, 2026
@angeloskath angeloskath merged commit 9bbd375 into ml-explore:main Mar 10, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants