Merge pull request #62 from s-kuberski/feature/rwf

Feature/rwf
This commit is contained in:
Fabian Joswig 2022-02-09 17:46:14 +00:00 committed by GitHub
commit 374e9d89cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 3 deletions

View file

@ -704,7 +704,7 @@ def read_qtop(path, prefix, c, dtr_cnfg=1, version="openQCD", **kwargs):
else:
steps = traj_list[1] - traj_list[0]
configlist.append([tr // steps / dtr_cnfg for tr in traj_list])
configlist.append([tr // steps // dtr_cnfg for tr in traj_list])
if configlist[-1][0] > 1:
offset = configlist[-1][0] - 1
warnings.warn('Assume thermalization and that the first measurement belongs to the first config. Offset = %d configs (%d trajectories / cycles)' % (
@ -838,8 +838,6 @@ def read_qtop_sector(path, prefix, c, target=0, **kwargs):
Zeuthen_flow : bool
(optional) If True, the Zeuthen flow is used for Qtop. Only possible
for version=='sfqcd' If False, the Wilson flow is used.
integer_charge : bool
If True, the charge is rounded towards the nearest integer on each config.
"""
if not isinstance(target, int):

Binary file not shown.

Binary file not shown.

View file

@ -47,3 +47,49 @@ def test_openqcd():
assert(rwfo[0].idl[repname] == range(1, 10))
rwfo = pe.input.openQCD.read_rwms(path, prefix, version='2.0', files=files, names=names, r_start=[1], r_stop=[8])
assert(rwfo[0].idl[repname] == range(1, 9))
# Qtop
qtop = pe.input.openQCD.read_qtop(path, prefix, c=0.3, version='sfqcd')
repname = list(qtop.idl.keys())[0]
qtop = pe.input.openQCD.read_qtop(path, prefix, c=0.3, version='sfqcd', Zeuthen_flow=True, L=4)
qi = pe.input.openQCD.read_qtop(path, prefix, c=0.3, version='sfqcd', integer_charge=True)
for conf in range(len(qi.idl[repname])):
assert(0 == qi.r_values[repname] + qi.deltas[repname][conf])
qtop = pe.input.openQCD.read_qtop(path, prefix, c=0.0, version='sfqcd')
assert (np.isclose(-4.572999e-02, qtop.r_values[repname] + qtop.deltas[repname][0]))
qtop = pe.input.openQCD.read_qtop(path, prefix, c=0.28, version='sfqcd')
assert (np.isclose(3.786893e-02, qtop.r_values[repname] + qtop.deltas[repname][0]))
qtop = pe.input.openQCD.read_qtop(path, prefix, c=0.08, version='sfqcd', Zeuthen_flow=True)
assert (np.isclose(3.653140e-02, qtop.r_values[repname] + qtop.deltas[repname][1]))
qtop = pe.input.openQCD.read_qtop(path, prefix, c=0.40, version='sfqcd', Zeuthen_flow=True)
assert (np.isclose(2.745865e-01, qtop.r_values[repname] + qtop.deltas[repname][1]))
qtop = pe.input.openQCD.read_qtop(path, prefix, c=0.40, version='sfqcd', Zeuthen_flow=True, r_start=[2])
assert(qtop.idl[repname] == range(2, 7))
assert (np.isclose(2.745865e-01, qtop.r_values[repname] + qtop.deltas[repname][0]))
qtop = pe.input.openQCD.read_qtop(path, prefix, c=0.40, version='sfqcd', Zeuthen_flow=True, r_stop=[5])
assert(qtop.idl[repname] == range(1, 6))
names = ['sfqcd|r1']
files = ['sfqcdr1.gfms.dat']
qs = pe.input.openQCD.read_qtop_sector(path, '', 0.3, target=0, Zeuthen_flow=True, version='sfqcd')
assert((pe.input.openQCD.qtop_projection(qi, target=0) - qs).is_zero())
# t0
prefix = 'openqcd'
t0 = pe.input.openQCD.extract_t0(path, prefix, dtr_read=3, xmin=0, spatial_extent=4)
files = ['openqcd2r1.ms.dat']
names = ['openqcd2|r1']
t0 = pe.input.openQCD.extract_t0(path, '', dtr_read=3, xmin=0, spatial_extent=4, files=files, names=names, fit_range=2)
t0 = pe.input.openQCD.extract_t0(path, prefix, dtr_read=3, xmin=0, spatial_extent=4, r_start=[1])
repname = list(rwfo[0].idl.keys())[0]
assert(t0.idl[repname] == range(1, 10))
t0 = pe.input.openQCD.extract_t0(path, prefix, dtr_read=3, xmin=0, spatial_extent=4, r_start=[2], r_stop=[8])
repname = list(rwfo[0].idl.keys())[0]
assert(t0.idl[repname] == range(2, 9))
t0 = pe.input.openQCD.extract_t0(path, prefix, dtr_read=3, xmin=0, spatial_extent=4, fit_range=2, plaquette=True, assume_thermalization=True)