Skip to content

Commit

Permalink
save changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Roger-luo committed Oct 21, 2023
1 parent 86582ba commit 86788d3
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 20 deletions.
Binary file added .DS_Store
Binary file not shown.
7 changes: 7 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ GarishPrint = "b0ab02a7-8576-43f7-aa76-eaa7c3897c54"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
ProgressLogging = "33c8b6b6-d38a-422a-b730-caa89a2f386c"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
Expand All @@ -25,3 +26,9 @@ Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
TerminalLoggers = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[weakdeps]
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"

[extensions]
PlotsExt = ["Plots"]
24 changes: 13 additions & 11 deletions scripts/main.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
njobs = 800
njobs = 1
seed = 1234
walltime = "3-00:00:00"

Expand All @@ -12,31 +12,33 @@ path = "data"
tags = []

[sample]
nrepeat = 200
nsamples = 500_000
nrepeat = 2
nsamples = 200_000
nthrows = 10
observables = ["E", "E^2", "M", "M^2", "accept_rate"]

[sample.option]
nburns = 5000
order = "random"
[sample.option.gauge]
steps = 5

[fields]
start = 0.0
start = 0.2
step = 0.01
stop = 1.0
stop = 0.2

[temperatures]
start = 20.0
step = -0.05
start = 1.5
step = -0.02
stop = 0.05

[checkpoint.temperatures]
start = 5.0
step = -0.05
start = 1.5
step = -0.02
stop = 0.05

[checkpoint.fields]
start = 0.0
start = 0.2
step = 0.01
stop = 1.0
stop = 0.2
38 changes: 30 additions & 8 deletions scripts/plot2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ begin
end

# ╔═╡ c3279e72-838e-49b5-b3dd-c1dc7f301ece
df = DataFrame(CSV.File("../data/crunch/c8ec6624-cace-11ed-0795-d1e27c39ff1f.csv"))
df = DataFrame(CSV.File("../data/crunch/9f158064-cd81-11ed-3d1e-8f05d75ea3ad.csv"))

# ╔═╡ 7aa2e82b-f0fa-4cae-bba7-5f70adff77eb
hasproperty(df, "E(std)")

# ╔═╡ d21e5512-632e-4ae1-8d42-cdb1f98311bb
gdf = groupby(df, [:field])
Expand Down Expand Up @@ -61,11 +64,16 @@ plot(
title="h=$(gdf[h].field[1])"
)

# ╔═╡ 6175d2f3-2a41-4d8c-afaa-d3836e986e41
maximum(gdf[77]."Cv(std)")

# ╔═╡ 6048db65-70b9-4936-954a-87b2db57e5b1
maximum(gdf[77]."Cv(mean)")
# ╔═╡ 52746088-57f6-46d7-b8da-8d1988622f75
plot(
gdf[h]."temp", gdf[h]."χ(mean)",
yerror=map(gdf[h]."χ(std)") do x
isnan(x) ? 0.0 : x
end,
legend=nothing,
xlabel="temperature", ylabel="χ(mean)",
title="h=$(gdf[h].field[1])"
)

# ╔═╡ d7157f73-a8b5-43bf-b888-ed4fc20d50ed
maximum(gdf[57]."Cv(tau)")
Expand Down Expand Up @@ -109,16 +117,28 @@ end
# ╔═╡ 18237a59-3057-4a72-9dbe-c22fcc26b568
heatmap(hs, Ts, M; xlabel="h", ylabel="T")

# ╔═╡ 36db7a3d-1bb8-4e13-b278-78d428d32f43
χ = let
ret = zeros(length(gdf[1].temp), length(gdf))
for (h_idx, df) in enumerate(gdf), (T_idx, T) in enumerate(df.temp)
ret[end - T_idx + 1, h_idx] = df."χ(mean)"[T_idx] / maximum(df."χ(mean)")
end
ret
end

# ╔═╡ 50db1938-1fdc-4fff-80f1-bab842a2338c
heatmap(hs, Ts, χ; xlabel="h", ylabel="T")

# ╔═╡ Cell order:
# ╠═de9f08e2-ce67-11ed-3a88-838fff267690
# ╠═c3279e72-838e-49b5-b3dd-c1dc7f301ece
# ╠═7aa2e82b-f0fa-4cae-bba7-5f70adff77eb
# ╠═d21e5512-632e-4ae1-8d42-cdb1f98311bb
# ╠═8a37f5bd-75b3-435e-9a17-615977321b33
# ╠═85f64587-79aa-423a-809e-5dcd22d25837
# ╠═60019633-dc6f-4078-9601-c141df4b46c1
# ╠═bb6c87a4-8d3c-462a-bef3-8f15c84281a0
# ╠═6175d2f3-2a41-4d8c-afaa-d3836e986e41
# ╠═6048db65-70b9-4936-954a-87b2db57e5b1
# ╠═52746088-57f6-46d7-b8da-8d1988622f75
# ╠═d7157f73-a8b5-43bf-b888-ed4fc20d50ed
# ╠═9e3a937b-fb32-45da-8a74-c4dc0e76f4bd
# ╠═79921671-272f-4a50-a5e7-0b05d236689f
Expand All @@ -129,3 +149,5 @@ heatmap(hs, Ts, M; xlabel="h", ylabel="T")
# ╠═e8395949-5f7b-40f9-bb70-2c2719489b79
# ╠═fb067387-529d-4849-8d4f-da4943f0c939
# ╠═18237a59-3057-4a72-9dbe-c22fcc26b568
# ╠═36db7a3d-1bb8-4e13-b278-78d428d32f43
# ╠═50db1938-1fdc-4fff-80f1-bab842a2338c
32 changes: 32 additions & 0 deletions scripts/resample.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
parent = "de20d208-d0c5-11ed-0e75-eb6afa48009a"
njobs = 1
walltime = "1-00:00:00"

[shape]
ndims = 4
size = 4
p = 3

[storage]
path = "data"
tags = []

[sample]
nrepeat = 10
nthrows = 10
nsamples = 100000
observables = ["E", "E^2", "M", "M^2", "accept_rate"]

[sample.option]
nburns = 5000
order = "random"

[fields]
stop = 0.8
step = 0.01
start = 0.8

[temperatures]
stop = 0.05
step = -0.1
start = 2.0
2 changes: 1 addition & 1 deletion src/mc/obs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ end

collect!(::Observable{T}, ::MarkovChain) where T = error("Observable $(T) not implemented")

function finalize!(ob::Observable, ::MarkovChain, nsamples::Int)
function finalize!(ob::Observable, mc::MarkovChain, nsamples::Int)
ob.value /= nsamples
ob.final = true
return ob
Expand Down
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
7 changes: 7 additions & 0 deletions test/mc/status.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ end # testset
@test new_E - old_E == delta_E
end
end # testset

cm = CellMap(4, 2, (2, 3))
energy(cm, trues(nspins(cm)), 0.1)
energy(cm, trues(nspins(cm)), 0.2)
energy(cm, trues(nspins(cm)), 0.3)
energy(cm, trues(nspins(cm)), 0.4)
energy(cm, trues(nspins(cm)), 0.5)

0 comments on commit 86788d3

Please sign in to comment.