PyQUDA-Utils 0.9.8.dev1__tar.gz → 0.9.9.dev3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/PKG-INFO +1 -1
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/PyQUDA_Utils.egg-info/PKG-INFO +1 -1
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/PyQUDA_Utils.egg-info/SOURCES.txt +2 -0
- pyquda_utils-0.9.9.dev3/pyquda_utils/_version.py +1 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/gpt.py +1 -1
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/io/__init__.py +17 -1
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/io/chroma.py +25 -53
- pyquda_utils-0.9.9.dev3/pyquda_utils/io/lime.py +38 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/io/milc.py +12 -28
- pyquda_utils-0.9.9.dev3/pyquda_utils/io/openqcd.py +39 -0
- pyquda_utils-0.9.8.dev1/pyquda_utils/_version.py +0 -1
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/LICENSE +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/MANIFEST.in +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/PyQUDA_Utils.egg-info/dependency_links.txt +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/PyQUDA_Utils.egg-info/requires.txt +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/PyQUDA_Utils.egg-info/top_level.txt +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/README.md +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyproject.toml +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/__init__.py +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/convert.py +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/core.py +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/deprecated.py +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/gamma.py +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/hmc_param.py +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/io/io_general.py +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/io/kyu.py +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/io/npy.py +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/io/xqcd.py +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/milc_rhmc_param.py +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/phase.py +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/quasi_axial_gauge_fixing.py +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/source.py +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/setup.cfg +0 -0
- {pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.9.9.dev3"
|
|
@@ -49,7 +49,7 @@ def LatticeGaugeGPT(lattice: List[g.lattice], gen_simd_width: int, gauge: Lattic
|
|
|
49
49
|
for index in range(latt_info.Nd):
|
|
50
50
|
gpt_shape = [i for sl in zip(gpt_simd, gpt_latt) for i in sl]
|
|
51
51
|
lattice[index].mview()[0][:] = (
|
|
52
|
-
gauge.lexico()
|
|
52
|
+
gauge[index].lexico()
|
|
53
53
|
.astype(f"<c{2 * gpt_prec}")
|
|
54
54
|
.reshape(*gpt_shape, Nc, Nc)
|
|
55
55
|
.transpose(1, 3, 5, 7, 8, 9, 0, 2, 4, 6)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import List, Union
|
|
1
|
+
from typing import List, Literal, Union
|
|
2
2
|
|
|
3
3
|
import numpy
|
|
4
4
|
|
|
@@ -218,6 +218,22 @@ def writeNPYPropagator(filename: str, propagator: LatticePropagator):
|
|
|
218
218
|
write(filename, propagator.latt_info.global_size, propagator.lexico())
|
|
219
219
|
|
|
220
220
|
|
|
221
|
+
def readOpenQCDGauge(filename: str, endian: Literal["<", ">"] = "<"):
|
|
222
|
+
from .openqcd import readGauge as read
|
|
223
|
+
|
|
224
|
+
latt_size, plaquette, gauge_raw = read(filename, endian)
|
|
225
|
+
gauge = LatticeGauge(LatticeInfo(latt_size), cb2(gauge_raw, [1, 2, 3, 4]))
|
|
226
|
+
print(gauge.plaquette()[0], plaquette)
|
|
227
|
+
return gauge
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def writeOpenQCDGauge(filename: str, gauge: LatticeGauge):
|
|
231
|
+
from .openqcd import writeGauge as write
|
|
232
|
+
|
|
233
|
+
print(gauge.plaquette())
|
|
234
|
+
write(filename, gauge.latt_info.global_size, gauge.plaquette()[0] * Nc, gauge.lexico())
|
|
235
|
+
|
|
236
|
+
|
|
221
237
|
def readQIOGauge(filename: str):
|
|
222
238
|
return readChromaQIOGauge(filename)
|
|
223
239
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import io
|
|
2
1
|
from os import path
|
|
3
|
-
import
|
|
4
|
-
from typing import Dict, List, Tuple
|
|
2
|
+
from typing import List
|
|
5
3
|
from xml.etree import ElementTree as ET
|
|
6
4
|
|
|
7
5
|
from pyquda import getSublatticeSize, getMPIComm, getGridCoord, readMPIFile
|
|
@@ -35,31 +33,18 @@ def checksum_qio(latt_size: List[int], data):
|
|
|
35
33
|
|
|
36
34
|
|
|
37
35
|
def readQIOGauge(filename: str, checksum: bool = True):
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
f.seek(meta["scidac-private-file-xml"][0])
|
|
51
|
-
scidac_private_file_xml = ET.ElementTree(
|
|
52
|
-
ET.fromstring(f.read(meta["scidac-private-file-xml"][1]).strip(b"\x00").decode("utf-8"))
|
|
53
|
-
)
|
|
54
|
-
f.seek(meta["scidac-private-record-xml"][0])
|
|
55
|
-
scidac_private_record_xml = ET.ElementTree(
|
|
56
|
-
ET.fromstring(f.read(meta["scidac-private-record-xml"][1]).strip(b"\x00").decode("utf-8"))
|
|
57
|
-
)
|
|
58
|
-
f.seek(meta["scidac-checksum"][0])
|
|
59
|
-
scidac_checksum_xml = ET.ElementTree(
|
|
60
|
-
ET.fromstring(f.read(meta["scidac-checksum"][1]).strip(b"\x00").decode("utf-8"))
|
|
61
|
-
)
|
|
62
|
-
offset = meta["ildg-binary-data"][0]
|
|
36
|
+
from .lime import Lime
|
|
37
|
+
|
|
38
|
+
lime = Lime(filename)
|
|
39
|
+
scidac_private_file_xml = ET.ElementTree(
|
|
40
|
+
ET.fromstring(lime.read("scidac-private-file-xml").strip(b"\x00").decode("utf-8"))
|
|
41
|
+
)
|
|
42
|
+
scidac_private_record_xml = ET.ElementTree(
|
|
43
|
+
ET.fromstring(lime.read("scidac-private-record-xml").strip(b"\x00").decode("utf-8"))
|
|
44
|
+
)
|
|
45
|
+
scidac_checksum_xml = ET.ElementTree(ET.fromstring(lime.read("scidac-checksum").strip(b"\x00").decode("utf-8")))
|
|
46
|
+
offset = lime.record("ildg-binary-data").offset
|
|
47
|
+
|
|
63
48
|
precision = _precision_map[scidac_private_record_xml.find("precision").text]
|
|
64
49
|
assert int(scidac_private_record_xml.find("colors").text) == Nc
|
|
65
50
|
assert (
|
|
@@ -94,31 +79,18 @@ def readILDGBinGauge(filename: str, dtype: str, latt_size: List[int]):
|
|
|
94
79
|
|
|
95
80
|
|
|
96
81
|
def readQIOPropagator(filename: str, checksum: bool = True):
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
f.seek(meta["scidac-private-file-xml"][0])
|
|
110
|
-
scidac_private_file_xml = ET.ElementTree(
|
|
111
|
-
ET.fromstring(f.read(meta["scidac-private-file-xml"][1]).strip(b"\x00").decode("utf-8"))
|
|
112
|
-
)
|
|
113
|
-
f.seek(meta["scidac-private-record-xml"][0])
|
|
114
|
-
scidac_private_record_xml = ET.ElementTree(
|
|
115
|
-
ET.fromstring(f.read(meta["scidac-private-record-xml"][1]).strip(b"\x00").decode("utf-8"))
|
|
116
|
-
)
|
|
117
|
-
f.seek(meta["scidac-checksum"][0])
|
|
118
|
-
scidac_checksum_xml = ET.ElementTree(
|
|
119
|
-
ET.fromstring(f.read(meta["scidac-checksum"][1]).strip(b"\x00").decode("utf-8"))
|
|
120
|
-
)
|
|
121
|
-
offset = meta["scidac-binary-data"][0]
|
|
82
|
+
from .lime import Lime
|
|
83
|
+
|
|
84
|
+
lime = Lime(filename)
|
|
85
|
+
scidac_private_file_xml = ET.ElementTree(
|
|
86
|
+
ET.fromstring(lime.read("scidac-private-file-xml").strip(b"\x00").decode("utf-8"))
|
|
87
|
+
)
|
|
88
|
+
scidac_private_record_xml = ET.ElementTree(
|
|
89
|
+
ET.fromstring(lime.read("scidac-private-record-xml").strip(b"\x00").decode("utf-8"))
|
|
90
|
+
)
|
|
91
|
+
scidac_checksum_xml = ET.ElementTree(ET.fromstring(lime.read("scidac-checksum").strip(b"\x00").decode("utf-8")))
|
|
92
|
+
offset = lime.record("scidac-binary-data").offset
|
|
93
|
+
|
|
122
94
|
precision = _precision_map[scidac_private_record_xml.find("precision").text]
|
|
123
95
|
assert int(scidac_private_record_xml.find("colors").text) == Nc
|
|
124
96
|
assert (
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import io
|
|
2
|
+
from os import path
|
|
3
|
+
import struct
|
|
4
|
+
from typing import List, NamedTuple
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class LimeRecord(NamedTuple):
|
|
8
|
+
name: str
|
|
9
|
+
offset: int
|
|
10
|
+
length: int
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Lime:
|
|
14
|
+
def __init__(self, filename: str):
|
|
15
|
+
self.filename = path.expanduser(path.expandvars(filename))
|
|
16
|
+
self._records: List[LimeRecord] = []
|
|
17
|
+
with open(self.filename, "rb") as f:
|
|
18
|
+
buffer = f.read(8)
|
|
19
|
+
while buffer != b"" and buffer != b"\x0A":
|
|
20
|
+
assert buffer.startswith(b"\x45\x67\x89\xAB\x00\x01")
|
|
21
|
+
length = struct.unpack(">Q", f.read(8))[0]
|
|
22
|
+
name = f.read(128).strip(b"\x00").decode("utf-8")
|
|
23
|
+
self._records.append(LimeRecord(name, f.tell(), length))
|
|
24
|
+
f.seek((length + 7) // 8 * 8, io.SEEK_CUR)
|
|
25
|
+
buffer = f.read(8)
|
|
26
|
+
|
|
27
|
+
def records(self, key: str):
|
|
28
|
+
return [record for record in self._records if record.name == key]
|
|
29
|
+
|
|
30
|
+
def record(self, key: str, index: int = 0):
|
|
31
|
+
return [record for record in self._records if record.name == key][index]
|
|
32
|
+
|
|
33
|
+
def read(self, key: str, index: int = 0):
|
|
34
|
+
record = self.record(key, index)
|
|
35
|
+
with open(self.filename, "rb") as f:
|
|
36
|
+
f.seek(record.offset)
|
|
37
|
+
buffer = f.read(record.length)
|
|
38
|
+
return buffer
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
-
import io
|
|
3
2
|
from os import path
|
|
4
3
|
import struct
|
|
5
|
-
from typing import
|
|
4
|
+
from typing import List
|
|
6
5
|
from xml.etree import ElementTree as ET
|
|
7
6
|
|
|
8
7
|
import numpy
|
|
@@ -107,32 +106,17 @@ def writeGauge(filename: str, latt_size: List[int], gauge: numpy.ndarray):
|
|
|
107
106
|
|
|
108
107
|
|
|
109
108
|
def readQIOPropagator(filename: str):
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
meta[name].append((f.tell(), length))
|
|
122
|
-
f.seek(length, io.SEEK_CUR)
|
|
123
|
-
buffer = f.read(8)
|
|
124
|
-
|
|
125
|
-
f.seek(meta["scidac-private-file-xml"][0][0])
|
|
126
|
-
scidac_private_file_xml = ET.ElementTree(
|
|
127
|
-
ET.fromstring(f.read(meta["scidac-private-file-xml"][0][1]).strip(b"\x00").decode("utf-8"))
|
|
128
|
-
)
|
|
129
|
-
f.seek(meta["scidac-private-record-xml"][1][0])
|
|
130
|
-
scidac_private_record_xml = ET.ElementTree(
|
|
131
|
-
ET.fromstring(f.read(meta["scidac-private-record-xml"][1][1]).strip(b"\x00").decode("utf-8"))
|
|
132
|
-
)
|
|
133
|
-
offset = []
|
|
134
|
-
for meta_scidac_binary_data in meta["scidac-binary-data"][1::2]:
|
|
135
|
-
offset.append(meta_scidac_binary_data[0])
|
|
109
|
+
from .lime import Lime
|
|
110
|
+
|
|
111
|
+
lime = Lime(filename)
|
|
112
|
+
scidac_private_file_xml = ET.ElementTree(
|
|
113
|
+
ET.fromstring(lime.read("scidac-private-file-xml", 0).strip(b"\x00").decode("utf-8"))
|
|
114
|
+
)
|
|
115
|
+
scidac_private_record_xml = ET.ElementTree(
|
|
116
|
+
ET.fromstring(lime.read("scidac-private-record-xml", 1).strip(b"\x00").decode("utf-8"))
|
|
117
|
+
)
|
|
118
|
+
offset = [record.offset for record in lime.records("scidac-binary-data")[1::2]]
|
|
119
|
+
|
|
136
120
|
precision = _precision_map[scidac_private_record_xml.find("precision").text]
|
|
137
121
|
assert int(scidac_private_record_xml.find("colors").text) == Nc
|
|
138
122
|
if scidac_private_record_xml.find("spins") is not None:
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from os import path
|
|
2
|
+
import struct
|
|
3
|
+
from typing import List, Literal
|
|
4
|
+
|
|
5
|
+
import numpy
|
|
6
|
+
|
|
7
|
+
from pyquda import getSublatticeSize, getMPIRank, getMPIComm, readMPIFile, writeMPIFile
|
|
8
|
+
|
|
9
|
+
Nd, Ns, Nc = 4, 4, 3
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def readGauge(filename: str, endian: Literal["<", ">"] = "<"):
|
|
13
|
+
filename = path.expanduser(path.expandvars(filename))
|
|
14
|
+
with open(filename, "rb") as f:
|
|
15
|
+
latt_size = struct.unpack(f"{endian}iiii", f.read(16))[::-1]
|
|
16
|
+
plaquette = struct.unpack(f"{endian}d", f.read(8))[0]
|
|
17
|
+
offset = f.tell()
|
|
18
|
+
Lx, Ly, Lz, Lt = getSublatticeSize(latt_size)
|
|
19
|
+
dtype = f"{endian}c16"
|
|
20
|
+
|
|
21
|
+
gauge = readMPIFile(filename, dtype, offset, (Lt, Lz, Ly, Lx, Nd, Nc, Nc), (3, 2, 1, 0))
|
|
22
|
+
gauge = gauge.transpose(4, 0, 1, 2, 3, 5, 6).astype("<c16")
|
|
23
|
+
return latt_size, plaquette, gauge
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def writeGauge(filename: str, latt_size: List[int], plaquette: float, gauge: numpy.ndarray):
|
|
27
|
+
filename = path.expanduser(path.expandvars(filename))
|
|
28
|
+
Lx, Ly, Lz, Lt = latt_size
|
|
29
|
+
dtype, offset = "<c16", None
|
|
30
|
+
|
|
31
|
+
gauge = numpy.ascontiguousarray(gauge.transpose(1, 2, 3, 4, 0, 5, 6).astype(dtype))
|
|
32
|
+
if getMPIRank() == 0:
|
|
33
|
+
with open(filename, "wb") as f:
|
|
34
|
+
f.write(struct.pack("<iiii", *latt_size[::-1]))
|
|
35
|
+
f.write(struct.pack("<d", plaquette))
|
|
36
|
+
offset = f.tell()
|
|
37
|
+
offset = getMPIComm().bcast(offset)
|
|
38
|
+
|
|
39
|
+
writeMPIFile(filename, dtype, offset, (Lt, Lz, Ly, Lx, Nd, Nc, Nc), (3, 2, 1, 0), gauge)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.9.8.dev1"
|
|
File without changes
|
|
File without changes
|
{pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/PyQUDA_Utils.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyquda_utils-0.9.8.dev1 → pyquda_utils-0.9.9.dev3}/pyquda_utils/quasi_axial_gauge_fixing.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|