Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ authors = ["Ritter.Marc <[email protected]>, Hiroshi Shinaoka <
version = "0.7.0"

[deps]
BitIntegers = "c3b6d118-76ef-56ca-8cc7-ebb389d030a1"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
QuanticsGrids = "634c7f73-3e90-4749-a1bd-001b8efc642d"
TensorCrossInterpolation = "b261b2ec-6378-4871-b32e-9173bb050604"

[compat]
BitIntegers = "0.3.5"
QuanticsGrids = "0.3"
TensorCrossInterpolation = "0.9"
TensorCrossInterpolation = "0.9.16"
julia = "1.6"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
Expand Down
5 changes: 5 additions & 0 deletions src/QuanticsTCI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import Base: sum
export quanticscrossinterpolate, evaluate, sum, integral
export cachedata, quanticsfouriermpo

import BitIntegers
import BitIntegers: UInt256, UInt512, UInt1024

BitIntegers.@define_integers 2048 MyInt2048 MyUInt2048

include("tciinterface.jl")
include("fouriertransform.jl")

Expand Down
17 changes: 16 additions & 1 deletion src/tciinterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,22 @@ function quanticscrossinterpolate(
? q -> f(only(QG.quantics_to_origcoord(grid, q)))
: q -> f(QG.quantics_to_origcoord(grid, q)...))

qf = TCI.CachedFunction{ValueType}(qf_, qlocaldimensions)
maxlinearindex = prod(BigInt.(qlocaldimensions))
if maxlinearindex < typemax(UInt256)
keytype = UInt256
elseif maxlinearindex < typemax(UInt512)
keytype = UInt512
elseif maxlinearindex < typemax(UInt1024)
keytype = UInt1024
elseif maxlinearindex < typemax(MyUInt2048)
keytype = MyUInt2048
else
keytype = BigInt
end
if keytype === BigInt
@warn "Using BigInt as key type. This will lead to significant memory usage and performance degradation."
end
qf = TCI.CachedFunction{ValueType, keytype}(qf_, qlocaldimensions)

qinitialpivots = (initialpivots === nothing
? [ones(Int, length(qlocaldimensions))]
Expand Down
Loading