Skip to content

[WIP] Add support for local expectation values of tensor product and MPO terms - #425

Draft
leburgel wants to merge 19 commits into
mainfrom
lb/product_expval
Draft

[WIP] Add support for local expectation values of tensor product and MPO terms#425
leburgel wants to merge 19 commits into
mainfrom
lb/product_expval

Conversation

@leburgel

@leburgel leburgel commented Sep 2, 2026

Copy link
Copy Markdown
Member

Built on top of #423.

Adds support for alternative operator forms for situations that are very badly suited to our current dense-tensor-operator approach, while still being compatible with AD to use them in variational optimizations. For now this is mostly a demonstration of how #423 allows to easily add support for the evaluation of different operator types by only overloading operator_contraction_expr. The concrete design will be revisited later.

@leburgel
leburgel marked this pull request as draft September 2, 2026 13:56
@Yue-Zhengyuan

Copy link
Copy Markdown
Member

I suppose this is exact contraction with CTMRG/BPEnv ?

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.16867% with 26 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/algorithms/contractions/localoperator.jl 86.95% 15 Missing ⚠️
src/utility/util.jl 75.00% 4 Missing ⚠️
src/algorithms/contractions/bp_contractions.jl 78.57% 3 Missing ⚠️
src/operators/localoperator.jl 95.65% 2 Missing ⚠️
src/algorithms/expectation_value.jl 98.93% 1 Missing ⚠️
src/algorithms/optimization/peps_optimization.jl 83.33% 1 Missing ⚠️
Files with missing lines Coverage Δ
...hms/contractions/ctmrg/characteristic_equations.jl 87.59% <ø> (+0.46%) ⬆️
src/algorithms/contractions/ctmrg/network_value.jl 100.00% <100.00%> (ø)
src/algorithms/toolbox.jl 95.08% <ø> (-1.85%) ⬇️
src/algorithms/expectation_value.jl 98.93% <98.93%> (ø)
src/algorithms/optimization/peps_optimization.jl 96.03% <83.33%> (-0.81%) ⬇️
src/operators/localoperator.jl 79.73% <95.65%> (+6.34%) ⬆️
src/algorithms/contractions/bp_contractions.jl 87.27% <78.57%> (-5.11%) ⬇️
src/utility/util.jl 76.14% <75.00%> (-0.20%) ⬇️
src/algorithms/contractions/localoperator.jl 92.27% <86.95%> (-4.19%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leburgel

leburgel commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

I suppose this is exact contraction with CTMRG/BPEnv ?

Yes, precisely that. The idea was to add support for alternative operator forms for situations that are very badly suited to our current dense-tensor-operator approach, while still being compatible with AD to use them in variational optimizations. In particular, the motivating cases are multi-site interactions that factor into a plain tensor product across sites (e.g. plaquette terms in gauge theories), and short-range two-site interactions for systems with a large physical dimension. Both of these are extremely expensive for our current approach, while simply storing the tensor product factors separately or storing the operator as a 2-site MPO of low bond dimension greatly reduces the cost.

This is still very much a draft, but I already filed the PR to demonstrate how #423 allows to easily add support for exact evaluation of different operator types. In particular, the MPOTerm here is a straight duplicate of the MPOObservable introduced in #415. This PR can just stay in draft status until the design that is merged, and then I'll adopt the resulting design here.

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