Skip to content

Add tests for fermionic periodic boundary conditions#274

Merged
lkdvos merged 8 commits intomasterfrom
fermionic-pbc
Apr 15, 2025
Merged

Add tests for fermionic periodic boundary conditions#274
lkdvos merged 8 commits intomasterfrom
fermionic-pbc

Conversation

@lkdvos
Copy link
Copy Markdown
Member

@lkdvos lkdvos commented Apr 7, 2025

Implement fixes for handling fermionic periodic boundary conditions and adds some tests.

I have to say that this still absolutely confuses me, and I can't really wrap my head around this very well.
The bottom line is that if I understand everything correctly, even though our formalism works, it cannot correctly account for the anticommutation relations on different sites:

using MPSKitModels
h_ij = c_plusmin() + c_minplus()
h_ji = permute(h_ij, ((2, 1), (4, 3)))
h_ij  -h_ji # false!!
h_ij  h_ji # true

I don't think there is any way around this, but I might be mistaken here.

In any case, with this in mind, the previous implementation of PBC did not account for this, so here I added a twist on every link that needs to wrap around.

I think the tests should capture this correctly, but I'm still confused by this entire endeavor, since if I am understanding this correctly, for fermionic systems the following does not hold, while it is what I understand from translation invariance for bosonic systems:

H = # some tensor representing a translation invariant hamiltonian
isapprox(H, permute(H, (TupleTools.circshift(codomainind(H), 1), TupleTools.circshift(domainind(H), 1)))

@Jutho if you could confirm that this is indeed expected, that would be greatly appreciated.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/transfermatrix/transfer.jl 77.77% <100.00%> (ø)
src/utility/utility.jl 75.94% <100.00%> (-0.31%) ⬇️

... 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 enabled auto-merge (squash) April 10, 2025 01:31
@lkdvos lkdvos requested a review from leburgel April 10, 2025 01:31
Copy link
Copy Markdown
Member

@leburgel leburgel left a comment

Choose a reason for hiding this comment

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

Changes themselves look good to me. I think I understand the fix, but I have to say I don't really understand what the problem actually was.

Comment thread src/utility/utility.jl Outdated
Comment thread src/utility/utility.jl Outdated
Comment thread test/algorithms.jl Outdated
@lkdvos lkdvos changed the title Fix and tests for fermionic periodic boundary conditions Add tests for fermionic periodic boundary conditions Apr 15, 2025
@lkdvos lkdvos disabled auto-merge April 15, 2025 21:10
@lkdvos lkdvos merged commit a59d1c0 into master Apr 15, 2025
27 of 28 checks passed
@lkdvos lkdvos deleted the fermionic-pbc branch April 15, 2025 21:11
Comment thread test/algorithms.jl
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.

3 participants