Advanced Computing Platform for Theoretical Physics

Commit 411c9536 authored by Lei Wang's avatar Lei Wang
Browse files

svd from adlib

parent 96781588
import torch
from scipy import optimize
from tensornets.adlib import SVD
svd = SVD.apply
def step(T, C, E, chi):
dimT, dimE = T.shape[0], E.shape[0]
D_new = min(dimE*dimT, chi)
......@@ -15,7 +18,7 @@ def step(T, C, E, chi):
Rho = Rho/Rho.norm()
# step 2: Get Isometry P
U, S, V = torch.svd(Rho)
U, S, V = svd(Rho)
truncation_error = S[D_new:].sum()/S.sum()
P = U[:, :D_new] # projection operator
......
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