Advanced Computing Platform for Theoretical Physics
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Lei Wang
dTRG
Commits
411c9536
Commit
411c9536
authored
Feb 19, 2020
by
Lei Wang
Browse files
svd from adlib
parent
96781588
Changes
1
Hide whitespace changes
Inline
Side-by-side
fixedpoint.py
View file @
411c9536
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment