Skip to content

Task 10: use exact bounded-rank MPS/MPO contraction (4.90x) - #15

Open
QingyunQian wants to merge 5 commits into
sxzgroup:v2from
QingyunQian:codex/task-10-final-expert-optimization
Open

Task 10: use exact bounded-rank MPS/MPO contraction (4.90x)#15
QingyunQian wants to merge 5 commits into
sxzgroup:v2from
QingyunQian:codex/task-10-final-expert-optimization

Conversation

@QingyunQian

@QingyunQian QingyunQian commented Jul 29, 2026

Copy link
Copy Markdown

Take-home insight

The 4.90x result is a cold graph-specialization win, not an intrinsic MPO-gate or contraction-FLOP advantage. The candidate replaces a generic TensorNetwork that must be built, planned, differentiated, and compiled in every fresh process with a fixed exact sequence of local MPS/MPO contractions. The bond bound 1 -> 2 -> 4 guarantees exactness.

Result

Public expert: 18.931 s; candidate: 3.869 s; five-pair speedup: 4.898x (95% t-CI 4.598–5.199x).

Five-pair cold-JIT ablation Speedup (95% t-CI) Interpretation
Native hyperedge → fixed path 1.626x (1.373–1.878x) CopyNode-amplified path search is the largest isolated factor
Fixed-path hyperedge → MPO 1.011x (0.965–1.057x) No resolved MPO gate advantage
Fixed-path generic MPO → fused rotations 1.210x (1.161–1.258x) Less graph construction and preprocessing
Fused fixed-path generic graph → local MPS 1.158x (1.119–1.198x) Smaller, more regular traced/AD program

The native hyperedge and MPO have the same contraction width and nearly identical FLOPs. Once the path is fixed, their runtimes are indistinguishable. Profiling instead locates the headline gain in cold lowering plus XLA compilation: 17.514 s3.541 s.

Reviewer-facing files:

  • optimized_solutions/challenge-10/README.md
  • optimized_solutions/challenge-10/solution_10_exact_mps.py
  • optimized_solutions/challenge-10/factor-ablation.svg

@QingyunQian QingyunQian changed the title Task 10: publish exact bounded-rank MPS/MPO optimization (4.89x) Task 10: use exact bounded-rank MPS/MPO contraction (4.90x) Jul 30, 2026
@refraction-ray

Copy link
Copy Markdown
Member

but the hyperedge gate should be cheaper than the mpo gate proposed by the agent? deserve further abalation and investigation

@QingyunQian

QingyunQian commented Jul 30, 2026

Copy link
Copy Markdown
Author

Follow-up: a deeper cold-JIT ablation changes the attribution.

  • Native hyperedge → same graph with a fixed path: 1.626x (95% CI 1.373–1.878x).
  • Fixed-path hyperedge → fixed-path MPO: 1.011x (0.965–1.057x), still neutral.
  • Fixed-path generic MPO → fused rotations: 1.210x.
  • Fused fixed-path generic graph → local MPS: 1.158x.

So the native hyperedge is not intrinsically slower. Its CopyNodes mainly enlarge the planning problem by disabling gate merging; once the path is fixed, hyperedge and MPO are indistinguishable. More importantly, the 4.90x headline is a cold graph-specialization/lowering/compilation win, not a 4.90x reduction in contraction FLOPs from using low-rank MPS.

I updated the PR description, concise report, and ablation figure in 0b936d9.

@QingyunQian
QingyunQian changed the base branch from main to v2 August 3, 2026 06:07
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