Skip to content

fix: off-by-one error in InfiniteMPO quasiparticle environments - #492

Merged
lkdvos merged 1 commit into
QuantumKitHub:mainfrom
dartsushi:master
Jul 31, 2026
Merged

fix: off-by-one error in InfiniteMPO quasiparticle environments#492
lkdvos merged 1 commit into
QuantumKitHub:mainfrom
dartsushi:master

Conversation

@dartsushi

Copy link
Copy Markdown
Contributor

Hello I am Atsushi.
I encountered a space mismatch when taking the expectation value of the infinite MPO that is non-uniform inside the unit cell.

Belows are the function that I used to get the momentum in the y-direction of a cylinder:

function O_shift_unitcell(Ly)
    I = id(ComplexF64, Z2Space(0=>1,1=>1))
    @tensor O[W S; N E] := I[W; N] * I[S; E]
    O_ring = periodic_boundary_conditions(InfiniteMPO([O]), Ly)
    return InfiniteMPO(collect(O_ring))
end

function expectation_value_qp(O,ϕ)
    Oϕ = MPSKit.effective_excitation_hamiltonian(O, ϕ)
    return dot(ϕ,Oϕ)/ dot(ϕ,ϕ)
end

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/environments/qp_envs.jl 77.85% <100.00%> (+77.85%) ⬆️

... and 82 files 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 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.

Hello Atsushi, nice to meet you!
Thanks for fixing this issue, this is greatly appreciated ❤️

@lkdvos
lkdvos merged commit 9e657ff into QuantumKitHub:main Jul 31, 2026
26 of 29 checks passed
@lkdvos lkdvos changed the title small bug in qp environment fix: off-by-one error in InfiniteMPO quasiparticle environments Jul 31, 2026
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