-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpinGlassPEPS.jl
58 lines (53 loc) · 1.66 KB
/
SpinGlassPEPS.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
module SpinGlassPEPS
using LinearAlgebra
using Requires
using TensorOperations, TensorCast
using LowRankApprox
using LightGraphs
using MetaGraphs
using CSV
using Logging
using StatsBase
using Memoize, LRUCache
using DocStringExtensions
const product = Iterators.product
include("base.jl")
include("utils.jl")
include("compressions.jl")
include("identities.jl")
include("contractions.jl")
include("lattice.jl")
include("ising.jl")
include("exact.jl")
include("factor.jl")
include("network.jl")
include("PEPS.jl")
include("MPS_search.jl")
include("notation.jl")
include("peps_no_types.jl")
function __init__()
@require CUDA="052768ef-5323-5732-b1bb-66c8b64840ba" begin
if CUDA.functional() && CUDA.has_cutensor()
const CuArray = CUDA.CuArray
const CuVector = CUDA.CuVector
const CuMatrix = CUDA.CuMatrix
const CuSVD = CUDA.CUSOLVER.CuSVD
const CuQR = CUDA.CUSOLVER.CuQR
const cu = CUDA.cu
using CUDA
# const cuda = CUDA.@cuda
CUDA.allowscalar(false)
@inline function cudiv(x::Int)
max_threads = 256
threads_x = min(max_threads, x)
threads_x, ceil(Int, x/threads_x)
end
include("cuda/base.jl")
include("cuda/utils.jl")
include("cuda/contractions.jl")
include("cuda/compressions.jl")
include("cuda/spectrum.jl")
end
end
end
end