Skip to content

Conversation

@borisdevos
Copy link
Member

During the IDMRG iterations, the objective which is supposed to represent the expectation value of the Hamiltonian is completely incorrect. This is because the environment only gets recalculated with recalculate! at the end of the sweeps, so these intermediate values are irrelevant.

I chose to remove showing these values, but another option is to calculate the expectation value without passing the environments, thus recalculating at every step. I don't know how costly this step is, so I chose to do it like in IDMRG2.

@codecov
Copy link

codecov bot commented Aug 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/algorithms/groundstate/idmrg.jl 98.38% <100.00%> (ø)

... and 2 files with indirect coverage changes

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

@borisdevos
Copy link
Member Author

The docs failing is probably because TensorOperations moved to the QuantumKitHub, right?

@lkdvos
Copy link
Member

lkdvos commented Aug 20, 2025

I'm not super happy with simply removing this, because this can actually still be useful information for debugging purposes. I do agree that the current solution needs some work though.

The problem is a bit that indeed, during the IDMRG procedure, we are effectively growing the environments by a single site every iteration, so the actual expectation value that is being printed is the current total energy, which therefore scales as the number of iterations.
In some sense the difference between the current and previous iteration is therefore the current best guess for the energy density per unit cell, which might be a more relevant quantity to print.

This could be achieved manually, but an alternative might be to actually properly normalize the IDMRG environments as well, simply by subtracting the fixedpoint contribution at the beginning of every iteration.
I think this solution also has the added benefit that the norm of the environment tensors should also remain more bounded, as otherwise these technically drift with each iteration.

All of this being said though, I'd be okay with removing the result here, if we add a debug verbosity option that prints the (dominant) eigenvalue of the local eigenvalue solvers, which might also be a good feature to have anyways.

(I'll try fix the docs asap)

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