Conversation
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
leburgel
marked this pull request as draft
August 31, 2026 14:18
expectation_value implementationexpectation_value implementations
This was referenced Sep 2, 2026
…sion through reduced density matrix
…reduced density operators
- Reorganize file structure - Refactor in terms of generic expression generators that can be easily overloaded
Member
|
I'll try coming up with a source tree of expectation-value-related functions to better discuss where each function should be placed. |
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.
Some refactoring and reorganization related to the evaluation of expectation values. The main motivation for this refactor is making it easier to add support for computing expectation values of different kinds of operators, and evaluate these using different kinds of environments. Some examples of this are given in #425 and #426, which are built on top of this refactor.
Short summary:
local_expectation_valuemethod to catch local expectation values for different kinds of operators. This goes through thereduced_densitymatrixapproach forAbstractTensorMaplocal terms, but can follow a different path for different kinds of local terms (see for example [WIP] Add support for local expectation values of tensor product and MPO terms #425).BPEnvexpectation values via reduced density matrix contraction along the genericAbstractTensorMappath, by specializing the appropriate methods.boundary_contraction_expr,bulk_contraction_exproroperator_contraction_expr.