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

Relax MPO element type restrictions #244

Merged
merged 4 commits into from
Feb 3, 2025
Merged

Relax MPO element type restrictions #244

merged 4 commits into from
Feb 3, 2025

Conversation

leburgel
Copy link
Member

@leburgel leburgel commented Feb 3, 2025

Attempt at relaxing the type restrictions on MPO elements, in order to be able to use generic effective MPOs. This should work as long as the element type adheres to the (until now implicit) interface for MPOTensor which requires:

  • left_virtualspace
  • right_virtualspace
  • _conj_mpo
  • add_physical_charge
  • _fuse_mpo_mpo
  • _fuse_mpo_mps
  • _mpo_to_mps
  • ...?

I also added explicit type annotations for internal methods where an element type <:MPOTensor is really assumed.

See also QuantumKitHub/PEPSKit.jl#125 for the intended use case.

@leburgel leburgel self-assigned this Feb 3, 2025
@leburgel leburgel marked this pull request as draft February 3, 2025 12:57
Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/operators/mpo.jl 81.81% 2 Missing ⚠️
src/operators/multilinempo.jl 50.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/operators/abstractmpo.jl 50.63% <100.00%> (+0.31%) ⬆️
src/operators/multilinempo.jl 35.00% <50.00%> (ø)
src/operators/mpo.jl 90.34% <81.81%> (-0.32%) ⬇️

... and 1 file with indirect coverage changes

Copy link
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

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

Overall, looks clean to me. Can you confirm that the PEPSKit changes you want have passing tests before I merge and tag any of this?

@leburgel leburgel marked this pull request as ready for review February 3, 2025 18:29
@leburgel leburgel changed the title [WIP] Relax MPO element type restrictions Relax MPO element type restrictions Feb 3, 2025
@lkdvos lkdvos merged commit 1e3c513 into master Feb 3, 2025
28 checks passed
@lkdvos lkdvos deleted the lb/relax_mpo_types branch February 3, 2025 20:59
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.

2 participants