Advanced Computing Platform for Theoretical Physics

Commit 28f06f9a authored by Lei Wang's avatar Lei Wang
Browse files

initial block in hotrg_manopt.py

parent 594759cb
......@@ -91,15 +91,15 @@ if __name__=='__main__':
M = torch.stack([torch.cat([c+s, c-s]), torch.cat([c-s, c+s])])
T = torch.einsum('ai,aj,ak,al->ijkl', (M, M, M, M))
assert(args.chi in [2, 4, 8, 16, 32]) # chi has to be power of 2
assert(args.chi in [2, 4, 16, 256]) # chi has to be power of 2
#first do a few steps of exact RG to grow bond dimension to args.chi
lnZ = 0.0
#lnZ = 0.0
n = 0
while T.shape != torch.Size([args.chi, args.chi, args.chi, args.chi]):
f = T.abs().max()
lnZ += 2**(-n)*torch.log(f)
T = T / f
#f = T.abs().max()
#lnZ += 2**(-n)*torch.log(f)
#T = T / f
chi = args.D**(2**(n//2))
U = torch.eye(chi**2, chi**2, device=device, dtype=dtype).view(chi, chi, chi**2)
......@@ -107,7 +107,6 @@ if __name__=='__main__':
T = renormalize(T, U)
n = n+1
args.niter -= n
print (T.shape, args.chi, lnZ.item())
print (T.shape, args.chi)
hosrg(T)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment