Relation between bond energies and total expected value of energy of MPS

How do I use this algorithm? What does that parameter do?
Post Reply
Ozaru9000
Posts: 9
Joined: 01 Nov 2019, 18:29

Relation between bond energies and total expected value of energy of MPS

Post by Ozaru9000 »

I am running some tests using SpinChain. I obtained the ground states and a few excited ones using DMRG. Then, I calculated the expected value of energy of the whole MPS, and also bond energies:

Code: Select all

        spinSite = SpinSite(S=0.5, conserve='Sz')
        lattice = Chain(L=N, site=spinSite)
        model_params = {...}
        model = SpinModel(model_params)
        [...]
        for i in range(8):
            psi = MPS.from_product_state(sites, State, "finite")
            mixer_params = {}
            dmrg_params = {"trunc_params": {"chi_max": chi_max, "svd_min": svd_min}, "mixer": mixer,"mixer_params":mixer_params,
                'combine': True,"orthogonal_to": excited_states, 'verbose':False}
            info = dmrg.run(psi, model, dmrg_params)
            excited_states.append(psi)

            # Energy
            energy = info['E']
            bond_energies = model.bond_energies(psi)
        [...]
I suspected, that the sum of bond energies should give the expected energy, but it's not always the case. Below I'm pasting some example results for a chain consisting of 3 sites:

Code: Select all

energy:  0.5
bond_energies:  [0.25 0.25]
sum(bond_energies):  0.5

energy:  -1.0
bond_energies:  [-0.5 -0.5]
sum(bond_energies):  -1.0000000000000004

energy:  -1.3877787807814466e-17
bond_energies:  [ 2.91433544e-16 -3.19189120e-16]
sum(bond_energies):  -2.775557561562896e-17

energy:  -1.1148336360798884e-16              # <---
bond_energies:  [ 0.24669963 -0.44867985]     # <---
sum(bond_energies):  -0.20198021966036506     # <---

energy:  -1.0
bond_energies:  [-0.5 -0.5]
sum(bond_energies):  -0.9999999999999998

energy:  -2.4903616914531226e-18              # <---
bond_energies:  [ 0.15147753 -0.70883147]     # <---
sum(bond_energies):  -0.5573539334676407      # <---

energy:  -7.320883228133898e-18               # <---
bond_energies:  [-0.08633658  0.07732684]     # <---
sum(bond_energies):  -0.009009746969017227    # <---

energy:  0.5
bond_energies:  [0.25 0.25]
sum(bond_energies):  0.5
What am I missing?
User avatar
Johannes
Site Admin
Posts: 413
Joined: 21 Jul 2018, 12:52
Location: TU Munich

Re: Relation between bond energies and total expected value of energy of MPS

Post by Johannes »

You tried to find *all* possible eigenstates, right? Really, DMRG is not good at finding highly excited states - that's not what it is designed for ;)


What fails is not the calculation of the energy, but the trick of finding excited eigenstates with an algorithm (DMRG) looking for the ground state.

The trick to find excited states used in TeNPy is to replace \( H \rightarrow H' = (1 - \sum_i |\psi_i\rangle\langle\psi_i|) H (1 - \sum_i |\psi_i\rangle\langle\psi_i|) \), where the sum is over all previously found \(|\psi_i\rangle\).
This works as long as there are eigenstates of \(H\) with \(\langle\psi| H |\psi\rangle < 0\), which are orthogonal to the subspace of previously found states. However, when all remaining eigenstates to be found have energies larger than 0, DMRG on \(H'\) will (correctly) find some combination of the previous states as a new ground state of \(H'\), with energy 0.

I'm quite sure that in the cases where you get DMRG energy 0 (up to numerical precision), DMRG really gave you just a linear combination of previously found states. When you calculate the bond energies again, you get the correct \(E=\langle \psi | H |\psi\rangle \neq \langle \psi | H'| \psi \rangle = 0 \). You should get the same energy value if you use

Code: Select all

model.H_MPO.expectation_value(psi)
calculating the value from the MPO instead of the bond terms.


PS: sorry for the late reply. I hope this still helps.
Post Reply