Skip to content

Commit

Permalink
JLD2 format is added
Browse files Browse the repository at this point in the history
  • Loading branch information
cometscome committed Oct 8, 2024
1 parent 0f52827 commit bc07874
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Gaugefields"
uuid = "a461e10c-0d91-493e-bc41-027b226eee91"
authors = ["Akio Tomiya, Yuki Nagai <[email protected]> and contributors"]
version = "0.2.8"
version = "0.2.9"

[deps]
CLIME_jll = "3c6ae550-c37b-5556-a07e-d40b4910cf1c"
Expand Down
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,57 @@ filename = "testconf.txt"
save_textdata(U,filename)
```

## JLD2 format
Gaugefields.jl also supports [JLD2 format](https://github.com/JuliaIO/JLD2.jl).

### File save and loading

```julia
function main()
using Gaugefields

function savingexample()
NX = 4
NY = 4
NZ = 4
NT = 4
NC = 3
Nwing = 0
Dim = 4

U = Initialize_Gaugefields(NC, Nwing, NX, NY, NZ, NT, condition="hot")
temp1 = similar(U[1])
temp2 = similar(U[1])

comb = 6
factor = 1 / (comb * U[1].NV * U[1].NC)
@time plaq_t = calculate_Plaquette(U, temp1, temp2) * factor
println("plaq_t = $plaq_t")


filename = "test.jld2"
saveU(filename, U)
end

function loadingexample()
filename = "test.jld2"
U = loadU(filename)

temp1 = similar(U[1])
temp2 = similar(U[1])

comb = 6
factor = 1 / (comb * U[1].NV * U[1].NC)
@time plaq_t = calculate_Plaquette(U, temp1, temp2) * factor
println("plaq_t = $plaq_t")
end

savingexample()
loadingexample()
```



## Z(Nc) 2-form gauge fields

SU(N) gauge fields possess Z(N) center symmetry,
Expand Down
1 change: 1 addition & 0 deletions src/Gaugefields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ export overrelaxation!
export AbstractGaugefields, Traceless_antihermitian
export write_to_numpyarray, map_U_sequential!
export load_binarydata!
export loadU, saveU



Expand Down
2 changes: 1 addition & 1 deletion src/output/io.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module IOmodule
using JLD2
import ..AbstractGaugefields_module: AbstractGaugefields
import ..AbstractGaugefields_module: AbstractGaugefields, IdentityGauges
#using ..Gaugefields
#import ..Gaugefields:GaugeFields,SU2GaugeFields,SU3GaugeFields,SUNGaugeFields
#import Main.LatticeQCD.Gaugefields:GaugeFields
Expand Down

0 comments on commit bc07874

Please sign in to comment.