Skip to content

Commit

Permalink
Merge pull request #35 from TREX-CoE/basis_r_power
Browse files Browse the repository at this point in the history
  • Loading branch information
q-posev authored Mar 3, 2024
2 parents 912cbd4 + 017eda8 commit 07141bd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/trexio_tools/converters/convert_from.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(shell_num) ]
trexio.write_basis_r_power(trexio_file,basis_r_power)

# AO
# --
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 7 additions & 1 deletion src/trexio_tools/converters/convert_to.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(t):
basis_r_power = trexio.read_basis_r_power(t)
else:
basis_r_power = [0.0 for _ in range(basis_shell_num) ]

contr = [ { "exponent" : [],
"coefficient" : [],
"prim_factor" : [] } for _ in range(shell_num) ]
Expand Down Expand Up @@ -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)

"""
Expand Down
2 changes: 1 addition & 1 deletion src/trexio_tools/converters/orca_to_trexio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 07141bd

Please sign in to comment.