Skip to content

Conversation

@lkdvos
Copy link
Member

@lkdvos lkdvos commented Nov 12, 2025

After some discussions on PEPS this morning, it turns out that the specific gauge choice can have some (accidental) nice or less nice properties.
For example, it looks like this specific gauge-fixing we have here, for CTMRG algorithms, breaks the C4v symmetry in a more manifest way than not doing it.
The setup is that if we perform CTMRG iteration for a C4v symmetric system without imposing it, not gauge-fixing leads to real and diagonal corner matrices, while this specific gauge choice seems to instead give imaginary ones.
While it sounds like this is a fluke, and definitely not something we ever want to depend on, it does seem fair to have the option to turn off the gauge fixing, both since it isn't strictly required and since if you would want to impose a different gauge yourself, this is now wasted effort.

Here, I added a gaugefix::Bool = true keyword argument to the eigenvalue and SVD algorithms to obtain this behavior, and simultaneously slightly refactored the implementation so everything is a little more consistent between the different methods.

@Yue-Zhengyuan
Copy link
Member

Is it possible to have a global switch to turn on or off all SVD gauge fixing?

Copy link
Member

@Jutho Jutho left a comment

Choose a reason for hiding this comment

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

Up to some small comments, this looks great to me.

@lkdvos lkdvos force-pushed the ld-gaugefix branch 2 times, most recently from e2ab949 to ab2a0e4 Compare November 13, 2025 15:59
@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

❌ Patch coverage is 96.03175% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/common/defaults.jl 20.00% 4 Missing ⚠️
src/implementations/eigh.jl 95.83% 1 Missing ⚠️
Files with missing lines Coverage Δ
ext/MatrixAlgebraKitGenericLinearAlgebraExt.jl 95.52% <100.00%> (+0.28%) ⬆️
src/MatrixAlgebraKit.jl 100.00% <ø> (ø)
src/common/gauge.jl 100.00% <100.00%> (ø)
src/implementations/eig.jl 99.08% <100.00%> (+1.93%) ⬆️
src/implementations/gen_eig.jl 100.00% <100.00%> (ø)
src/implementations/svd.jl 92.17% <100.00%> (+0.26%) ⬆️
src/interface/decompositions.jl 52.63% <ø> (ø)
src/implementations/eigh.jl 94.28% <95.83%> (+0.25%) ⬆️
src/common/defaults.jl 61.53% <20.00%> (-25.97%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Jutho
Copy link
Member

Jutho commented Nov 14, 2025

I wonder if the documentation needs to mention something about the gauge fixing not giving rise to a unique and smooth (or even continuous) choice of eigenvectors / singular vectors, which is clear from the fact that if two entries of a vector become equal in magnitude, there will be a sudden jump in the phase assigned to a vector if it changes only slightly. However, it is well known that it is impossible to remedy this globally (i.e. there is no global section), which can be expressed through nonzero topological invariants such as Chern numbers.

@lkdvos
Copy link
Member Author

lkdvos commented Nov 14, 2025

We could add something like this to the documentation if you like, perhaps in a footnote, although I'm not sure if this helps that much.
I don't think we are claiming anywhere that our gauge choice is smooth or unique.
In general I do think that the documentation of a software package might not be where people go to learn about this though, so it isn't entirely obvious to me to whom this would be directed 🙃

@lkdvos lkdvos enabled auto-merge (squash) November 14, 2025 15:13
@lkdvos lkdvos disabled auto-merge November 14, 2025 15:46
@lkdvos lkdvos merged commit 15d1c5a into main Nov 14, 2025
10 checks passed
@lkdvos lkdvos deleted the ld-gaugefix branch November 14, 2025 16:37
@lkdvos lkdvos mentioned this pull request Nov 14, 2025
lkdvos referenced this pull request Nov 14, 2025
* Bump v0.6

* rename `gaugefix` -> `fixgauge`

* reduce unnecessary warnings

* fix `copy_input` signatures in Mooncake tests

* Add changelog to docs
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.

5 participants