Skip to content

Commit

Permalink
Merge branch 'dev-stable' of https://github.com/QuantumPackage/qp2 in…
Browse files Browse the repository at this point in the history
…to dev-stable
  • Loading branch information
eginer committed Dec 30, 2024
2 parents 0f6caa3 + 88c49a0 commit 2e95a05
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
27 changes: 15 additions & 12 deletions etc/qp.rc
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,21 @@ _qp_Complete()
;;
esac;;
set_file)
# Array to store directory names
dirs=""

# Find directories containing "ezfio/.version" file recursively
for i in $(find . -name ezfio | sed 's/ezfio$/.version/')
do
dir_name=${i%/.version} # Remove the ".version" suffix
dir_name=${dir_name#./} # Remove the leading "./"
dirs+="./$dir_name "
done

COMPREPLY=( $(compgen -W "$dirs" -- ${cur} ) )
# Caching the search results to reduce repeated find calls
if [[ -z "$QP_FILE_CACHE" || "$CACHE_DIR" != "$PWD" ]]; then
CACHE_DIR="$PWD"
QP_FILE_CACHE=$(find . -type f -name .version -exec dirname {} \; | sed 's/\/\.version$//')
fi

# Support for relative paths
prefix=$(dirname "${cur}")
if [[ "$prefix" != "." ]]; then
dirs=$(echo "$QP_FILE_CACHE" | grep "^$prefix")
else
dirs="$QP_FILE_CACHE"
fi

COMPREPLY=( $(compgen -W "$dirs" -- "$cur") )
return 0
;;
plugins)
Expand Down
8 changes: 4 additions & 4 deletions scripts/qp_import_trexio.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
convert TREXIO file to EZFIO
Usage:
qp_import_trexio [-o EZFIO_DIR] FILE
qp_import_trexio [-o EZFIO_DIR] [-p] FILE
Options:
-o --output=EZFIO_DIR Produced directory
by default is FILE.ezfio
-o --output=EZFIO_DIR Produced directory
by default is FILE.ezfio
"""

Expand Down Expand Up @@ -195,7 +195,7 @@ def write_ezfio(trexio_filename, filename):
prim_factor = trexio.read_basis_prim_factor(trexio_file)
for i,p in enumerate(prim_factor):
coefficient[i] *= prim_factor[i]
ezfio.set_ao_basis_primitives_normalized(False)
ezfio.set_ao_basis_primitives_normalized(True)
ezfio.set_basis_prim_coef(coefficient)

elif basis_type.lower() == "numerical":
Expand Down
12 changes: 6 additions & 6 deletions src/trexio/export_trexio_routines.irp.f
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ subroutine export_trexio(update,full_path)

allocate(factor(shell_num))
! if (ao_normalized) then
! factor(1:shell_num) = shell_normalization_factor(1:shell_num)
factor(1:shell_num) = shell_normalization_factor(1:shell_num)
! else
factor(1:shell_num) = 1.d0
! factor(1:shell_num) = 1.d0
! endif
rc = trexio_write_basis_shell_factor(f(1), factor)
call trexio_assert(rc, TREXIO_SUCCESS)
Expand All @@ -291,11 +291,11 @@ subroutine export_trexio(update,full_path)
call trexio_assert(rc, TREXIO_SUCCESS)

allocate(factor(prim_num))
if (primitives_normalized) then
! if (primitives_normalized) then
factor(1:prim_num) = prim_normalization_factor(1:prim_num)
else
factor(1:prim_num) = 1.d0
endif
! else
! factor(1:prim_num) = 1.d0
! endif
rc = trexio_write_basis_prim_factor(f(1), factor)
call trexio_assert(rc, TREXIO_SUCCESS)
deallocate(factor)
Expand Down

0 comments on commit 2e95a05

Please sign in to comment.