Skip to content

Trim direct ITensorMPS imports from tests, quarantine MPO cross-check#332

Merged
mtfishman merged 1 commit intomainfrom
mf/remove-itensormps-uses
Apr 24, 2026
Merged

Trim direct ITensorMPS imports from tests, quarantine MPO cross-check#332
mtfishman merged 1 commit intomainfrom
mf/remove-itensormps-uses

Conversation

@mtfishman
Copy link
Copy Markdown
Member

@mtfishman mtfishman commented Apr 24, 2026

Summary

Pull the remaining direct ITensorMPS imports out of the test files that can trivially live without them, and quarantine the ones that genuinely need the ITensorMPS.MPO construction as a reference oracle.

Test changes:

  • test/solvers/test_applyexp.jl, test/solvers/test_eigsolve.jl: switch using ITensorMPS: OpSumusing ITensors.Ops: OpSum. OpSum lives in ITensors.Ops; ITensorMPS just re-exports it, so there was no reason for these tests to depend on ITensorMPS for it.
  • test/test_opsum_to_ttn.jl: trim to keep only the "Multiple onsite terms" regression test — the one testset that does not need ITensorMPS.MPO(os, sites) as a reference. Drop the using ITensorMPS: ITensorMPS line.
  • test/test_opsum_to_ttn_mpo_cross_check.jl (new): houses the four testsets that compare ttn(H, is) against prod(ITensorMPS.MPO(H, sites)) — "OpSum to TTN", "OpSum to TTN QN", "OpSum to TTN Fermions", "OpSum to TTN QN missing". These are verbatim from the old file (plus their to_matrix helper). Quarantining them into a single file makes the remaining ITensorMPS test-time dependency easy to track and delete once there are internal equivalents for those correctness checks.

No src/ changes. ITensorMPS was never a dependency of the package itself (only of test/); this PR just reduces the test-time surface that pulls it in.

Version

Patch-bump to 0.18.1 (test-only diff, substantive per the standard VersionCheck classification).

Switch `test/solvers/test_applyexp.jl` and `test/solvers/test_eigsolve.jl`
from `using ITensorMPS: OpSum` to `using ITensors.Ops: OpSum` — `OpSum`
lives in the `ITensors.Ops` submodule; ITensorMPS just re-exports it,
so there is no reason for the tests to depend on ITensorMPS for it.

Move the four testsets in `test/test_opsum_to_ttn.jl` that depend on
`ITensorMPS.MPO(os, sites)` as a cross-check reference into a new
`test/test_opsum_to_ttn_mpo_cross_check.jl`. The trimmed
`test/test_opsum_to_ttn.jl` keeps only the "Multiple onsite terms"
regression test, which does not need ITensorMPS. `ITensorMPS` stays in
`test/Project.toml` as a test-time dependency of the cross-check file;
the package itself has no ITensorMPS dependency.

Quarantining the cross-check into its own file makes it easy to track
the remaining ITensorMPS test-time dependency and delete the file
entirely once ITensorNetworks has internal equivalents for those TTN /
MPO correctness checks.

Bump patch version to 0.18.1 (test-only changes; substantive per the
standard VersionCheck classification).

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

codecov Bot commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.07%. Comparing base (dbb07fe) to head (153a6a0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #332      +/-   ##
==========================================
+ Coverage   71.04%   71.07%   +0.02%     
==========================================
  Files          70       70              
  Lines        3360     3360              
==========================================
+ Hits         2387     2388       +1     
+ Misses        973      972       -1     
Flag Coverage Δ
docs 44.02% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mtfishman mtfishman enabled auto-merge (squash) April 24, 2026 23:08
@mtfishman mtfishman merged commit 31bb354 into main Apr 24, 2026
17 checks passed
@mtfishman mtfishman deleted the mf/remove-itensormps-uses branch April 24, 2026 23:20
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