diff --git a/precompile/generate_precompile.jl b/precompile/generate_precompile.jl deleted file mode 100644 index d226bdfbe6..0000000000 --- a/precompile/generate_precompile.jl +++ /dev/null @@ -1,23 +0,0 @@ -using SnoopCompile - -# Note: in order to generate a new precompile.jl file, -# you need to comment out the lines: -# ``` -# include("../precompile/precompile.jl") -# _precompile_() -# ``` -# in src/ITensors.jl (otherwise many functions will -# be precompiled and SnoopCompile won't think they -# need to get precompiled). -# -# Also, snooping on dmrg itself causes problems in -# precompilation. Explicitly add the command: -# ``` -# precompile(Tuple{typeof(dmrg),MPO,MPS,Sweeps}) -# ``` -# to precompile.jl after it is generated. - -inf_timing = @snoopi tmin = 0.01 include("snoop/snoop.jl") -pc = SnoopCompile.parcel(inf_timing) -SnoopCompile.write("tmp", pc) -cp("tmp/precompile_ITensors.jl", "precompile.jl"; force=true) diff --git a/precompile/precompile.jl b/precompile/precompile.jl deleted file mode 100644 index bda6e3b024..0000000000 --- a/precompile/precompile.jl +++ /dev/null @@ -1,1321 +0,0 @@ -function _precompile_() - ccall(:jl_generating_output, Cint, ()) == 1 || return nothing - precompile( - Tuple{ - Core.kwftype(typeof(ITensors.eigen)), - NamedTuple{ - ( - :ishermitian, - :which_decomp, - :tags, - :maxdim, - :mindim, - :cutoff, - :eigen_perturbation, - :ortho, - ), - Tuple{Bool,Nothing,TagSet,Int64,Int64,Float64,Nothing,String}, - }, - typeof(eigen), - ITensor{2}, - IndexSet{1,Index{Int64},Tuple{Index{Int64}}}, - IndexSet{1,Index{Int64},Tuple{Index{Int64}}}, - }, - ) - precompile( - Tuple{ - Core.kwftype(typeof(ITensors.factorize)), - NamedTuple{ - (:which_decomp, :tags, :maxdim, :mindim, :cutoff, :eigen_perturbation, :ortho), - Tuple{Nothing,TagSet,Int64,Int64,Float64,Nothing,String}, - }, - typeof(factorize), - ITensor{3}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - ) - precompile( - Tuple{ - Core.kwftype(typeof(ITensors.replacebond!)), - NamedTuple{ - (:maxdim, :mindim, :cutoff, :eigen_perturbation, :ortho, :which_decomp), - Tuple{Int64,Int64,Float64,Nothing,String,Nothing}, - }, - typeof(replacebond!), - MPS, - Int64, - ITensor{3}, - }, - ) - precompile( - Tuple{ - Core.kwftype(typeof(KrylovKit.eigsolve)), - NamedTuple{ - (:ishermitian, :tol, :krylovdim, :maxiter),Tuple{Bool,Float64,Int64,Int64} - }, - typeof(KrylovKit.eigsolve), - ProjMPO, - ITensor{3}, - Int64, - Symbol, - }, - ) - precompile( - Tuple{ - Core.kwftype(typeof(KrylovKit.expand!)), - NamedTuple{(:verbosity,),Tuple{Int64}}, - typeof(KrylovKit.expand!), - KrylovKit.LanczosIterator{ProjMPO,ITensor{3},KrylovKit.ModifiedGramSchmidt2}, - KrylovKit.LanczosFactorization{ITensor{3},Float64}, - }, - ) - precompile( - Tuple{ - Core.kwftype(typeof(NDTensors.eigen)), - NamedTuple{ - ( - :ishermitian, - :which_decomp, - :tags, - :maxdim, - :mindim, - :cutoff, - :eigen_perturbation, - :ortho, - ), - Tuple{Bool,Nothing,TagSet,Int64,Int64,Float64,Nothing,String}, - }, - typeof(eigen), - LinearAlgebra.Hermitian{ - Float64, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - }, - }, - ) - precompile( - Tuple{ - Core.kwftype(typeof(NDTensors.svd)), - NamedTuple{(:alg,),Tuple{String}}, - typeof(svd), - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - }, - ) - precompile( - Tuple{ - Core.kwftype(typeof(NDTensors.svd)), - NamedTuple{(:alg,),Tuple{String}}, - typeof(svd), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - }, - ) - precompile(Tuple{ProjMPO,ITensor{3}}) - precompile(Tuple{Type{MPO},AutoMPO,Array{Index{Int64},1}}) - precompile(Tuple{Type{TagSet},String}) - precompile( - Tuple{ - typeof(*), - Float64, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - }, - ) - precompile(Tuple{typeof(*),ITensor{2},ITensor{3}}) - precompile(Tuple{typeof(*),ITensor{3},ITensor{1}}) - precompile(Tuple{typeof(*),ITensor{3},ITensor{2}}) - precompile(Tuple{typeof(*),ITensor{3},ITensor{3}}) - precompile(Tuple{typeof(*),ITensor{4},ITensor{1}}) - precompile(Tuple{typeof(*),ITensor{4},ITensor{4}}) - precompile(Tuple{typeof(==),Array{Index{Int64},1},Array{Index{Int64},1}}) - precompile( - Tuple{ - typeof(==), - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - ) - precompile(Tuple{typeof(==),TagSet,TagSet}) - precompile( - Tuple{ - typeof(Base.Broadcast.materialize!), - ITensor{4}, - Base.Broadcast.Broadcasted{ - ITensors.ITensorStyle,Nothing,typeof(+),Tuple{ITensor{4},ITensor{4}} - }, - }, - ) - precompile(Tuple{typeof(Base.afoldl),typeof(*),ITensor{4},ITensor{3}}) - precompile( - Tuple{typeof(ITensors.setstore!),ITensor{2},NDTensors.Dense{Float64,Array{Float64,1}}} - ) - precompile( - Tuple{ - typeof(KrylovKit.orthogonalize!),ITensor{3},ITensor{3},KrylovKit.ModifiedGramSchmidt2 - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Number, - 2, - NDTensors.Combiner, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Diag{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Float64,0,NDTensors.Dense{Float64,Array{Float64,1}},IndexSet{0,Union{},Tuple{}} - }, - Tuple{}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Number, - 2, - NDTensors.Combiner, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Diag{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 1, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{1,Index{Int64},Tuple{Index{Int64}}}, - }, - Tuple{Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - NDTensors.Tensor{ - Float64, - 1, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{1,Index{Int64},Tuple{Index{Int64}}}, - }, - Tuple{Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contract!!), - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contraction_output), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - IndexSet{0,Union{},Tuple{}}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.contraction_output), - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NDTensors.Tensor{ - Float64, - 1, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{1,Index{Int64},Tuple{Index{Int64}}}, - }, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.getperm), - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.permutedims!!), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - Function, - }, - ) - precompile( - Tuple{ - typeof(NDTensors.permutedims!!), - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - Function, - }, - ) - precompile( - Tuple{ - typeof(Random.randn!), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - }, - ) - precompile(Tuple{typeof(axpy!),Float64,ITensor{3},ITensor{3}}) - precompile(Tuple{typeof(combiner),Index{Int64}}) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Number, - 2, - NDTensors.Combiner, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NTuple{4,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - Tuple{Int64,Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Number, - 2, - NDTensors.Combiner, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Number, - 2, - NDTensors.Combiner, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Diag{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Diag{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Diag{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Diag{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 1, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{1,Index{Int64},Tuple{Index{Int64}}}, - }, - Tuple{Int64}, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 1, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{1,Index{Int64},Tuple{Index{Int64}}}, - }, - Tuple{Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - Tuple{Int64,Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NTuple{4,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - Tuple{Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - Tuple{}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - NDTensors.Tensor{ - Float64, - 1, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{1,Index{Int64},Tuple{Index{Int64}}}, - }, - Tuple{Int64}, - Tuple{Int64,Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - NDTensors.Tensor{ - Float64, - 1, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{1,Index{Int64},Tuple{Index{Int64}}}, - }, - Tuple{Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - Tuple{Int64,Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - NDTensors.Tensor{ - Float64, - 3, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - }, - Tuple{Int64,Int64,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - NTuple{4,Int64}, - }, - ) - precompile( - Tuple{ - typeof(contract), - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - NDTensors.Tensor{ - Float64, - 4, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{4,Index{Int64},NTuple{4,Index{Int64}}}, - }, - NTuple{4,Int64}, - }, - ) - precompile( - Tuple{typeof(hassameinds),ITensor{3},Tuple{Index{Int64},Index{Int64},Index{Int64}}} - ) - precompile(Tuple{typeof(hastags),TagSet,String}) - precompile(Tuple{typeof(itensor),Array{Float64,2},Index{Int64},Index{Int64}}) - precompile( - Tuple{ - typeof(itensor),Array{Float64,3},Index{Int64},Index{Int64},Vararg{Index,N} where N - }, - ) - precompile(Tuple{typeof(mul!),ITensor{3},ITensor{3},Float64}) - precompile( - Tuple{ - typeof(mul!), - ITensor{3}, - KrylovKit.OrthonormalBasis{ITensor{3}}, - SubArray{Float64,1,Array{Float64,2},Tuple{UnitRange{Int64},Int64},true}, - }, - ) - precompile(Tuple{typeof(prime),ITensor{3},ITensors.Not{TagSet}}) - precompile( - Tuple{ - typeof(prime), - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - Int64, - ITensors.Not{IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}}, - }, - ) - precompile(Tuple{typeof(randomITensor),Index{Int64},Index{Int64},Index{Int64}}) - precompile(Tuple{typeof(randomMPS),Array{Index{Int64},1},Int64}) - precompile(Tuple{typeof(replaceind!),ITensor{2},Index{Int64},Index{Int64}}) - precompile(Tuple{typeof(replaceind!),ITensor{3},Index{Int64},Index{Int64}}) - precompile( - Tuple{ - typeof(replaceind), - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - Index{Int64}, - Index{Int64}, - }, - ) - precompile( - Tuple{ - typeof(replaceinds), - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - Tuple{Index{Int64},Index{Int64}}, - Tuple{Index{Int64},Index{Int64}}, - }, - ) - precompile( - Tuple{ - typeof(replaceinds), - IndexSet{3,Index{Int64},Tuple{Index{Int64},Index{Int64},Index{Int64}}}, - IndexSet{1,Index{Int64},Tuple{Index{Int64}}}, - IndexSet{1,Index{Int64},Tuple{Index{Int64}}}, - }, - ) - precompile( - Tuple{ - typeof(setindex!), - Dict{Array{ITensors.SiteOp,1},Array{Float64,2}}, - Array{Float64,2}, - Array{ITensors.SiteOp,1}, - }, - ) - precompile( - Tuple{ - typeof(svd), - NDTensors.Tensor{ - Complex{Float64}, - 2, - NDTensors.Dense{Complex{Float64},Array{Complex{Float64},1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - }, - ) - precompile( - Tuple{ - typeof(svd), - NDTensors.Tensor{ - Float64, - 2, - NDTensors.Dense{Float64,Array{Float64,1}}, - IndexSet{2,Index{Int64},Tuple{Index{Int64},Index{Int64}}}, - }, - }, - ) - return precompile( - Tuple{ - typeof(zip), - IndexSet{1,Index{Int64},Tuple{Index{Int64}}}, - Vararg{IndexSet{1,Index{Int64},Tuple{Index{Int64}}},N} where N, - }, - ) -end diff --git a/precompile/snoop/dmrg.jl b/precompile/snoop/dmrg.jl deleted file mode 100644 index e6cab70284..0000000000 --- a/precompile/snoop/dmrg.jl +++ /dev/null @@ -1,69 +0,0 @@ -let - # One step of dmrg (dmrg itself - # leads to an error during precompilation) - # Add `precompile(Tuple{typeof(dmrg),MPO,MPS,Sweeps})` - # to precompile.jl by hand. - N = 4 - sites = siteinds("S=1", N) - opsum = OpSum() - for j in 1:(N - 1) - opsum .+= ("Sz", j, "Sz", j + 1) - opsum .+= (0.5, "S+", j, "S-", j + 1) - opsum .+= (0.5, "S-", j, "S+", j + 1) - end - H = MPO(opsum, sites) - psi0 = randomMPS(sites, 10) - sweeps = Sweeps(1) - maxdim!(sweeps, 10) - cutoff!(sweeps, 1E-11) - PH = ProjMPO(H) - which_decomp = nothing - obs = NoObserver() - quiet = false - eigsolve_tol = 1e-14 - eigsolve_krylovdim = 3 - eigsolve_maxiter = 1 - eigsolve_verbosity = 0 - ishermitian = true - eigsolve_which_eigenvalue = :SR - psi = copy(psi0) - N = length(psi) - ITensors.position!(PH, psi0, 1) - energy = 0.0 - sw = 1 - for sw in 1:nsweep(sweeps) - # This loop causes problems for precompilation - #for (b, ha) in sweepnext(N) - b, ha = 1, 1 - ITensors.position!(PH, psi, b) - phi = psi[b] * psi[b + 1] - vals, vecs = ITensors.KrylovKit.eigsolve( - PH, - phi, - 1, - eigsolve_which_eigenvalue; - ishermitian=ishermitian, - tol=eigsolve_tol, - krylovdim=eigsolve_krylovdim, - maxiter=eigsolve_maxiter, - ) - energy, phi = vals[1], vecs[1] - ortho = ha == 1 ? "left" : "right" - drho = nothing - spec = replacebond!( - psi, - b, - phi; - maxdim=maxdim(sweeps, sw), - mindim=mindim(sweeps, sw), - cutoff=cutoff(sweeps, sw), - eigen_perturbation=drho, - ortho=ortho, - which_decomp=which_decomp, - ) - measure!( - obs; energy=energy, psi=psi, bond=b, sweep=sw, half_sweep=ha, spec=spec, quiet=quiet - ) - #end - end -end diff --git a/precompile/snoop/itensor.jl b/precompile/snoop/itensor.jl deleted file mode 100644 index 31447f6eb9..0000000000 --- a/precompile/snoop/itensor.jl +++ /dev/null @@ -1,11 +0,0 @@ -let - i = Index(2) - A = randomITensor(i, i', i'') - for T in (Float64, ComplexF64) - A = randomITensor(T, i, i') - B = randomITensor(T, i', i'') - C = A * B - U, S, V = svd(A, i) - A, B = factorize(A, i) - end -end diff --git a/precompile/snoop/runtests.jl b/precompile/snoop/runtests.jl deleted file mode 100644 index aa79348d22..0000000000 --- a/precompile/snoop/runtests.jl +++ /dev/null @@ -1,38 +0,0 @@ - -# Many test files are leading -# to precompile command that -# cause errors, so they -# are commented out - -for filename in ( - "tagset.jl", - "smallstring.jl", - "index.jl", - "indexset.jl", - "not.jl", - #"itensor_dense.jl", - #"itensor_diag.jl", - #"contract.jl", - #"combiner.jl", - #"trg.jl", - #"ctmrg.jl", - #"iterativesolvers.jl", - #"dmrg.jl", - #"tag_types.jl", - #"phys_site_types.jl", - #"decomp.jl", - #"lattices.jl", - #"mps.jl", - #"mpo.jl", - #"autompo.jl", - #"svd.jl", - #"qn.jl", - #"qnindex.jl", - #"itensor_blocksparse.jl", - #"itensor_diagblocksparse.jl", - #"readwrite.jl", - #"readme.jl", - #"examples.jl", -) - include("../../test/$filename") -end diff --git a/precompile/snoop/snoop.jl b/precompile/snoop/snoop.jl deleted file mode 100644 index c9c235e4c8..0000000000 --- a/precompile/snoop/snoop.jl +++ /dev/null @@ -1,5 +0,0 @@ -using ITensors - -include("runtests.jl") -include("itensor.jl") -include("dmrg.jl")