10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-08-07 21:10:23 +02:00

Input need a default, not output !

This commit is contained in:
Thomas Applencourt 2015-03-27 16:56:35 +01:00
parent 5f84af566c
commit b281ab1248
3 changed files with 26 additions and 18 deletions

View File

@ -16,7 +16,7 @@ Format specification :
- ezfio_name : Will be the name of the file for the ezfio - ezfio_name : Will be the name of the file for the ezfio
(optional by default is the name of the provider) (optional by default is the name of the provider)
- interface : The provider is a imput or a output - interface : The provider is a imput or a output
- default : The default value if interface == output: - default : The default value if interface == input:
- size : Is the string read in ezfio.cgf who containt the size information - size : Is the string read in ezfio.cgf who containt the size information
(like 1 or =sum(ao_num) or (ao_num,3) ) (like 1 or =sum(ao_num) or (ao_num,3) )
@ -26,7 +26,7 @@ Example EZFIO.cfg:
doc: Threshold on the convergence of the Hartree Fock energy doc: Threshold on the convergence of the Hartree Fock energy
type: Threshold type: Threshold
default: 1.e-10 default: 1.e-10
interface: output interface: input
default: 10000 default: 10000
size : ao_num, 3 size : ao_num, 3
@ -34,7 +34,7 @@ size : ao_num, 3
type: logical type: logical
doc: If true, compute the PT2 at the end of the selection doc: If true, compute the PT2 at the end of the selection
default: true default: true
interface: input interface: output
size : 1 size : 1
``` ```
@ -237,7 +237,7 @@ def get_dict_config_file(config_file_path, module_lower):
d[pvd][option] = d_default[option] d[pvd][option] = d_default[option]
# If interface is output we need a default value information # If interface is output we need a default value information
if d[pvd]["interface"] == "output": if d[pvd]["interface"] == "input":
try: try:
default_raw = config_file.get(section, "default") default_raw = config_file.get(section, "default")
except ConfigParser.NoOptionError: except ConfigParser.NoOptionError:
@ -416,9 +416,15 @@ def save_ezfio_config(module_lower, str_ezfio_config):
def create_ocaml_input(dict_ezfio_cfg): def create_ocaml_input(dict_ezfio_cfg):
l_provider = [k for k, v in dict_ezfio_cfg.iteritems() if 'default' in v] l_provider = []
l_type = [v["type"] for k, v in dict_ezfio_cfg.iteritems() if 'default' in v] l_type = []
l_doc = [v["doc"] for k, v in dict_ezfio_cfg.iteritems() if 'default' in v] l_doc = []
for k, v in dict_ezfio_cfg.iteritems():
if v['interface'] == "output":
l_provider.append(k)
l_type.append(v["type"])
l_doc.append(v["doc"])
# ~#~#~#~#~#~#~#~# # # ~#~#~#~#~#~#~#~# #
# C r e a t i o n # # C r e a t i o n #
@ -514,6 +520,7 @@ def save_ocaml_input(module_lower, str_ocaml_input):
with open(path, "w") as f: with open(path, "w") as f:
f.write(str_ocaml_input) f.write(str_ocaml_input)
def main(): def main():
""" """
Two condition: Two condition:

View File

@ -148,7 +148,8 @@ class EZFIO_ocaml(object):
"let read() = ", "let read() = ",
" Some", " Some",
" {"] " {"]
l_template += [" {0:<30} = read_{0} ();".format(p) for p in l_provider] l_template += [" {0:<30} = read_{0} ();".format(p)
for p in l_provider]
l_template += [" }", l_template += [" }",
";;"] ";;"]
@ -161,8 +162,8 @@ class EZFIO_ocaml(object):
@staticmethod @staticmethod
def create_write_global(l_provider): def create_write_global(l_provider):
l_template = ["(* Write all *)", l_template = ["(* Write all *)",
"let write{ "] "let write{ "]
l_template += [" {0};".format(p) for p in l_provider] l_template += [" {0};".format(p) for p in l_provider]
l_template += [" } ="] l_template += [" } ="]
l_template += [" write_{0:<30} {0};".format(p) for p in l_provider] l_template += [" write_{0:<30} {0};".format(p) for p in l_provider]
@ -180,7 +181,7 @@ class EZFIO_ocaml(object):
'let to_string b =', 'let to_string b =',
' Printf.sprintf "'] ' Printf.sprintf "']
l_template += ["{0} = %s".format(p) for p in l_provider] l_template += ["{0} = %s".format(p) for p in l_provider]
l_template += ['"'] l_template += ['"']
for p, t in zip(l_provider, l_type): for p, t in zip(l_provider, l_type):

View File

@ -1,42 +1,42 @@
[N_det_max_fci] [N_det_max_fci]
type: Det_number_max type: Det_number_max
doc: Max number of determinants in the wave function doc: Max number of determinants in the wave function
interface: output interface: input
default: 10000 default: 10000
[N_det_max_fci_property] [N_det_max_fci_property]
type: Det_number_max type: Det_number_max
doc: Max number of determinants in the wave function when you select for a given property doc: Max number of determinants in the wave function when you select for a given property
interface: output interface: input
default: 10000 default: 10000
[do_pt2_end] [do_pt2_end]
type: logical type: logical
doc: If true, compute the PT2 at the end of the selection doc: If true, compute the PT2 at the end of the selection
interface: output interface: input
default: true default: true
[PT2_max] [PT2_max]
type: PT2_energy type: PT2_energy
doc: The selection process stops when the largest PT2 (for all the state) is lower doc: The selection process stops when the largest PT2 (for all the state) is lower
than pt2_max in absolute value than pt2_max in absolute value
interface: output interface: input
default: 0.0001 default: 0.0001
[var_pt2_ratio] [var_pt2_ratio]
type: Normalized_float type: Normalized_float
doc: The selection process stops when the energy ratio variational/(variational+PT2) doc: The selection process stops when the energy ratio variational/(variational+PT2)
is equal to var_pt2_ratio is equal to var_pt2_ratio
interface: output interface: input
default: 0.75 default: 0.75
[energy] [energy]
type: double precision type: double precision
doc: "Calculated Full CI energy" doc: "Calculated Full CI energy"
interface: input interface: output
[energy_pt2] [energy_pt2]
type: double precision type: double precision
doc: "Calculated Full CI energy" doc: "Calculated Full CI energy"
interface: input interface: output