Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
FerFlow.jl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Fernando Pérez Panadero
FerFlow.jl
Commits
d070ec7c
Commit
d070ec7c
authored
Mar 25, 2025
by
Fernando Pérez Panadero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ADfer and SFCF. v1.1
parent
dc2fcd73
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
631 additions
and
317 deletions
+631
-317
input/FerFlow.in
input/FerFlow.in
+6
-0
main.jl
main.jl
+3
-0
src/io.jl
src/io.jl
+61
-56
src/meas.jl
src/meas.jl
+63
-43
src/sfcf.jl
src/sfcf.jl
+215
-0
src/utils.jl
src/utils.jl
+283
-218
No files found.
input/FerFlow.in
View file @
d070ec7c
...
@@ -17,6 +17,12 @@ eps = 0.01
...
@@ -17,6 +17,12 @@ eps = 0.01
ns = 30
ns = 30
mclength = -1 # Number of measurements. Negative to ignore
mclength = -1 # Number of measurements. Negative to ignore
[AD]
nder = 2
[sfcf]
meas = true
[Fermion1]
[Fermion1]
kappa = 0.1348
kappa = 0.1348
theta = 0.0
theta = 0.0
...
...
main.jl
View file @
d070ec7c
...
@@ -15,6 +15,7 @@ reset_timer!()
...
@@ -15,6 +15,7 @@ reset_timer!()
include
(
"./src/io.jl"
)
include
(
"./src/io.jl"
)
include
(
"./src/meas.jl"
)
include
(
"./src/meas.jl"
)
include
(
"./src/sfcf.jl"
)
include
(
"./src/mc.jl"
)
include
(
"./src/mc.jl"
)
@timeit
"Input reading and space allocation"
begin
@timeit
"Input reading and space allocation"
begin
...
@@ -37,6 +38,8 @@ while RUN_ON
...
@@ -37,6 +38,8 @@ while RUN_ON
@timeit
"One point function"
Backflow_pt
()
@timeit
"One point function"
Backflow_pt
()
meas_sfcf
()
@timeit
"Saving"
save_data
()
@timeit
"Saving"
save_data
()
check_run_status
()
check_run_status
()
...
...
src/io.jl
View file @
d070ec7c
...
@@ -20,6 +20,12 @@ function read_input()
...
@@ -20,6 +20,12 @@ function read_input()
error
(
"Output file already exists with this run name. Use flag -R to continue the run."
)
error
(
"Output file already exists with this run name. Use flag -R to continue the run."
)
end
end
if
((
params
[
"Space"
][
"bc"
]
!=
1
)
&&
(
params
[
"Space"
][
"bc"
]
!=
2
)
&&
(
params
[
"sfcf"
][
"meas"
]))
error
(
"Sfcf only available with SF bc"
)
end
return
nothing
return
nothing
end
end
...
@@ -66,18 +72,19 @@ function load_structs()
...
@@ -66,18 +72,19 @@ function load_structs()
CUDA
.
device!
(
parsed_args
[
"G"
])
CUDA
.
device!
(
parsed_args
[
"G"
])
global
lp
=
SpaceParm
{
4
}(
tuple
(
params
[
"Space"
][
"size"
]
...
),
tuple
(
params
[
"Space"
][
"blocks"
]
...
),
params
[
"Space"
][
"bc"
],
(
0
,
0
,
0
,
0
,
0
,
0
))
global
lp
=
SpaceParm
{
4
}(
tuple
(
params
[
"Space"
][
"size"
]
...
),
tuple
(
params
[
"Space"
][
"blocks"
]
...
),
params
[
"Space"
][
"bc"
],
(
0
,
0
,
0
,
0
,
0
,
0
))
global
gp
=
GaugeParm
{
Float64
}(
SU3
{
Float64
},
params
[
"HMC"
][
"beta"
],
params
[
"HMC"
][
"c0"
],(
params
[
"HMC"
][
"cG"
],
0.0
),(
0.0
,
0.0
),
lp
.
iL
);
global
gp
=
GaugeParm
{
Float64
}(
SU3
{
Float64
},
params
[
"HMC"
][
"beta"
],
params
[
"HMC"
][
"c0"
],(
params
[
"HMC"
][
"cG"
],
0.0
),(
0.0
,
0.0
),
lp
.
iL
);
global
dws
=
DiracWorkspace
(
SU3fund
,
2
,
Float64
,
lp
);
global
dws
=
DiracWorkspace
(
SU3fund
,
params
[
"AD"
][
"nder"
]
+
1
,
Float64
,
lp
);
global
ymws
=
YMworkspace
(
SU3
,
Float64
,
lp
);
global
ymws
=
YMworkspace
(
SU3
,
Float64
,
lp
);
global
int
=
wfl_rk3
(
Float64
,
params
[
"Frontflow"
][
"epsilon"
],
params
[
"Backflow"
][
"tol"
])
global
int
=
wfl_rk3
(
Float64
,
params
[
"Frontflow"
][
"epsilon"
],
params
[
"Backflow"
][
"tol"
])
global
intsch
=
omf4
(
Float64
,
params
[
"HMC"
][
"eps"
],
params
[
"HMC"
][
"ns"
]);
global
intsch
=
omf4
(
Float64
,
params
[
"HMC"
][
"eps"
],
params
[
"HMC"
][
"ns"
]);
global
fernames
=
[
replace
(
k
,
"Fermion"
=>
""
)
for
k
in
keys
(
params
)
if
startswith
(
k
,
"Fermion"
)]
global
fernames
=
[
replace
(
k
,
"Fermion"
=>
""
)
for
k
in
keys
(
params
)
if
startswith
(
k
,
"Fermion"
)]
# SU3 assumed in the constructor
# SU3 assumed in the constructor
global
dpar
=
[
DiracParam
{
Float64
}(
global
Nder
=
params
[
"AD"
][
"nder"
]
+
1
Series
{
Float64
,
2
}((
(
1
/
(
2
*
params
[
"Fermion"
*
f
][
"kappa"
]))
-
4
,
1.0
)),
global
dpar
=
[
DiracParam
{
Float64
,
Nder
}(
Series
{
Float64
,
2
}((
params
[
"Fermion"
*
f
][
"csw"
],
0.0
)),
(
1
/
(
2
*
params
[
"Fermion"
*
f
][
"kappa"
]))
-
4
,
params
[
"Fermion"
*
f
][
"csw"
],
ntuple
(
i
->
exp
(((
i!
=
4
)
*
im
*
params
[
"Fermion"
*
f
][
"theta"
]
/
lp
.
iL
[
i
])
+
((
i
==
4
)
*
im
*
params
[
"Fermion"
*
f
][
"theta_t"
]
/
lp
.
iL
[
i
])),
4
),
ntuple
(
i
->
exp
(((
i!
=
4
)
*
im
*
params
[
"Fermion"
*
f
][
"theta"
]
/
lp
.
iL
[
i
])
+
((
i
==
4
)
*
im
*
params
[
"Fermion"
*
f
][
"theta_t"
]
/
lp
.
iL
[
i
])),
4
),
Series
{
Float64
,
2
}((
0.0
,
0.0
))
,
0.0
,
Series
{
Float64
,
2
}((
params
[
"Fermion"
*
f
][
"ct"
],
0.0
)
)
)
for
f
in
fernames
];
params
[
"Fermion"
*
f
][
"ct"
],
mder
=
(
Nder
>
1
)
)
for
f
in
fernames
];
global
flow_times
=
params
[
"Backflow"
][
"Flow_times"
]
global
flow_times
=
params
[
"Backflow"
][
"Flow_times"
]
global
MCid
=
0
global
MCid
=
0
...
@@ -94,7 +101,7 @@ end
...
@@ -94,7 +101,7 @@ end
function
write_log
()
function
write_log
()
println
(
log_file
,
"Running Ferflow.jl adfer v1.
0
by "
,
params
[
"Run"
][
"user"
],
". Name of the run: "
,
params
[
"Run"
][
"name"
])
println
(
log_file
,
"Running Ferflow.jl adfer v1.
1
by "
,
params
[
"Run"
][
"user"
],
". Name of the run: "
,
params
[
"Run"
][
"name"
])
println
(
log_file
,
""
)
println
(
log_file
,
""
)
print
(
log_file
,
"Calling: "
)
print
(
log_file
,
"Calling: "
)
...
@@ -110,6 +117,7 @@ function write_log()
...
@@ -110,6 +117,7 @@ function write_log()
println
(
log_file
,
"Parameters:"
)
println
(
log_file
,
"Parameters:"
)
println
(
log_file
,
"Lattice size: "
,
lp
.
iL
)
println
(
log_file
,
"Lattice size: "
,
lp
.
iL
)
println
(
log_file
,
"Boundary conditions: "
,
params
[
"Space"
][
"bc"
])
println
(
log_file
,
"Boundary conditions: "
,
params
[
"Space"
][
"bc"
])
println
(
log_file
,
"Number of derivatives: "
,
params
[
"AD"
][
"nder"
])
for
f
in
fernames
for
f
in
fernames
println
(
log_file
,
"Fermion"
*
f
*
" parameters:"
)
println
(
log_file
,
"Fermion"
*
f
*
" parameters:"
)
println
(
log_file
,
"kappa = "
,
params
[
"Fermion"
*
f
][
"kappa"
])
println
(
log_file
,
"kappa = "
,
params
[
"Fermion"
*
f
][
"kappa"
])
...
@@ -137,14 +145,14 @@ end
...
@@ -137,14 +145,14 @@ end
function
save_data
()
function
save_data
()
ihdr
=
[
convert
(
Int32
,
174
0655571
)]
ihdr
=
[
convert
(
Int32
,
174
2298500
)]
fname
=
"./output/"
*
params
[
"Run"
][
"name"
]
*
".bdio"
fname
=
"./output/"
*
params
[
"Run"
][
"name"
]
*
".bdio"
if
isfile
(
fname
)
if
isfile
(
fname
)
fb
=
BDIO_open
(
fname
,
"a"
)
fb
=
BDIO_open
(
fname
,
"a"
)
println
(
log_file
,
"
\n
Appending output to "
*
fname
*
"
\n
"
)
println
(
log_file
,
"
\n
Appending output to "
*
fname
*
"
\n
"
)
else
else
fb
=
BDIO_open
(
fname
,
"w"
,
"BDIO output from ferflow.jl adfer v1.
0
"
)
fb
=
BDIO_open
(
fname
,
"w"
,
"BDIO output from ferflow.jl adfer v1.
1
"
)
println
(
log_file
,
"Creating new BDIO output file "
*
fname
)
println
(
log_file
,
"Creating new BDIO output file "
*
fname
)
BDIO_start_record!
(
fb
,
BDIO_BIN_GENERIC
,
14
)
BDIO_start_record!
(
fb
,
BDIO_BIN_GENERIC
,
14
)
...
@@ -169,37 +177,33 @@ function save_data()
...
@@ -169,37 +177,33 @@ function save_data()
BDIO_write!
(
fb
,
[
convert
(
Int32
,
params
[
"Backflow"
][
"tsource"
])])
BDIO_write!
(
fb
,
[
convert
(
Int32
,
params
[
"Backflow"
][
"tsource"
])])
length
(
flow_times
)
>
0
?
BDIO_write!
(
fb
,
flow_times
)
:
nothing
length
(
flow_times
)
>
0
?
BDIO_write!
(
fb
,
flow_times
)
:
nothing
BDIO_write!
(
fb
,
[
convert
(
Int32
,
params
[
"AD"
][
"nder"
])])
if
params
[
"sfcf"
][
"meas"
]
BDIO_write!
(
fb
,
[
convert
(
Int32
,
1
)])
else
BDIO_write!
(
fb
,
[
convert
(
Int32
,
0
)])
end
BDIO_write_hash!
(
fb
)
BDIO_write_hash!
(
fb
)
end
end
BDIO_start_record!
(
fb
,
BDIO_BIN_GENERIC
,
8
,
true
)
BDIO_start_record!
(
fb
,
BDIO_BIN_GENERIC
,
8
,
true
)
for
f
in
1
:
length
(
dpar
)
for
der
in
1
:
Nder
for
noi
in
1
:
params
[
"Frontflow"
][
"N_noise"
]
for
f
in
1
:
length
(
dpar
)
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pp_corr_t0
[
:
,
noi
,
f
],
:
c
),
1
))
for
noi
in
1
:
params
[
"Frontflow"
][
"N_noise"
]
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ap_corr_t0
[
:
,
noi
,
f
],
:
c
),
1
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pp_corr_t0
[
:
,
noi
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pphat_t0
[
:
,
noi
,
f
],
:
c
),
1
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ap_corr_t0
[
:
,
noi
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pptilde_t0
[
:
,
noi
,
f
],
:
c
),
1
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pphat_t0
[
:
,
noi
,
f
],
:
c
),
der
))
for
fl
in
1
:
params
[
"Frontflow"
][
"nsteps"
]
+
1
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pptilde_t0
[
:
,
noi
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pp_corr_t
[
:
,
noi
,
fl
,
f
],
:
c
),
1
))
for
fl
in
1
:
params
[
"Frontflow"
][
"nsteps"
]
+
1
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ap_corr_t
[
:
,
noi
,
fl
,
f
],
:
c
),
1
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pp_corr_t
[
:
,
noi
,
fl
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pphat_t
[
:
,
noi
,
fl
,
f
],
:
c
),
1
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ap_corr_t
[
:
,
noi
,
fl
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pptilde_t
[
:
,
noi
,
fl
,
f
],
:
c
),
1
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pphat_t
[
:
,
noi
,
fl
,
f
],
:
c
),
der
))
end
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pptilde_t
[
:
,
noi
,
fl
,
f
],
:
c
),
der
))
end
end
end
for
f
in
1
:
length
(
dpar
)
for
noi
in
1
:
params
[
"Frontflow"
][
"N_noise"
]
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pp_corr_t0
[
:
,
noi
,
f
],
:
c
),
2
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ap_corr_t0
[
:
,
noi
,
f
],
:
c
),
2
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pphat_t0
[
:
,
noi
,
f
],
:
c
),
2
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pptilde_t0
[
:
,
noi
,
f
],
:
c
),
2
))
for
fl
in
1
:
params
[
"Frontflow"
][
"nsteps"
]
+
1
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pp_corr_t
[
:
,
noi
,
fl
,
f
],
:
c
),
2
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ap_corr_t
[
:
,
noi
,
fl
,
f
],
:
c
),
2
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pphat_t
[
:
,
noi
,
fl
,
f
],
:
c
),
2
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pptilde_t
[
:
,
noi
,
fl
,
f
],
:
c
),
2
))
end
end
end
end
end
end
...
@@ -211,31 +215,32 @@ function save_data()
...
@@ -211,31 +215,32 @@ function save_data()
BDIO_write!
(
fb
,
Qt
[
fl
,
:
])
BDIO_write!
(
fb
,
Qt
[
fl
,
:
])
end
end
for
f
in
1
:
length
(
dpar
)
for
der
in
1
:
Nder
for
noi
in
1
:
params
[
"Backflow"
][
"N_noise"
]
for
f
in
1
:
length
(
dpar
)
for
fl
in
1
:
length
(
flow_times
)
for
noi
in
1
:
params
[
"Backflow"
][
"N_noise"
]
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pp_corr_tfl
[
:
,
noi
,
fl
,
f
],
:
c
),
1
))
for
fl
in
1
:
length
(
flow_times
)
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ap_corr_tfl
[
:
,
noi
,
fl
,
f
],
:
c
),
1
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pp_corr_tfl
[
:
,
noi
,
fl
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
Quark_cond
[
:
,
noi
,
fl
,
f
],
:
c
),
1
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ap_corr_tfl
[
:
,
noi
,
fl
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
Quark_cond_cfl
[
:
,
noi
,
fl
,
f
],
:
c
),
1
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
Quark_cond
[
:
,
noi
,
fl
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
Quark_cond2
[
:
,
noi
,
fl
,
f
],
:
c
),
1
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
Quark_cond_cfl
[
:
,
noi
,
fl
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
Quark_cond2_cfl
[
:
,
noi
,
fl
,
f
],
:
c
),
1
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
Quark_cond2
[
:
,
noi
,
fl
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ChiDchi
[
:
,
noi
,
fl
,
f
],
:
c
),
1
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
Quark_cond2_cfl
[
:
,
noi
,
fl
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ChiDchi_cfl
[
:
,
noi
,
fl
,
f
],
:
c
),
1
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ChiDchi
[
:
,
noi
,
fl
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ChiDchi_cfl
[
:
,
noi
,
fl
,
f
],
:
c
),
der
))
end
end
end
end
end
end
end
for
f
in
1
:
length
(
dpar
)
for
noi
in
1
:
params
[
"Backflow"
][
"N_noise"
]
if
params
[
"sfcf"
][
"meas"
]
for
fl
in
1
:
length
(
flow_times
)
for
der
in
1
:
Nder
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
pp_corr_tfl
[
:
,
noi
,
fl
,
f
],
:
c
),
2
))
for
f
in
1
:
length
(
dpar
)
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ap_corr_tfl
[
:
,
noi
,
fl
,
f
],
:
c
),
2
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
fp_sf
[
:
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
Quark_cond
[
:
,
noi
,
fl
,
f
],
:
c
),
2
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
fa_sf
[
:
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
Quark_cond_cfl
[
:
,
noi
,
fl
,
f
],
:
c
),
2
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
kv_sf
[
:
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
Quark_cond2
[
:
,
noi
,
fl
,
f
],
:
c
),
2
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
kt_sf
[
:
,
f
],
:
c
),
der
))
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
Quark_cond2_cfl
[
:
,
noi
,
fl
,
f
],
:
c
),
2
))
BDIO_write!
(
fb
,
[
getindex
(
getfield
(
f1_sf
[
f
],
:
c
),
der
),])
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ChiDchi
[
:
,
noi
,
fl
,
f
],
:
c
),
2
))
BDIO_write!
(
fb
,
[
getindex
(
getfield
(
k1_sf
[
f
],
:
c
),
der
),])
BDIO_write!
(
fb
,
getindex
.
(
getfield
.
(
ChiDchi_cfl
[
:
,
noi
,
fl
,
f
],
:
c
),
2
))
end
end
end
end
end
end
...
...
src/meas.jl
View file @
d070ec7c
This diff is collapsed.
Click to expand it.
src/sfcf.jl
0 → 100644
View file @
d070ec7c
This diff is collapsed.
Click to expand it.
src/utils.jl
View file @
d070ec7c
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment