Skip to content

Add a v1 to v2 migration guide to README.md and llms.txt - #162

Merged
shinaoka merged 1 commit into
mainfrom
docs/migration-guide
Sep 28, 2026
Merged

shinaoka merged 1 commit into
mainfrom
docs/migration-guide

Conversation

@shinaoka

Copy link
Copy Markdown
Member

Closes #161.

Fermions.jl fails on v2 with UndefVarError: default_sampling_points not defined in SparseIR. It calls SparseIR.default_sampling_points(basis.sve_result.u, length(basis)), a v1 internal. In v2 it cannot be restored: an SVEResult holds only the singular values (libsparseir does not return the SVE functions), so basis.sve_result.u fails as well. The fix therefore goes into the caller, and this PR documents it.

Changes

  • README.md: a "Migrating from SparseIR.jl v1" section. A table maps each v1 call that no longer runs to its v2 replacement (required ε, SVEResult, default_sampling_points, uhat_full, roots/sign_changes/find_extrema, factorize, .τ, TauSampling64, custom kernels), followed by the two behavior changes that raise no error (the order of given Matsubara points is kept; basis.u(τ) accepts τ < 0).
  • llms.txt (new): a short v2 API overview for LLM agents, plus the same migration list.
  • test/spir/migration_tests.jl: checks that the documented replacement of default_sampling_points(sve.u, L) / (sve.v, L) gives L ascending points in (-1, 1) at which U_L / V_L of a larger basis vanish.

Verification

  • Compared against SparseIR v1.1.4: 2 .* SparseIR.default_tau_sampling_points(basis) ./ β .- 1 matches v1's default_sampling_points(basis.sve_result.u, length(basis)) to ≤ 1e-9 (the SVE accuracy for ε = 1e-8) for F/B, Λ = 1, 40, 1000. The basis[1:L] variants for τ, ω and Matsubara points (incl. positive_only) match v1 for L = 5, 7, 12, 25.
  • Every v1 call in the table was run against v2 and fails as described.
  • Ran the Fermions.jl propagator tests with local SparseIR.jl v2 and the one-line change in src/Propagators/model.jl: prop_model (7), lehmann (18), gauss (35), prop (964), prop_schedule (10) pass.

🤖 Generated with Claude Code

Code written for v1 fails on names that v2 no longer has, such as
SparseIR.default_sampling_points(basis.sve_result.u, L) (#161). The guide
maps each such call to its v2 replacement. The replacements of the SVE
sampling points were checked against v1.1.4 (agreement to 1e-9 or better),
and a test item checks them against the roots of the next basis function.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shinaoka
shinaoka enabled auto-merge September 28, 2026 13:30
@shinaoka
shinaoka merged commit c3df00d into main Sep 28, 2026
17 checks passed
@shinaoka
shinaoka deleted the docs/migration-guide branch September 28, 2026 13:50
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.

Version 2 does not work with Fermions.jl.

1 participant