Skip to content

Commit 00bfd04

Browse files
committed
Update benchmarks to include non-abelian symmetries
1 parent 0b22104 commit 00bfd04

File tree

4 files changed

+26
-9
lines changed

4 files changed

+26
-9
lines changed

benchmark/TensorKitBenchmarks/TensorKitBenchmarks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using BenchmarkTools
44
using TensorKit
55
using TOML
66

7-
BenchmarkTools.DEFAULT_PARAMETERS.seconds = 1.0
7+
BenchmarkTools.DEFAULT_PARAMETERS.seconds = 20.0
88
BenchmarkTools.DEFAULT_PARAMETERS.samples = 10000
99
BenchmarkTools.DEFAULT_PARAMETERS.time_tolerance = 0.15
1010
BenchmarkTools.DEFAULT_PARAMETERS.memory_tolerance = 0.01

benchmark/TensorKitBenchmarks/tensornetworks/TensorNetworkBenchmarks.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ function benchmark_mpo!(bench; sigmas=nothing, T="Float64", I="Trivial", dims)
4545
end
4646

4747
if haskey(all_parameters, "mpo")
48-
g = addgroup!(SUITE, "mpo")
4948
for params in all_parameters["mpo"]
50-
benchmark_mpo!(g, params)
49+
benchmark_mpo!(SUITE, params)
5150
end
5251
end
5352

@@ -90,9 +89,8 @@ function benchmark_pepo!(bench; sigmas=nothing, T="Float64", I="Trivial", dims)
9089
end
9190

9291
if haskey(all_parameters, "pepo")
93-
g = addgroup!(SUITE, "pepo")
9492
for params in all_parameters["pepo"]
95-
benchmark_pepo!(g, params)
93+
benchmark_pepo!(SUITE, params)
9694
end
9795
end
9896

@@ -136,9 +134,8 @@ function benchmark_mera!(bench; sigmas=nothing, T="Float64", I="Trivial", dims)
136134
end
137135

138136
if haskey(all_parameters, "mera")
139-
g = addgroup!(SUITE, "mera")
140137
for params in all_parameters["mera"]
141-
benchmark_mera!(g, params)
138+
benchmark_mera!(SUITE, params)
142139
end
143140
end
144141

benchmark/TensorKitBenchmarks/tensornetworks/benchparams.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ I = "U1Irrep"
1919
dims = [[40, 5, 3], [160, 5, 3], [640, 5, 3], [2560, 5, 3], [6120, 5, 3], [200, 20, 20], [400, 20, 20], [400, 40, 40]]
2020
sigmas = [0.5, 0.5, 0.5]
2121

22+
[[mpo]]
23+
T = ["Float64"]
24+
I = "SU2Irrep"
25+
dims = [[40, 5, 3], [160, 5, 3], [640, 5, 3], [2560, 5, 3], [6120, 5, 3], [200, 20, 20], [400, 20, 20], [400, 40, 40]]
26+
sigmas = [2, 2, 2]
27+
2228
# PEPO
2329
# ----
2430
# dims = [peps, pepo, phys, env]
@@ -40,6 +46,12 @@ I = "U1Irrep"
4046
dims = [[4, 2, 2, 100], [4, 4, 4, 200], [6, 2, 2, 100], [6, 3, 4, 200], [8, 2, 2, 100], [8, 2, 4, 200], [10, 2, 2, 50], [10, 3, 2, 100]]
4147
sigmas = [0.5, 0.5, 0.5, 0.5]
4248

49+
[[pepo]]
50+
T = ["Float64"]
51+
I = "SU2Irrep"
52+
dims = [[4, 2, 2, 100], [4, 4, 4, 200], [6, 2, 2, 100], [6, 3, 4, 200], [8, 2, 2, 100], [8, 2, 4, 200], [10, 2, 2, 50], [10, 3, 2, 100]]
53+
sigmas = [2.0, 2.0, 2.0, 2.0]
54+
4355
# MERA
4456
# ----
4557
# dims = mera
@@ -60,3 +72,9 @@ T = ["Float64"]
6072
I = "U1Irrep"
6173
dims = [4, 8, 12, 16, 22, 28]
6274
sigmas = [0.5]
75+
76+
[[mera]]
77+
T = ["Float64"]
78+
I = "SU2Irrep"
79+
dims = [4, 8, 12, 16, 22, 28]
80+
sigmas = [2.0]

benchmark/TensorKitBenchmarks/utils/BenchUtils.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@ function generate_space(::Type{U1Irrep}, D::Int, sigma::Real=0.5)
5555
return U1Space((s => d for (s, d) in zip(sectors, dims))...)
5656
end
5757
function generate_space(::Type{SU2Irrep}, D::Int, sigma::Real=0.5)
58-
poisson_pdf(x) = ceil(Int, D * exp(-sigma) * sigma^x / factorial(x + 1))
58+
normal_pdf = let D = D
59+
x -> D * exp(-0.5 * (x / sigma)^2) / (sigma * sqrt(2π))
60+
end
5961

6062
sectors = SU2Irrep[]
6163
dims = Int[]
6264

6365
for sector in values(SU2Irrep)
64-
d = poisson_pdf(Int(sector.j * 2))
66+
d = ceil(Int, normal_pdf(sector.j) / dim(sector))
6567
push!(sectors, sector)
6668
push!(dims, d)
6769
D -= d * dim(sector)

0 commit comments

Comments
 (0)