Skip to content

fix-mps-encoding-non-factorizing: requirements change - #47

Merged
jascal merged 1 commit into
mainfrom
fix-mps-encoding-non-factorizing
May 1, 2026
Merged

fix-mps-encoding-non-factorizing: requirements change#47
jascal merged 1 commit into
mainfrom
fix-mps-encoding-non-factorizing

Conversation

@jascal

@jascal jascal commented May 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Documents that the rung-1 hierarchical-polysemy MPS staircase shipped in add-mps-concept-encoding: §1, §3-§7 — hierarchical polysemy example, demo, docs #46 has Schmidt rank 2 but its Gram still factorizes as ⟨c_i|c_j⟩ = ∏_k cos((θ_{i,k} − θ_{j,k})/2) — identical to the rung-0 product-state Gram with the same angles. The four-tier hierarchy comes from angle design, not entanglement.
  • Proposes a cross-coupled-by-sum encoding Ry(q0,a); CNOT; Ry(q1,a+b); CNOT; Ry(q2,b+c) that preserves Schmidt rank 2 and produces a non-factorized Gram (diff ≈ 0.32 vs. same-angle product-state).
  • Sharpens two capability requirements: language (Hierarchical Polysemantic Example Pattern adds a non-factorization criterion) and compiler (MPS Concept Gram Matrix Analysis Helper accepts linear-combination angle expressions, option 2a).

This is a requirements-only change. No example, helper, demo, or docs are touched in this PR — those are the 29 tasks in tasks.md to be implemented in a follow-up PR.

Test plan

  • openspec validate fix-mps-encoding-non-factorizing --strict passes
  • openspec list shows the change as pending (0/29 tasks)
  • Reviewer sanity-check: design.md §"Why this particular staircase factorizes" math intuition is correct
  • Reviewer sanity-check: the three alternatives (A: cross-coupled-by-sum, B: brick-wall, C: γ-cross-coupled) and the recommendation rationale (A: symmetric cross-coupling, lowest framing churn, smallest helper rewrite) are sound
  • Reviewer sanity-check: the post-mortem text in design.md §"Post-mortem entry in archived design" is the appropriate single edit to archived add-mps-concept-encoding/design.md

🤖 Generated with Claude Code

The shipped rung-1 hierarchical-polysemy example uses an MPS
staircase that has Schmidt rank 2 but whose Gram still factorizes
as ⟨c_i|c_j⟩ = ∏_k cos((θ_{i,k} − θ_{j,k})/2) — identical to the
rung-0 product-state Gram with the same angles. The four-tier
hierarchy emerges from angle design, not entanglement.

This OpenSpec change documents the bug and proposes a cross-
coupled-by-sum encoding `Ry(q0,a); CNOT; Ry(q1,a+b); CNOT;
Ry(q2,b+c)` that preserves Schmidt rank 2 *and* produces a
non-factorized Gram (diff ≈ 0.32 vs. same-angle product-state).
The compiler helper generalizes its effect-shape detector to
accept linear-combination angle expressions (option 2a).

Files: proposal.md, design.md (3 alternatives + post-mortem text),
tasks.md (29 tasks across 8 sections), specs/language/spec.md
(MODIFIED hierarchical-example requirement adds non-factorization
criterion + scenario), specs/compiler/spec.md (MODIFIED helper
requirement accepts linear-combination angles).

`openspec validate --strict` passes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jascal
jascal merged commit a5cc443 into main May 1, 2026
6 checks passed
@jascal
jascal deleted the fix-mps-encoding-non-factorizing branch May 1, 2026 22:43
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.

1 participant