Skip to content

fix: Julia 1.13 compatibility - #76

Merged
lkdvos merged 2 commits into
mainfrom
sectors
Sep 10, 2026
Merged

fix: Julia 1.13 compatibility#76
lkdvos merged 2 commits into
mainfrom
sectors

Conversation

@lkdvos

@lkdvos lkdvos commented Sep 10, 2026

Copy link
Copy Markdown
Member

Two Julia 1.13 fixes.

sectors(::SumSpace) ordering. _sectors returned values(::Set) — hash order. Julia 1.13 changed it, so the two sectors(V) assertions in test/vectorspaces/sumspace.jl failed (they had codified 1.12's order; for U₁ that happened to be the sorted one). The order also reaches fusion tree enumeration through map(sectors, P). Sort instead, matching sectors(::GradedSpace) and blocksectors(::ProductSpace), and assert issorted rather than a fixed permutation.

One/Zero scalars into LinearAlgebra. mul! accumulates block contributions with β = One(), which travels through _mul!! into LinearAlgebra; 1.13's HERK path calls isreal(β), which VectorInterface.One does not implement, so w' * w errors. Map One/Zero to true/false at that hand-off — false is exactly the strong zero LinearAlgebra documents, so semantics are unchanged. Marked TODO for removal once VectorInterface covers the Number interface.

Green on 1.12.6 (full suite) and on 1.13.0 (full suite).

🤖 Generated with Claude Code

`_sectors` returned `values(::Set)`, i.e. hash iteration order, which changed
in Julia 1.13 and broke the two `sectors(V)` assertions in the SumSpace tests
(they had codified 1.12's order). The order also leaks into fusion tree
enumeration via `map(sectors, P)`, making the layout within a block depend on
the Julia version.

Sort the result instead, consistent with `sectors(::GradedSpace)` (sorted by
construction) and `blocksectors(::ProductSpace)` (ends with `sort!`), and
assert the invariant with `issorted` rather than a hardcoded permutation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/linalg/linalg.jl 75.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/vectorspaces/sumspace.jl 60.54% <100.00%> (ø)
src/linalg/linalg.jl 81.42% <75.00%> (-0.33%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

`mul!` accumulates block contributions with `β = One()`, which reaches
`LinearAlgebra` untouched. On Julia 1.13 the HERK path calls `isreal(β)`, which
`VectorInterface.One` does not implement, so `w' * w` errors. Map `One`/`Zero`
to `true`/`false` at that hand-off; the latter is exactly the strong zero
`LinearAlgebra` documents, so the semantics are unchanged. The generic
`_mul!!` fallbacks keep the `One`/`Zero` types for VectorInterface's promotion.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@lkdvos lkdvos changed the title fix: canonical ordering for sectors(::SumSpace) fix: Julia 1.13 compatibility Sep 10, 2026
@lkdvos

lkdvos commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

See also QuantumKitHub/VectorInterface.jl#54 for a "better" fix for the One/Zero issue

@lkdvos
lkdvos merged commit eb3b342 into main Sep 10, 2026
28 checks passed
@lkdvos
lkdvos deleted the sectors branch September 10, 2026 20:53
@lkdvos lkdvos mentioned this pull request Sep 11, 2026
lkdvos referenced this pull request Sep 11, 2026
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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