From 90bb55b78b126ff91df29612430e83668c2697e9 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 22 Jan 2024 13:51:04 +0100 Subject: [PATCH 1/4] Fixing basis_r_power --- src/trexio_tools/converters/convert_from.py | 7 +++++++ src/trexio_tools/converters/convert_to.py | 8 +++++++- src/trexio_tools/converters/orca_to_trexio.py | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/trexio_tools/converters/convert_from.py b/src/trexio_tools/converters/convert_from.py index 023172d..30be6b5 100644 --- a/src/trexio_tools/converters/convert_from.py +++ b/src/trexio_tools/converters/convert_from.py @@ -201,6 +201,9 @@ def run_resultsFile(trexio_file, filename, motype=None): trexio.write_basis_coefficient(trexio_file,coefficient) trexio.write_basis_prim_factor(trexio_file,prim_factor) + # For Gaussian basis sets, basis_r_power is zero + basis_r_power = [0.0 for _ in range(basis_shell_num) ] + trexio.write_basis_r_power(trexio_file,basis_r_power) # AO # -- @@ -650,6 +653,10 @@ def run_molden(trexio_file, filename, normalized_basis=True, multiplicity=None, # write normalization factor for each shell trexio.write_basis_shell_factor(trexio_file,shell_factor) + # For Gaussian basis sets, basis_r_power is zero + basis_r_power = [0.0 for _ in range(basis_shell_num) ] + trexio.write_basis_r_power(trexio_file,basis_r_power) + # write parameters of the primitives trexio.write_basis_exponent(trexio_file,exponent) trexio.write_basis_coefficient(trexio_file,coefficient) diff --git a/src/trexio_tools/converters/convert_to.py b/src/trexio_tools/converters/convert_to.py index 1644144..194bdb1 100755 --- a/src/trexio_tools/converters/convert_to.py +++ b/src/trexio_tools/converters/convert_to.py @@ -272,6 +272,12 @@ def run_molden(t, filename): coefficient = trexio.read_basis_coefficient(t) prim_factor = trexio.read_basis_prim_factor(t) +# # For Gaussian basis sets, basis_r_power is zero by default +# if trexio.has_basis_r_power(trexio_file): +# basis_r_power = trexio.read_basis_r_power(trexio_file) +# else: +# basis_r_power = [0.0 for _ in range(basis_shell_num) ] + contr = [ { "exponent" : [], "coefficient" : [], "prim_factor" : [] } for _ in range(shell_num) ] @@ -463,7 +469,7 @@ def run_cart_phe(inp, filename, to_cartesian): normalization = np.array( [ 1. ] * ao_num_in ) if trexio.has_ao_normalization(inp): normalization = trexio.read_ao_normalization(inp) - + trexio.write_ao_normalization(out, cart_normalization) """ diff --git a/src/trexio_tools/converters/orca_to_trexio.py b/src/trexio_tools/converters/orca_to_trexio.py index 6a37ec5..3d16ebb 100644 --- a/src/trexio_tools/converters/orca_to_trexio.py +++ b/src/trexio_tools/converters/orca_to_trexio.py @@ -136,7 +136,7 @@ def orca_to_trexio( dict_ang_mom['h'] = 5 dict_ang_mom['i'] = 6 - basis_type = "Gaussian" # thanks anthony! + basis_type = "Gaussian" basis_shell_num = int(np.sum([atom_nshells[i] for i in range(nucleus_num)])) nucleus_index = [] for i in range(nucleus_num): From 6b37cbf95af84972f4ff6f452f3f33de81071df8 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 22 Jan 2024 14:00:23 +0100 Subject: [PATCH 2/4] Stupid typo --- src/trexio_tools/converters/convert_from.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/trexio_tools/converters/convert_from.py b/src/trexio_tools/converters/convert_from.py index 30be6b5..5ec4e9d 100644 --- a/src/trexio_tools/converters/convert_from.py +++ b/src/trexio_tools/converters/convert_from.py @@ -202,7 +202,7 @@ def run_resultsFile(trexio_file, filename, motype=None): trexio.write_basis_prim_factor(trexio_file,prim_factor) # For Gaussian basis sets, basis_r_power is zero - basis_r_power = [0.0 for _ in range(basis_shell_num) ] + basis_r_power = [0.0 for _ in range(shell_num) ] trexio.write_basis_r_power(trexio_file,basis_r_power) # AO From 044b6313c74155ce1f70019aa849c5a4de9ecf1b Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 1 Mar 2024 14:03:40 +0100 Subject: [PATCH 3/4] Activate comments --- src/trexio_tools/converters/convert_to.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/trexio_tools/converters/convert_to.py b/src/trexio_tools/converters/convert_to.py index 194bdb1..0a000aa 100755 --- a/src/trexio_tools/converters/convert_to.py +++ b/src/trexio_tools/converters/convert_to.py @@ -272,11 +272,11 @@ def run_molden(t, filename): coefficient = trexio.read_basis_coefficient(t) prim_factor = trexio.read_basis_prim_factor(t) -# # For Gaussian basis sets, basis_r_power is zero by default -# if trexio.has_basis_r_power(trexio_file): -# basis_r_power = trexio.read_basis_r_power(trexio_file) -# else: -# basis_r_power = [0.0 for _ in range(basis_shell_num) ] + # For Gaussian basis sets, basis_r_power is zero by default + if trexio.has_basis_r_power(trexio_file): + basis_r_power = trexio.read_basis_r_power(trexio_file) + else: + basis_r_power = [0.0 for _ in range(basis_shell_num) ] contr = [ { "exponent" : [], "coefficient" : [], From 017eda8996d662aa7cc73c80b49183b8a1bc3f46 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 1 Mar 2024 14:06:48 +0100 Subject: [PATCH 4/4] Fix previous commit --- src/trexio_tools/converters/convert_to.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/trexio_tools/converters/convert_to.py b/src/trexio_tools/converters/convert_to.py index 0a000aa..28568b3 100755 --- a/src/trexio_tools/converters/convert_to.py +++ b/src/trexio_tools/converters/convert_to.py @@ -273,8 +273,8 @@ def run_molden(t, filename): prim_factor = trexio.read_basis_prim_factor(t) # For Gaussian basis sets, basis_r_power is zero by default - if trexio.has_basis_r_power(trexio_file): - basis_r_power = trexio.read_basis_r_power(trexio_file) + if trexio.has_basis_r_power(t): + basis_r_power = trexio.read_basis_r_power(t) else: basis_r_power = [0.0 for _ in range(basis_shell_num) ]