mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-16 15:20:24 +01:00
Merge pull request #80 from s-kuberski/feature/qtop
qtop_projection can now handle non-int charges
This commit is contained in:
commit
69e17aaa17
1 changed files with 2 additions and 2 deletions
|
@ -780,7 +780,7 @@ def qtop_projection(qtop, target=0):
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
path : Obs
|
path : Obs
|
||||||
Topological charge, rounded to nearest integer on each config.
|
Topological charge.
|
||||||
target : int
|
target : int
|
||||||
Specifies the topological sector to be reweighted to (default 0)
|
Specifies the topological sector to be reweighted to (default 0)
|
||||||
"""
|
"""
|
||||||
|
@ -789,7 +789,7 @@ def qtop_projection(qtop, target=0):
|
||||||
|
|
||||||
proj_qtop = []
|
proj_qtop = []
|
||||||
for n in qtop.deltas:
|
for n in qtop.deltas:
|
||||||
proj_qtop.append(np.array([1 if int(qtop.value + q) == target else 0 for q in qtop.deltas[n]]))
|
proj_qtop.append(np.array([1 if round(qtop.value + q) == target else 0 for q in qtop.deltas[n]]))
|
||||||
|
|
||||||
reto = Obs(proj_qtop, qtop.names, idl=[qtop.idl[name] for name in qtop.names])
|
reto = Obs(proj_qtop, qtop.names, idl=[qtop.idl[name] for name in qtop.names])
|
||||||
reto.is_merged = qtop.is_merged
|
reto.is_merged = qtop.is_merged
|
||||||
|
|
Loading…
Add table
Reference in a new issue