Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# TNFME
Library for online accessing, reading and writing three-nucleon interaction files.
When using the data files or software, please cite the original work:
E. Epelbaum, A. Nogga, W. Gl\"ockle, H. Kamada, U.-G. Mei{\ss}ner and H. Witala,
%``Three nucleon forces from chiral effective field theory,''
Phys. Rev. C \textbf{66} (2002), 064001
doi:10.1103/PhysRevC.66.064001
[arXiv:nucl-th/0208023 [nucl-th]].
## Installation
The source code and examples are available at
https://jugit.fz-juelich.de/a.nogga/tnfme.git
The easiest way to install is using pip:
```
pip install tnfme
```
## Usage
The package provides an interface to download the data files from our repository and to read the files and test.
More advanced options will be documented elsewhere.
Jupyter notebook downloading an example data base in `examples`.
This directory also includes some example scripts to modify the database locally.
For downloading specific files to a local directory, e.g., `$HOME/work/tnftest` use
```
import os
from tnfme import access
testdf=access.database(workdir=os.environ["HOME"]+"/work/tnftest")
```
This downloads a pandas dataframe with the available wave function files and stores it into `testdf` . The pandas dataframe can be printed using
```
import pandas as pd
pd.set_option('display.max_columns', None)
print(testdf.pddf)
```
Downloading three-nucleon force files of, e.g., row 4 of the table is done by
```
import os
# get file info from table
row=testdf.pddf.loc[[4]]
tnfid=row.to_dict('records')[0]
# retrieve file
hashname,uniquename=testdf.get_file(**tnfid)
# print name and file size
print("hashname: ",hashname)
print("filesize: ",os.path.getsize(hashname))
print("uniquename: ",uniquename)
```
The files are downloaded and gunzipped. They are partly also compressed using the ZFP compressors (see https://github.com/LLNL/zfp).
Using the files requires to install the corresponding HDF plugins (https://github.com/LLNL/H5Z-ZFP).
The local files will be first stored under their `hashname`.
However, the python method also returns a suggestion for a unique file name `uniquename`
that includes the parameters of the file. If wanted, users may rename the file using the provided `uniquename`.
The database contains 3nf files in momentum space and later in harmonic oscillator space.
You can read in and get some basic properties of the 3NF in momentum space using the tnffile_psp constructor
```
tnf=access.tnffile_psp(hashname,printlevel=1)
```