mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-16 23:30:24 +01:00
Merge branch 'develop' into documentation
This commit is contained in:
commit
d47330f574
4 changed files with 47 additions and 3 deletions
|
@ -704,7 +704,7 @@ def read_qtop(path, prefix, c, dtr_cnfg=1, version="openQCD", **kwargs):
|
||||||
else:
|
else:
|
||||||
steps = traj_list[1] - traj_list[0]
|
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:
|
if configlist[-1][0] > 1:
|
||||||
offset = 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)' % (
|
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
|
Zeuthen_flow : bool
|
||||||
(optional) If True, the Zeuthen flow is used for Qtop. Only possible
|
(optional) If True, the Zeuthen flow is used for Qtop. Only possible
|
||||||
for version=='sfqcd' If False, the Wilson flow is used.
|
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):
|
if not isinstance(target, int):
|
||||||
|
|
BIN
tests/data/openqcd_test/openqcd2r1.ms.dat
Normal file
BIN
tests/data/openqcd_test/openqcd2r1.ms.dat
Normal file
Binary file not shown.
BIN
tests/data/openqcd_test/sfqcdr1.gfms.dat
Normal file
BIN
tests/data/openqcd_test/sfqcdr1.gfms.dat
Normal file
Binary file not shown.
|
@ -47,3 +47,49 @@ def test_openqcd():
|
||||||
assert(rwfo[0].idl[repname] == range(1, 10))
|
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])
|
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))
|
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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue