Evaluate energy expectation value in infinite Purification MPS
Posted: 22 Dec 2025, 10:25
I ran into trouble trying to evaluate energy expectation value in an infinite purification MPS (which will model a thermal state). I installed the newest version of TeNPy (1.1.0) using conda today.
My setup is as follows:
Then in principle I run imaginary PurificationTEBD.
Then when I try
I get AttributeError: 'MPO' object has no attribute 'rank'
while
gives ValueError: different rank!
What is the correct way to evaluate such a thermal expectation value in the PurificationMPS formulation?
In the documentation I could just find examples for spin operators.
I would be grateful for any help, as I am a complete novice in TeNPy...
Romuald
My setup is as follows:
Python: Select all
from tenpy.models.tf_ising import TFIChain
from tenpy.networks.purification_mps import PurificationMPS
model_params = {"L": 2,"J": 1.0, "g": 1.0, "bc_MPS": "infinite"}
model = TFIChain(model_params)
sites = model.lat.mps_sites()
psi = PurificationMPS.from_infiniteT(sites, bc="infinite", form="B")
Then when I try
Python: Select all
print(psi.expectation_value(model.H_MPO))
while
Python: Select all
print(model.H_MPO.expectation_value(psi))
What is the correct way to evaluate such a thermal expectation value in the PurificationMPS formulation?
In the documentation I could just find examples for spin operators.
I would be grateful for any help, as I am a complete novice in TeNPy...
Romuald