Skip to content

Instantly share code, notes, and snippets.

View hokru's full-sized avatar
💩

Holger Kruse hokru

💩
View GitHub Profile
@hokru
hokru / manual_b3lyp_dict.in
Created June 30, 2021 07:42
psi4 dft dictionary for B3LYP
molecule h2o {
0 1
O
H 1 1.0
H 1 1.0 2 104.5
}
set {
basis cc-pVDZ
}
@hokru
hokru / fchk_tester.py
Created August 7, 2020 12:01
tool to generate psi4 fchk files for many methods
# test FCHK file format
import numpy as np
import psi4
import re
from ast import literal_eval
import sys
flag=''
#
def get_normalmodes_orca (hessfile):
"""This script reads a .hess file from an ORCA frequency calculation and generates
a molden-readable file containing the normal modes"""
# AndersB ORCA Forum
# get the jobname (without extension). Assumes only one "." is used in the
# filename
jobname = hessfile.split(".")[0]
with open(hessfile, "r") as infile:
inlines = infile.readlines()
@hokru
hokru / density.py
Created May 30, 2020 22:06
plotting real space density
import psi4
import numpy as np
# from qcdb
def INT_NCART(am):
"""Gives the number of cartesian functions for an angular momentum.
#define INT_NCART(am) ((am>=0) ? ((((am)+2)*((am)+1))>>1) : 0)
"""
return (((abs(am) + 2) * (abs(am) + 1)) >> 1)
@hokru
hokru / transpose.cpp
Created May 19, 2020 12:14
test program for gg's transpose function
#include <random>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <functional>
#include <ctime>
#define ALIGNED_MALLOC(alignment, size) _mm_malloc(size, alignment)
#define ALIGNED_FREE(ptr) _mm_free(ptr)
@hokru
hokru / libxc4.3.4 density cutoff list
Last active April 20, 2020 16:18
LibXC 4.3.4 density cutoffs
XC_GGA_X_HJS_B88_V2 1e-06
XC_GGA_X_GG99 5e-07
XC_GGA_X_KGG99 5e-07
XC_MGGA_X_MBEEF 5e-07
XC_GGA_X_HJS_B88 1e-07
XC_GGA_X_ITYH 1e-08
XC_GGA_X_LCGAU 1e-08
XC_GGA_X_LCGAU_CORE 1e-08
XC_GGA_X_LC2GAU 1e-08
XC_LDA_C_2D_AMGB 1e-09
@hokru
hokru / delta.py
Created June 6, 2019 07:12
interaction energy just from the delta correction
#!/usr/bin/python
import sys
fin=sys.argv[1]
f=open(fin,'r')
e=[]
ecp=0
print " ** delta[CC-MP2] ** "
for l in f.readlines():
if 'delta ccsd(t) - mp2' in l:
@hokru
hokru / mb16_35.in
Created May 24, 2019 09:18
psi4 input to run reaction energy calculation for molecule 35 of the MB16-43 benchmark set
molecule H2 {
H 0.0000000 0.0000000 -0.3717625
H 0.0000000 0.0000000 0.3717625
}
molecule LIH {
Li 0.0000000 0.0000000 -0.7979820
H 0.0000000 0.0000000 0.7979820
}
@hokru
hokru / cube_el.py
Created October 25, 2018 14:28
integrates density from a cube file (usually not a good idea!)
#!/usr/bin/env python
import sys
import numpy as np
cubefile = sys.argv[1]
f = open(cubefile, 'r')
line = f.next()
line = f.next()
line = f.next()
@hokru
hokru / fmo.in
Last active April 25, 2018 07:36
fragment MO guess for PSI4
# C1/RHF example of a fragment MO guess for the water dimer
#
molecule wat {
symmetry c1
no_reorient
O -1.769142 -0.076181 -0.000000
H -2.065745 0.837492 0.000000
H -0.809034 0.001317 -0.000000
--