Closed SUSYUSTC closed 1 year ago
Patch coverage: 98.14%
and project coverage change: +0.05%
:tada:
Comparison is base (
9706a29
) 84.76% compared to head (9a985d1
) 84.81%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Excellent PR and many thanks to Jiace.
It is better to add a test in mps/tests/test_gs.py
. For example, in test_optimization, you can simply add the two mpos together and check if the energy is doubled.
Test already added.
The new function looks good to me. Many thanks for your work!
Meanwhile, personally speaking I prefer well-documented code, so maybe you could add new comments and make changes to the original ones accordingly. For example, the following line should contain the new class:
Comments & types added
Currently if one add two MPOs by
mpo = mpo1 + mpo2
it creates zeros at off-diagonal blocks. In case the final MPO is composed of many small MPOs the computational efficiency is slow. I'll probably add another PR later for diagonal potential MPO, in which case the final MPO is composed of a dense kinetic block and a diagonal potential MPO block.This pull request adds a
StackedMpo
class to improve the efficiency by calculating the Hamiltonians corresponding to each MPO part separately and then adding the Hamiltonians. It works for both the direct and iterative approach.Example: