Trim direct ITensorMPS imports from tests, quarantine MPO cross-check#332
Merged
Trim direct ITensorMPS imports from tests, quarantine MPO cross-check#332
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pull the remaining direct
ITensorMPSimports out of the test files that can trivially live without them, and quarantine the ones that genuinely need theITensorMPS.MPOconstruction as a reference oracle.Test changes:
test/solvers/test_applyexp.jl,test/solvers/test_eigsolve.jl: switchusing ITensorMPS: OpSum→using ITensors.Ops: OpSum.OpSumlives inITensors.Ops;ITensorMPSjust 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 needITensorMPS.MPO(os, sites)as a reference. Drop theusing ITensorMPS: ITensorMPSline.test/test_opsum_to_ttn_mpo_cross_check.jl(new): houses the four testsets that comparettn(H, is)againstprod(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 theirto_matrixhelper). 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.ITensorMPSwas never a dependency of the package itself (only oftest/); 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 standardVersionCheckclassification).