-
Notifications
You must be signed in to change notification settings - Fork 3
How to make a database file
Hiroshi Shinaoka edited this page Jul 2, 2018
·
5 revisions
In this page, the procedure to update the database is explained.
- Compute the solution of the basis functions, and make a reference data by using irlib.
It is convenient to use a sample script generate.py in irlib
to compute basis functions and generate a reference data.
For example, the following script will make basis_f-mp-Lambda10000.0.txt
.
from __future__ import print_function
import numpy
import irlib
# Compute basis functions very accurately
max_dim = 1000
cutoff = 1e-8
r_tol = 1e-8
verbose = True
prec = 64
n_local_poly = 8
n_gl_node = 24
## Construct basis
statis = 'F'
for Lambda in [10000.0]:
print("Computing basis functions... It may take some time")
if statis == 'F':
b = irlib.compute_basis(irlib.FERMIONIC, Lambda, max_dim, cutoff, "mp", r_tol, prec, n_local_poly, n_gl_node, verbose)
irlib.savetxt("basis_f-mp-Lambda"+str(Lambda)+".txt", b)
else:
b = irlib.compute_basis(irlib.BOSONIC, Lambda, max_dim, cutoff, "mp", r_tol, prec, n_local_poly, n_gl_node, verbose)
irlib.savetxt("basis_b-mp-Lambda"+str(Lambda)+".txt", b)
print("Done!")
You can easily obtain new data by changing parameters
max_dim
cutoff
r_tol
prec
n_local_poly
n_gl_node
and Lambda
.
- Update database
After making a reference data, you can store the data in hdf5 file by using make_h5.py in the database
folder.
The optional arguments of make_h5.py
are
-h, --help show this help message and exit
-o OUTPUTFILE, --output OUTPUTFILE
Path to output hdf5 file. (default: irbasis.h5)
-i INPUTFILE, --input INPUTFILE
Path to input file. (essential)
-l LAMBDA, --lambda LAMBDA
Value of lambda. (essential)
-p PREFIX, --prefix PREFIX
Data will be stored in this HF5 group. (essential)
For example, you can update/create irbasis.h5
by using the following command.
$ python make_h5.py -i basis_f-mp-Lambda10000.0.txt -p basis_f-mp-Lambda10000.0 -l 10000.0