Skip to content

refactor: transfer_spectrum and correlation_length default to sector-centered implementation#452

Open
lkdvos wants to merge 7 commits into
mainfrom
ld-transfer
Open

refactor: transfer_spectrum and correlation_length default to sector-centered implementation#452
lkdvos wants to merge 7 commits into
mainfrom
ld-transfer

Conversation

@lkdvos

@lkdvos lkdvos commented Jul 6, 2026

Copy link
Copy Markdown
Member

This PR refactors the transfer_spectrum function to be more in line with the entanglement_spectrum function, and return a SectorVector for the different sectors that may appear.
This also gives us the opportunity to actually compute the correlation length in the dominant sector, rather than defaulting to the trivial sector instead, which is something that had surfaced before: See also QuantumKitHub/PEPSKit.jl#216

Something else that had been bothering me for a long time is that the krylov dimension is selected once up front, and then never changed, so it really required quite a bit of manual scripting to actually get a reasonable set of transfer values for all different sectors.
Here i've introduced oversampling and oversampling_factor as ways to set the krylov dimension from the requested values instead, which might be a bit more ergonomic?

Finally, this is in preparation of improving the plotting functionality, see also #428, which I'd like to give similar interfaces so it might be useful to think about this a bit.

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.07692% with 21 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/algorithms/transfer_spectrum.jl 72.85% 19 Missing ⚠️
src/utility/plotting.jl 75.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
src/MPSKit.jl 100.00% <ø> (ø)
src/algorithms/toolbox.jl 97.86% <ø> (+1.46%) ⬆️
src/utility/plotting.jl 82.60% <75.00%> (-2.24%) ⬇️
src/algorithms/transfer_spectrum.jl 72.85% <72.85%> (ø)

... and 1 file with indirect coverage changes

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

@lkdvos lkdvos marked this pull request as ready for review July 6, 2026 23:12
Comment thread docs/src/examples/classic2d/1.hard-hexagon/index.md
@lkdvos lkdvos requested a review from borisdevos July 7, 2026 17:14

@borisdevos borisdevos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, but looks good to me!

Comment thread src/algorithms/transfer_spectrum.jl Outdated
# Keyword arguments

- `num_vals=20`: the number of eigenvalues to compute. This can either be a single `Int`, which is used for every sector of the transfer space,
or an `AbstractDict`/iterable of `sector => count` pairs to restrict the computation to specific sectors and request a different number of values per sector.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just messing around with different iterables of pairs, I feel like the only one that behaves as expected is a dictionary. Calling pairs on a vector or tuple behaves different to what I expected at least, and just gives the dictionary back in that case.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops, that was my bad - should just iterate the thing that was handed to me, not actually iterate the pairs specifically

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.

2 participants