Skip to content

Commit

Permalink
Merge pull request #128 from sharc-md/sharc3preview
Browse files Browse the repository at this point in the history
Sharc3preview
  • Loading branch information
maisebastian authored Jul 1, 2024
2 parents 3141f68 + 279df91 commit fed71ff
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
35 changes: 29 additions & 6 deletions bin/QMout_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ def main():
parser.add_option('-D', dest='D', action='store_true', help="Diagonalize")
parser.add_option('-S', dest='S', type=int, nargs=1, default=1, help="Initial state (Lowest=1)")
parser.add_option('-t', dest='t', type=int, nargs=1, default=0, help="0 (default): for QM.out containing h,dm; 1: for QM.out containing only h")
parser.add_option('-L', dest='L', action='store_true', help="Format in a single line")

#parser.add_option('-n', dest='n', type=int, nargs=1, default=3, help="Number of geometries to be generated (integer, default=3)")
#parser.add_option('-r', dest='r', type=int, nargs=1, default=16661, help="Seed for the random number generator (integer, default=16661)")
Expand Down Expand Up @@ -331,11 +332,13 @@ def main():
else:
print("Target not defined.")
exit()
sys.stderr.write('%s %i %i %s\n' % (qmoutfile, QMin['nmstates'], QMin['natom'], target_list))
if not options.L:
sys.stderr.write('%s %i %i %s\n' % (qmoutfile, QMin['nmstates'], QMin['natom'], target_list))
QMout = read_QMout(qmoutfile, QMin['nmstates'], QMin['natom'], target_list)

sys.stderr.write('Number of states: %s\n' % (states))
sys.stderr.write('%5s %11s %16s %12s %12s %6s\n' % ('State', 'Label', 'E (E_h)', 'dE (eV)', 'f_osc', 'Spin'))
if not options.L:
sys.stderr.write('Number of states: %s\n' % (states))
sys.stderr.write('%5s %11s %16s %12s %12s %6s\n' % ('State', 'Label', 'E (E_h)', 'dE (eV)', 'f_osc', 'Spin'))

if options.D:
h, dm, U = transform(QMout['h'][0], QMout['dm'], None)
Expand Down Expand Up @@ -379,7 +382,8 @@ def main():
else:
de = (e - energies[0]) * HARTREE_TO_EV
string = '%5i %10s%02i %16.10f %12.8f %12.8f %6.4f' % (istate + 1, IToMult[ist[0]][0], ist[1] - (ist[0] <= 2), e, de, fosc[-1], spin)
print(string)
if not options.L:
print(string)
else:
for istate in range(QMin['nmstates']):
e = QMout['h'][0][istate][istate].real
Expand All @@ -405,8 +409,27 @@ def main():
string = '%5i %10s%02i %16.10f %12.8f %12.8f %6.4f' % (istate + 1, IToMult[m][0], s - (m <= 2), e, de, fosc[-1], m)
if istate == initial:
string += ' #initial state'
print(string)

if not options.L:
print(string)

if options.L:
cwd=os.getcwd().split('/')[-1].split('_')[-1]

string = '%s ' % (cwd)
for i,e in enumerate(energies):
if not options.D:
m, s, ms = QMin['statemap'][i + 1]
if -2 * ms + 1 != m:
continue
string += '%16.10f ' % e
for i,f in enumerate(fosc):
if not options.D:
m, s, ms = QMin['statemap'][i + 1]
if -2 * ms + 1 != m:
continue
string += '%12.8f ' % f
#string += '\n'
print(string)



Expand Down
4 changes: 4 additions & 0 deletions bin/SHARC_MOLCAS.py
Original file line number Diff line number Diff line change
Expand Up @@ -2756,6 +2756,8 @@ def gettasks(QMin):
if not 'init' in QMin:
tasks.append(['rm', 'JOBOLD'])
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if QMin['method']==5 and QMin['pdft-functional'] > -1:
tasks.append(['copy','Do_Rotate.txt',os.path.join(QMin['savedir'],'Do_Rotate.%i.txt' % (imult+1))])
if 'ion' in QMin:
tasks.append(['copy', 'MOLCAS.RasOrb', 'MOLCAS.%i.RasOrb' % (imult + 1)])
if 'molden' in QMin:
Expand Down Expand Up @@ -3173,6 +3175,8 @@ def writeMOLCASinput(tasks, QMin):

elif task[0] == 'alaska':
string += '&ALASKA\n'
if QMin['version'] >= 24.0:
string+='pold\n'
if len(task)==2:
string+='root=%i\n' % (task[1])
elif len(task)==3:
Expand Down
2 changes: 1 addition & 1 deletion bin/setup_traj.py
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ def get_general():
print('Please input one of the following: %s!' % ([i for i in cando]))
INFOS['gradcorrect'] = gct
possible = ('nacdr' in Interfaces[INFOS['interface']]['features'])
if GradCorrect[gct]['name'] == 'ngh' and not possible:
if GradCorrect[gct]['name'] == 'ngt' and not possible:
print('... but interface cannot provide non-adiabatic coupling vectors, turning option off.')
INFOS['gradcorrect'] = 1
else:
Expand Down

0 comments on commit fed71ff

Please sign in to comment.