Advanced Computing Platform for Theoretical Physics

commit大文件会使得服务器变得不稳定，请大家尽量只commit代码，不要commit大的文件。

Commit 1df446a5 by Lei Wang

### change to more symmetric ising tensor

parent 400ab95a
 ... ... @@ -66,20 +66,10 @@ if __name__=='__main__': Dcut = 180 n = 50 #Boltzmann factor on a bond M=LR^T M = torch.stack([torch.cat([torch.exp(K), torch.exp(-K)]), torch.cat([torch.exp(-K), torch.exp(K)]) ]) U, S, V = torch.svd(M) L = U*torch.sqrt(S) R = V*torch.sqrt(S) c = torch.sqrt(torch.cosh(K)/2.) s = torch.sqrt(torch.sinh(K)/2.) 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)) # L # | # T = R^{T}-o-L # | # R^{T} T = torch.einsum('ai,aj,ak,al->ijkl', (L, L, R, R)) lnZ, error = ctmrg(T, 2, Dcut, n) print (lnZ.item(), error)
 ... ... @@ -48,20 +48,10 @@ if __name__=='__main__': Dcut = 20 n = 20 #Boltzmann factor on a bond M=LR^T M = torch.stack([torch.cat([torch.exp(K), torch.exp(-K)]), torch.cat([torch.exp(-K), torch.exp(K)]) ]) U, S, V = torch.svd(M) L = U*torch.sqrt(S) R = V*torch.sqrt(S) c = torch.sqrt(torch.cosh(K)/2.) s = torch.sqrt(torch.sinh(K)/2.) 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)) # L # | # T = R^{T}-o-L # | # R^{T} T = torch.einsum('ai,aj,ak,al->ijkl', (L, L, R, R)) lnZ, _ = hotrg(T, 2, Dcut, n) print (lnZ.item())
 ... ... @@ -54,20 +54,10 @@ if __name__=='__main__': Dcut = 20 n = 20 #Boltzmann factor on a bond M=LR^T M = torch.stack([torch.cat([torch.exp(K), torch.exp(-K)]), torch.cat([torch.exp(-K), torch.exp(K)]) ]) U, S, V = torch.svd(M) L = U*torch.sqrt(S) R = V*torch.sqrt(S) c = torch.sqrt(torch.cosh(K)/2.) s = torch.sqrt(torch.sinh(K)/2.) 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)) # L # | # T = R^{T}-o-L # | # R^{T} T = torch.einsum('ai,aj,ak,al->ijkl', (R, L, R, L)) lnZ, _ = hotrg(T, 2, Dcut, n) print (lnZ.item())
 ... ... @@ -40,11 +40,12 @@ if __name__=='__main__': A = torch.nn.Parameter(B.view(d, D**4)) #3D Ising c = torch.sqrt(torch.cosh(beta)) s = torch.sqrt(torch.sinh(beta)) M = torch.stack([torch.cat([c, s]), torch.cat([c, -s])]) c = torch.sqrt(torch.cosh(beta)/2.) s = torch.sqrt(torch.sinh(beta)/2.) M = torch.stack([torch.cat([c+s, c-s]), torch.cat([c-s, c+s])]) T = torch.einsum('ai,aj,ak,al,am,an->ijklmn', (M, M, M, M, M, M)) T = T.view(d, d**4, d) print (T) optimizer = torch.optim.LBFGS([A], max_iter=20) ... ...
 ... ... @@ -47,20 +47,10 @@ if __name__=='__main__': Dcut = 20 n = 20 #Boltzmann factor on a bond M=LR^T M = torch.stack([torch.cat([torch.exp(K), torch.exp(-K)]), torch.cat([torch.exp(-K), torch.exp(K)]) ]) U, S, V = torch.svd(M) L = U*torch.sqrt(S) R = V*torch.sqrt(S) c = torch.sqrt(torch.cosh(K)/2.) s = torch.sqrt(torch.sinh(K)/2.) 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)) # L # | # T = R^{T}-o-L # | # R^{T} T = torch.einsum('ai,aj,ak,al->ijkl', (L, L, R, R)) lnZ, error = levin_nave_trg(T, 2, Dcut, n) print (lnZ.item(), error)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!