Advanced Computing Platform for Theoretical Physics


Commit 21d08b21 authored by Lei Wang's avatar Lei Wang
Browse files

added info

parent ca716f2a
......@@ -35,6 +35,8 @@ loss.backward()
exact_grad = ((T.grad + T.grad.t())/2) # need to symmetrize since it is an upper triangular matrix
# (4) use leading eigenvector of the transfer matrix $T$
#c.f. sec.3.1
#or, HF theorem
eigenvector_grad= torch.ger(v[:,-1], v[:, -1])/w[-1] # outer product of the leading eigenvector and its transpose
print ((impurity_grad-exact_grad).abs().max().item())
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