Repository navigation
Trotter tensor contraction - #95
Merged
Merged
Conversation
This commit adds the ability to force a specific tensor contraction algorithm via configuration, enabling controlled comparisons between: - O(n) incremental method - O(log n) structured method (matrix exponentiation) Changes: - analysis/config_types.py: Add tensor_contraction_method parameter with validation (None, "auto", "incremental", "structured") - analysis/unitary.py: Pass parameter through to Trotterization - common/trotter_flattened.py: Implement forced mode logic in tensor_contract() method When forced to "structured" but pattern cannot be detected, raises RuntimeError instead of falling back (no silent behavior changes). This enables comparison studies to test each algorithm under identical conditions regardless of auto-selection thresholds.
… tweaks, and then add tests.
BrendanKKrueger
marked this pull request as ready for review
August 6, 2026 22:10
…run the CI pipelines.
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.
Allow the user to explicitly force a particular tensor contraction algorithm for the flattened Trotter. This option is intentionally not documented, because as a general rule it should only be used by developers. I need it for testing.