Skip to content

Commit

Permalink
Adding options to add custom potentials and particles. Also setting t…
Browse files Browse the repository at this point in the history
…he mass from the isotope as the default value for the nuclear mass. Solves issues #31 and #100

Added the option to define "eta" (particles per orbital) directly from the input. As example, one test defining positron in closed shell.
Removed the TIP4P particles and potentials from lib/databases, and now they are passed directly from the input (see these tests as examples).
Added a test for the isotopes mass.
Merged externalPotential and interPotential into a single module GTFpotential
Now the script moves the fchk to/from the scratch. Also, when looking for the coefficients from these files, now it does not stop when it fails to find a fchk for a species, instead does a HCore guess. However, the fchks tests are still missing (related to #103)
  • Loading branch information
fsmoncadaa committed Nov 27, 2024
1 parent c84166f commit 9c10e1a
Show file tree
Hide file tree
Showing 42 changed files with 3,715 additions and 1,088 deletions.
40 changes: 33 additions & 7 deletions bin/lowdin
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ if [ $extFile="lowdin" ]; then
else if(toupper($i)==toupper("m")){
printf("\tInputParticle_mass = %s\n",toupper($(i+2)) )
}
else if(toupper($i)==toupper("eta")){
printf("\tInputParticle_eta = %s\n",toupper($(i+2)) )
}
else if(toupper($i)==toupper("omega")){
printf("\tInputParticle_omega = %s\n",toupper($(i+2)) )
}
Expand Down Expand Up @@ -381,10 +384,10 @@ if [ $extFile="lowdin" ]; then
' | $SED "s/,/./g" >> $nameFile.aux

###########################################
# Check custom basis sets in the input
# Check custom basis sets/potentials in the input
###########################################

BASIS_NAMES=(`gawk '($1~/BASIS/){print toupper($2)}' $nameFile`)
BASIS_NAMES=(`gawk '($1~/^BASIS$/){print toupper($2)}' $nameFile`)
if [ ${#BASIS_NAMES[@]} -gt "0" ]
then
for BASIS_NAME in ${BASIS_NAMES[@]}
Expand All @@ -401,6 +404,23 @@ if [ $extFile="lowdin" ]; then
done
fi

POTENTIALS_NAMES=(`gawk '($1~/^POTENTIAL$/){print toupper($2)}' $nameFile`)
if [ ${#POTENTIALS_NAMES[@]} -gt "0" ]
then
for POTENTIALS_NAME in ${POTENTIALS_NAMES[@]}
do
if [ -e $LOWDIN_DATA/basis/$POTENTIALS_NAME ]
then
echo "## ERROR: ## The custom potential file already exists in " $LOWDIN_DATA/potentials/$POTENTIALS_NAME
echo "Modify the POTENTIALS block in your input and select a different name"
exit 1
fi
gawk '($1~/POTENTIALS/ && toupper($2)~/^'$POTENTIALS_NAME'$/){flag=1; next}
($0~/END/){flag=0};
(flag==1){print toupper($0)}' $nameFile > $POTENTIALS_NAME.$PID
done
fi


###########################################
# Exec lowdin.x
Expand All @@ -421,6 +441,7 @@ if [ $extFile="lowdin" ]; then

cp $nameFile*.vec $LOWDIN_SCRATCH/$nameFile &> /dev/null
cp $nameFile*.plainvec $LOWDIN_SCRATCH/$nameFile &> /dev/null
cp $nameFile*.fchk $LOWDIN_SCRATCH/$nameFile &> /dev/null
cp $nameFile*.val $LOWDIN_SCRATCH/$nameFile &> /dev/null
cp $nameFile*.dens $LOWDIN_SCRATCH/$nameFile &> /dev/null
cp $nameFile*.sup $LOWDIN_SCRATCH/$nameFile &> /dev/null
Expand All @@ -432,20 +453,24 @@ if [ $extFile="lowdin" ]; then
mv $nameFile*.over $LOWDIN_SCRATCH/$nameFile &> /dev/null
mv $nameFile*.kin $LOWDIN_SCRATCH/$nameFile &> /dev/null
mv $nameFile*.coeff $LOWDIN_SCRATCH/$nameFile &> /dev/null
#PID to avoid basis duplicates in simultaneous calculations
cp $nameFile*.gms.bs $LOWDIN_SCRATCH/$nameFile &> /dev/null

#PID to avoid basis/potentials duplicates in simultaneous calculations
if [ ${#BASIS_NAMES[@]} -gt "0" ]
then
for BASIS_NAME in ${BASIS_NAMES[@]}
do
mv $BASIS_NAME.$PID $LOWDIN_SCRATCH/$nameFile/$BASIS_NAME &> /dev/null
done
fi

if [ -e $nameFile.gms.bs ]
if [ ${#POTENTIALS_NAMES[@]} -gt "0" ]
then
cp $nameFile.gms.bs $LOWDIN_SCRATCH/$nameFile
for POTENTIALS_NAME in ${POTENTIALS_NAMES[@]}
do
mv $POTENTIALS_NAME.$PID $LOWDIN_SCRATCH/$nameFile/$POTENTIALS_NAME &> /dev/null
done
fi

# setting default number of cores for OpenMP

if [ -z "$OMP_NUM_THREADS" ]; then
Expand Down Expand Up @@ -515,6 +540,7 @@ if [ $extFile="lowdin" ]; then
mv $LOWDIN_SCRATCH/$nameFile/$nameFile*.47 $currentPath &> 2
mv $LOWDIN_SCRATCH/$nameFile/*.vec $currentPath &> 2
mv $LOWDIN_SCRATCH/$nameFile/*.plainvec $currentPath &> 2
mv $LOWDIN_SCRATCH/$nameFile/*.fchk $currentPath &> 2
# mv $LOWDIN_SCRATCH/$nameFile/*.val $currentPath &> 2
mv $LOWDIN_SCRATCH/$nameFile/*.NOCI.coords $currentPath &> 2
mv $LOWDIN_SCRATCH/$nameFile/*.NOCI.s* $currentPath &> 2
Expand Down
44 changes: 0 additions & 44 deletions lib/basis/H2O-1S1P1D

This file was deleted.

52 changes: 50 additions & 2 deletions lib/basis/PSX-DZ
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
O-POSITRON E+ (5S) BASIS TYPE: 3
# (5S)-[5S]
O-POSITRON E+ (5S3P2D) BASIS TYPE: 3
# (5S3P2D)-[5S3P2D]
10
1 0 1
.0189693659 1.0
1 0 1
.05186863351164733038 1.0
1 0 1
.14182630861506996771 1.0
1 0 1
.38780088183468771642 1.0
1 0 1
1.06037818667291718709 1.0
1 1 1
.0590955656 1.0
1 1 1
.16127967470846848928 1.0
1 1 1
.44015372744092004227 1.0
1 2 1
.11654481880000000000 1.0
1 2 1
.31287113568838127412 1.0

O-POSITRON E+A (5S3P2D) BASIS TYPE: 3
# (5S3P2D)-[5S3P2D]
10
1 0 1
.0189693659 1.0
1 0 1
.05186863351164733038 1.0
1 0 1
.14182630861506996771 1.0
1 0 1
.38780088183468771642 1.0
1 0 1
1.06037818667291718709 1.0
1 1 1
.0590955656 1.0
1 1 1
.16127967470846848928 1.0
1 1 1
.44015372744092004227 1.0
1 2 1
.11654481880000000000 1.0
1 2 1
.31287113568838127412 1.0

O-POSITRON E+B (5S3P2D) BASIS TYPE: 3
# (5S3P2D)-[5S3P2D]
10
1 0 1
.0189693659 1.0
Expand Down
16 changes: 0 additions & 16 deletions lib/dataBases/constantsOfCoupling.lib
Original file line number Diff line number Diff line change
Expand Up @@ -4525,19 +4525,3 @@
LAMBDA = 2.0
PARTICLESFRACTION = 0.5
/
&SPECIE
NAME = "HA-TIP"
SYMBOL = "X0.5+"
KAPPA = -1.0
ETA = 1.0
LAMBDA = 1.0
PARTICLESFRACTION = 1
/
&SPECIE
NAME = "HB-TIP"
SYMBOL = "Y0.5+"
KAPPA = -1.0
ETA = 1.0
LAMBDA = 1.0
PARTICLESFRACTION = 1
/
36 changes: 6 additions & 30 deletions lib/dataBases/elementalParticles.lib
Original file line number Diff line number Diff line change
Expand Up @@ -171,71 +171,47 @@
SYMBOL = "HEA3"
CATEGORY = "LEPTON"
CHARGE = 1
MASS = 5494.892576965
MASS = 5495.8851
SPIN = 0.5
/
&PARTICLE
NAME = "HE-ATOM2"
SYMBOL = "HEB3"
CATEGORY = "LEPTON"
CHARGE = 1
MASS = 5494.892576965
MASS = 5495.8851
SPIN = 0.5
/
&PARTICLE
NAME = "HE-ATOM"
SYMBOL = "HES3"
CATEGORY = "LEPTON"
CHARGE = 1
MASS = 5494.892576965
MASS = 5495.8851
SPIN = 0.5
/
&PARTICLE
NAME = "HE-ATOM1"
SYMBOL = "HEA4"
CATEGORY = "LEPTON"
CHARGE = 1
MASS = 7292.327967297
MASS = 7294.2994
SPIN = 0.5
/
&PARTICLE
NAME = "HE-ATOM2"
SYMBOL = "HEB4"
CATEGORY = "LEPTON"
CHARGE = 1
MASS = 7292.327967297
MASS = 7294.2994
SPIN = 0.5
/
&PARTICLE
NAME = "HE-ATOM"
SYMBOL = "HES4"
CATEGORY = "LEPTON"
CHARGE = 1
MASS = 7292.327967297
SPIN = 0.5
/
&PARTICLE
NAME = "HA-TIP"
SYMBOL = "X0.5+"
CATEGORY = "LEPTON"
CHARGE = 0.5564
MASS = 1836.15267247
SPIN = 0.5
/
&PARTICLE
NAME = "HB-TIP"
SYMBOL = "Y0.5+"
CATEGORY = "LEPTON"
CHARGE = 0.5564
MASS = 1836.15267247
SPIN = -0.5
/
&PARTICLE
NAME = "M-TIP"
SYMBOL = "X1.1-"
CATEGORY = "LEPTON"
CHARGE = -1.1128
MASS = 1836.15267247
MASS = 7294.2994
SPIN = 0.5
/
&PARTICLE
Expand Down
86 changes: 40 additions & 46 deletions src/core/ConstantsOfCoupling.f90
Original file line number Diff line number Diff line change
Expand Up @@ -71,59 +71,53 @@ subroutine ConstantsOfCoupling_load( this, symbolSelected )
!! Looking for library
inquire(file=trim(CONTROL_instance%DATA_DIRECTORY)//"/dataBases/constantsOfCoupling.lib", exist=existFile)

if ( existFile ) then

!! Open library
open(unit=10, file=trim(CONTROL_instance%DATA_DIRECTORY)//"/dataBases/constantsOfCoupling.lib", status="old", form="formatted" )

!! Read information
symbol = "NONE"
stat = 0

do while(trim(symbol) /= trim(symbolSelected))

!! Setting defaults
name = "NONE"
kappa = 0
eta = 0
particlesFraction = 1

if (stat == -1 ) then

call ConstantsOfCoupling_exception( ERROR, "Elemental particle: "//trim(symbolSelected)//" NOT found!!", "In ConstantsOfCoupling at load function.")
this%isInstanced = .false.
if ( .not. existFile ) call ConstantsOfCoupling_exception( ERROR, "LOWDIN library not found!! please export lowdinvars.sh file.", "In ConstantsOfCoupling at load function.")

!! Open library
open(unit=10, file=trim(CONTROL_instance%DATA_DIRECTORY)//"/dataBases/constantsOfCoupling.lib", status="old", form="formatted" )

end if

read(10,NML=specie, iostat=stat)

if (stat > 0 ) then

call ConstantsOfCoupling_exception( ERROR, "Failed reading ConstantsOfCouplings.lib file!! please check this file.", "In ConstantsOfCoupling at load function.")

end if
!! Read information
symbol = "NONE"
stat = 0

end do
do while(trim(symbol) /= trim(symbolSelected))

!! Set object variables
this%name = name
this%symbol = symbol
this%kappa = kappa
this%eta = eta
this%lambda = lambda
this%particlesFraction = particlesFraction

!! Debug information.
!! call ConstantsOfCoupling_show(this)

close(10)
!! Setting defaults
name = "NONE"
kappa = 0
eta = 0
particlesFraction = 1

else
if (stat == -1 ) then

call ConstantsOfCoupling_exception( ERROR, "LOWDIN library not found!! please export lowdinvars.sh file.", "In ConstantsOfCoupling at load function.")
! call ConstantsOfCoupling_exception( WARNING, "Elemental particle: "//trim(symbolSelected)//" NOT found!!", "Setting default values")
this%isInstanced=.false.
exit
end if

end if
read(10,NML=specie, iostat=stat)

if (stat > 0 ) then

call ConstantsOfCoupling_exception( ERROR, "Failed reading ConstantsOfCouplings.lib file!! please check this file.", "In ConstantsOfCoupling at load function.")

end if

end do

!! Set object variables
this%name = name
this%symbol = symbol
this%kappa = kappa
this%eta = eta
this%lambda = lambda
this%particlesFraction = particlesFraction

!! Debug information.
! call ConstantsOfCoupling_show(this)

close(10)

!! Done

end subroutine ConstantsOfCoupling_load
Expand Down
Loading

0 comments on commit 9c10e1a

Please sign in to comment.