10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-19 04:22:32 +01:00

updated bin

This commit is contained in:
Kevin Gasperich 2022-06-22 18:09:17 -05:00
parent cf097f11a9
commit 2ba43e6b6c
6 changed files with 91 additions and 12 deletions

View File

@ -121,6 +121,7 @@ def write_ezfio(res, filename):
exponent = []
res.convert_to_cartesian()
# ~#~#~#~#~#~#~ #
# P a r s i n g #
# ~#~#~#~#~#~#~ #
@ -178,6 +179,72 @@ def write_ezfio(res, filename):
print("OK")
# _
# |_) _. _ o _
# |_) (_| _> | _>
#
print("Basis\t\t...\t", end=' ')
# ~#~#~#~ #
# I n i t #
# ~#~#~#~ #
coefficient = []
exponent = []
# ~#~#~#~#~#~#~ #
# P a r s i n g #
# ~#~#~#~#~#~#~ #
inucl = {}
for i, a in enumerate(res.geometry):
inucl[a.coord] = i
nbasis = 0
nucl_index = []
curr_center = -1
nucl_shell_num = []
ang_mom = []
nshell = 0
nshell_tot = 0
shell_index = []
shell_prim_num = []
for b in res.basis:
s = b.sym
if str.count(s, "y") + str.count(s, "x") == 0:
c = inucl[b.center]
nshell += 1
nshell_tot += 1
if c != curr_center:
curr_center = c
nucl_shell_num.append(nshell)
nshell = 0
nbasis += 1
nucl_index.append(c+1)
coefficient += b.coef[:len(b.prim)]
exponent += [p.expo for p in b.prim]
ang_mom.append(str.count(s, "z"))
shell_prim_num.append(len(b.prim))
shell_index += [nshell_tot+1] * len(b.prim)
# ~#~#~#~#~ #
# W r i t e #
# ~#~#~#~#~ #
ezfio.set_basis_basis("Read from ResultsFile")
ezfio.set_basis_shell_num(len(ang_mom))
ezfio.set_basis_basis_nucleus_index(nucl_index)
ezfio.set_basis_prim_num(len(coefficient))
ezfio.set_basis_nucleus_shell_num(nucl_shell_num)
ezfio.set_basis_prim_coef(coefficient)
ezfio.set_basis_prim_expo(exponent)
ezfio.set_basis_shell_ang_mom(ang_mom)
ezfio.set_basis_shell_prim_num(shell_prim_num)
ezfio.set_basis_shell_index(shell_index)
print("OK")
# _
# |\/| _ _ |_) _. _ o _
# | | (_) _> |_) (_| _> | _>
@ -227,12 +294,17 @@ def write_ezfio(res, filename):
for i in range(mo_num):
energies.append(MOs[i].eigenvalue)
OccNum = []
if res.occ_num is not None:
OccNum = []
for i in MOindices:
OccNum.append(res.occ_num[MO_type][i])
else:
for i in range(res.num_beta):
OccNum.append(2.)
for i in range(res.num_beta,res.num_alpha):
OccNum.append(1.)
while len(OccNum) < mo_num:
while len(OccNum) < mo_num:
OccNum.append(0.)
MoMatrix = []
@ -255,8 +327,9 @@ def write_ezfio(res, filename):
# ~#~#~#~#~ #
ezfio.set_mo_basis_mo_num(mo_num)
ezfio.set_mo_basis_mo_occ(OccNum)
ezfio.set_mo_basis_mo_coef(MoMatrix)
ezfio.set_mo_basis_mo_occ(OccNum)
print("OK")
@ -317,8 +390,6 @@ def write_ezfio(res, filename):
n_beta = res.num_beta
for i in range(nucl_num):
charge[i] -= nucl_charge_remove[i]
n_alpha -= nucl_charge_remove[i]/2
n_beta -= nucl_charge_remove[i]/2
ezfio.set_nuclei_nucl_charge(charge)
ezfio.set_electrons_elec_alpha_num(n_alpha)
ezfio.set_electrons_elec_beta_num(n_beta)

View File

@ -99,7 +99,9 @@ function find_libs () {
}
function find_exec () {
find ${QP_ROOT}/$1 -perm /u+x -type f
for i in $@ ; do
find ${QP_ROOT}/$i -perm /u+x -type f
done
}
@ -119,7 +121,7 @@ fi
echo "Copying binary files"
# --------------------
FORTRAN_EXEC=$(find_exec src)
FORTRAN_EXEC=$(find_exec src/*/)
if [[ -z $FORTRAN_EXEC ]] ; then
error 'No Fortran binaries found.'
exit 1

View File

@ -30,7 +30,7 @@ try:
from docopt import docopt
from qp_path import QP_SRC, QP_ROOT
except ImportError:
print("source .quantum_package.rc")
print("source quantum_package.rc")
raise

View File

@ -6,6 +6,7 @@ Usage:
qp_plugins download <url> [-n <name>]
qp_plugins install <name>...
qp_plugins uninstall <name>
qp_plugins remove <name>
qp_plugins update [-r <repo>]
qp_plugins create -n <name> [-r <repo>] [<needed_modules>...]
@ -24,6 +25,8 @@ Options:
uninstall Uninstall a plugin
remove Uninstall a plugin
update Update the repository
create
@ -274,7 +277,7 @@ def main(arguments):
subprocess.check_call(["qp_create_ninja", "update"])
print("[ OK ]")
elif arguments["uninstall"]:
elif arguments["uninstall"] or arguments["remove"]:
m_instance = ModuleHandler([QP_SRC])
d_descendant = m_instance.dict_descendant

View File

@ -7,12 +7,13 @@ setting all MOs as Active, except the n/2 first ones which are set as Core.
If pseudo-potentials are used, all the MOs are set as Active.
Usage:
qp_set_frozen_core [-q|--query] [(-l|-s|--large|--small)] EZFIO_DIR
qp_set_frozen_core [-q|--query] [(-l|-s|-u|--large|--small|--unset)] EZFIO_DIR
Options:
-q --query Prints in the standard output the number of frozen MOs
-l --large Use a small core
-s --small Use a large core
-u --unset Unset frozen core
Default numbers of frozen electrons:
@ -49,7 +50,7 @@ import os.path
try:
import qp_path
except ImportError:
print("source .quantum_package.rc")
print("source quantum_package.rc")
raise
from docopt import docopt
@ -88,7 +89,9 @@ def main(arguments):
elif charge <= 54: n_frozen += 9
elif charge <= 86: n_frozen += 18
elif charge <= 118: n_frozen += 27
elif arguments["--unset"]:
n_frozen = 0
else: # default
for charge in ezfio.nuclei_nucl_charge:
if charge <= 4: pass

View File

@ -23,7 +23,7 @@ import os.path
try:
import qp_path
except ImportError:
print("source .quantum_package.rc")
print("source quantum_package.rc")
raise
from docopt import docopt