Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions interfaces/OPENQP-LZ/openqp.inp.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[input]
system=geom.dat.001
charge=0
runtype=grad
basis=6-31+g*
functional=CAM-B3LYP
method=tdhf

[guess]
type=huckel
save_mol=True

[scf]
multiplicity=3
type=rohf
maxit=300
maxdiis=6
conv=1e-6
init_scf=rohf
init_it=50
init_converger=0
vshift=0.0
mom=False
mom_switch=0.003
soscf_type=0
pfon=True
pfon_start_temp=2000
pfon_cooling_rate=50
pfon_nsmear=5

[tdhf]
type=mrsf
nstate=4

[properties]
grad=2
export=True

71 changes: 71 additions & 0 deletions interfaces/OPENQP-LZ/r.openqp-lz
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/bash

# OPEN-QP/Landau-Zener Surface Hopping Interface for ABIN
# Created by K. Vosovicova, J. Janos
# Set parameters in 'openqp.inp.template' file

cd OPENQP-LZ

# ------------------ LOADING VARIABLES ---------------------

timestep=$1
ibead=$2
input=input$ibead.inp
geom=geom.dat.$ibead
natom=$(wc -l < ../$geom)
output=input$ibead.log
template=openqp.inp.template

sed "1i ${natom}\n" "../$geom" > $geom
rm -f ../engrad.dat.$ibead

# -------------- DETERMINING CURRENT STATE -----------------

# Reading from state.dat
# Number of states and state we are on
read -t 2 -a nstate
read -t 2 -a tocalc
read -t 1 -a nsinglet # or doublet, just multiplicity of ground state
read -t 1 -a ntriplet # (not used)


# ---------------------- OPENQP INPUT ------------------------

cp $template $input

if [[ $timestep -ne 0 ]]; then
sed -i '/^\[guess\]/,/^\[scf\]/c\
[guess]\
type=json\
file=input001.json\
\
[scf]' "$input"
fi

sed -i "/^\[tdhf\]/,/^\[/ s/^nstate=.*/nstate=$nstate/" "$input"

sed -i "/^\[properties\]/,/^\[/ s/^grad=.*/grad=$tocalc/" "$input"

# ---------------------- JOB LAUNCH ------------------------

source SetEnvironment.sh OPENQ

$OPENQPEXE $input &> output_file


# --------------------- ERROR CHECK ------------------------

if [[ $? -ne 0 ]] || ! grep -q "SCF convergence achieved" "$output"; then
echo "ERROR from r.openqp: OPENQP calculation probably failed."
echo "See $output.error"
cp $output $output.error
exit 2
fi

# ------------------- DATA EXTRACTION ----------------------


tail -n $nstate energies >> ../engrad.dat.$ibead
cat grad_$tocalc >> ../engrad.dat.$ibead


Loading