added direct MPO Process Tensor construction and temporal entanglement#508
Conversation
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe tomography backend now constructs MPO process tensors directly by default, while dense outputs continue to use exhaustive tomography. Shared APIs compute temporal entanglement and evaluate probes across dense and MPO representations, with expanded tests and documentation. ChangesProcess-tensor construction and analysis
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant MemoryCharacterizer
participant build_process_tensor_direct
participant _apply_timestep
participant MPOProcessTensor
User->>MemoryCharacterizer: request return_type="mpo"
MemoryCharacterizer->>build_process_tensor_direct: construct process tensor
build_process_tensor_direct->>_apply_timestep: expand each intervention leg
_apply_timestep->>MPOProcessTensor: accumulate compressed MPO terms
MPOProcessTensor-->>User: return MPO process tensor
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/mqt/yaqs/memory_characterizer.py`:
- Line 10: Replace the malformed Ruff suppression comments with valid noqa
comments or a Ruff disable block: retain the module-level suppression at
src/mqt/yaqs/memory_characterizer.py:10, and update the inline suppressions at
src/mqt/yaqs/memory_characterizer.py:870,
src/mqt/yaqs/characterization/memory/backends/tomography/constructor.py:444,
tests/characterization/memory/backends/tomography/test_process_tensors.py:8, and
tests/characterization/memory/backends/tomography/test_basis.py:8 so Ruff
recognizes the intended codes.
In `@tests/characterization/memory/backends/tomography/test_direct.py`:
- Line 33: Update the parametrized interacting equivalence test in
test_direct.py by replacing the all-zero timesteps schedule with nonzero
evolution durations, while preserving the existing schedule length of
num_interventions + 1 and the rest of the test setup.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 84d97fae-d61d-4f3b-8dee-adc02b2d66be
📒 Files selected for processing (15)
CHANGELOG.mddocs/examples/characterization.mddocs/examples/memory_surrogate.mddocs/examples/quickstart.mdsrc/mqt/yaqs/characterization/memory/backends/__init__.pysrc/mqt/yaqs/characterization/memory/backends/tomography/__init__.pysrc/mqt/yaqs/characterization/memory/backends/tomography/constructor.pysrc/mqt/yaqs/characterization/memory/backends/tomography/data.pysrc/mqt/yaqs/characterization/memory/backends/tomography/direct.pysrc/mqt/yaqs/characterization/memory/backends/tomography/process_tensors.pysrc/mqt/yaqs/memory_characterizer.pytests/characterization/memory/backends/tomography/test_basis.pytests/characterization/memory/backends/tomography/test_data.pytests/characterization/memory/backends/tomography/test_direct.pytests/characterization/memory/backends/tomography/test_process_tensors.py
💤 Files with no reviewable changes (1)
- tests/characterization/memory/backends/tomography/test_data.py
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/mqt/yaqs/characterization/memory/backends/tomography/direct.py`:
- Around line 191-210: The direct MPO construction path must not pass a
flattened dense state to the TJM solver. In the worker containing the br.psi
conversion and _evolve_backend_state call, either reject solver="TJM" for
return_type="mpo" before branch extension, or preserve br.psi as an MPS
throughout this path; ensure unsupported combinations fail clearly and non-TJM
behavior remains unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: fc266adf-c0d4-40d9-9081-a75085c9dfe1
📒 Files selected for processing (10)
docs/examples/characterization.mddocs/examples/memory_surrogate.mdsrc/mqt/yaqs/characterization/memory/backends/tomography/__init__.pysrc/mqt/yaqs/characterization/memory/backends/tomography/constructor.pysrc/mqt/yaqs/characterization/memory/backends/tomography/direct.pysrc/mqt/yaqs/characterization/memory/backends/tomography/process_tensors.pysrc/mqt/yaqs/memory_characterizer.pytests/characterization/memory/backends/tomography/test_constructor.pytests/characterization/memory/backends/tomography/test_direct.pytests/characterization/memory/backends/tomography/test_process_tensors.py
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/mqt/yaqs/characterization/memory/backends/tomography/direct.py`:
- Line 305: Restore a finite default max_bond_dim so _compress_branches runs by
default and direct construction remains scalable, while preserving None as the
opt-in for exact uncapped construction. Apply the same finite default in
src/mqt/yaqs/characterization/memory/backends/tomography/direct.py lines 305-305
and src/mqt/yaqs/characterization/memory/backends/tomography/constructor.py
lines 397-397; align the facade default and documentation in
src/mqt/yaqs/memory_characterizer.py lines 329-329.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: e8c1fc02-f303-4b2e-8ece-3b1b05d9228a
📒 Files selected for processing (10)
docs/examples/characterization.mddocs/examples/memory_surrogate.mdsrc/mqt/yaqs/characterization/memory/backends/__init__.pysrc/mqt/yaqs/characterization/memory/backends/tomography/__init__.pysrc/mqt/yaqs/characterization/memory/backends/tomography/constructor.pysrc/mqt/yaqs/characterization/memory/backends/tomography/direct.pysrc/mqt/yaqs/memory_characterizer.pytests/characterization/memory/backends/tomography/test_constructor.pytests/characterization/memory/backends/tomography/test_direct.pytests/characterization/noise/backends/test_cma.py
|
@coderabbitai review |
✅ Action performedReview finished.
|
Description
This PR adds the ability (and new default) to directly construct and MPO Process Tensor step by step rather than with tomography.
Additionally, it adds a proper temporal entanglement measure.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).Assisted-by: [Model Name] via [Tool Name]footer.