-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from efposadac/48-basis-set-from-the-input
Modified the lowdin bash script to generate basis files in demon2k fo…
- Loading branch information
Showing
3 changed files
with
223 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
|
||
GEOMETRY | ||
e-[H] cc-pvtz 0.0000 0.0000 0.00000 | ||
e-[H] CUSTOM_1 0.0000 0.0000 0.74144 | ||
H_1 CUSTOM_2 0.0000 0.0000 0.00000 | ||
U- CUSTOM_3 0.0000 0.0000 0.74144 | ||
He_4 CUSTOM_3 0.0000 0.0000 0.74144 | ||
END GEOMETRY | ||
|
||
TASKS | ||
method = "RHF" | ||
END TASKS | ||
|
||
CONTROL | ||
readCoefficients=F | ||
removeTranslationalContamination=T | ||
END CONTROL | ||
|
||
BASIS CUSTOM_1 | ||
O-HYDROGEN H (CC-PVTZ+LOCAL) BASIS TYPE: 1 | ||
# | ||
9 | ||
1 0 1 | ||
103.8700000 1.00000000 | ||
2 0 1 | ||
33.8700000 1.00000000 | ||
3 0 1 | ||
5.09500000 1.00000000 | ||
4 0 1 | ||
1.15900000 1.00000000 | ||
5 0 1 | ||
0.32580000 1.00000000 | ||
6 0 1 | ||
0.10270000 1.00000000 | ||
7 1 1 | ||
1.40700000 1.00000000 | ||
8 1 1 | ||
0.38800000 1.00000000 | ||
9 2 1 | ||
1.05700000 1.00000000 | ||
END BASIS | ||
|
||
BASIS CUSTOM_2 | ||
O-HYDROGEN H_1 (3S2P1D) BASIS TYPE: 2 | ||
# | ||
6 | ||
1 0 1 | ||
10.1 1.0 | ||
2 0 1 | ||
14.5 1.0 | ||
3 0 1 | ||
20.5 1.0 | ||
4 1 1 | ||
6.9 1.0 | ||
5 1 1 | ||
13.8 1.0 | ||
6 2 1 | ||
9.0 1.0 | ||
END BASIS | ||
|
||
BASIS CUSTOM_3 | ||
O-HE_4 HE_4 (9S) BASIS TYPE: 2 | ||
# (1S)-[1S] | ||
9 | ||
1 0 1 | ||
16729.31181641 1.00000000 | ||
2 0 1 | ||
36042.20971709 1.00000000 | ||
3 0 1 | ||
77650.58691876 1.00000000 | ||
4 0 1 | ||
167293.11815664 1.00000000 | ||
5 0 1 | ||
360422.09715492 1.00000000 | ||
6 0 1 | ||
776505.86915312 1.00000000 | ||
7 0 1 | ||
1672931.18149208 1.00000000 | ||
8 0 1 | ||
3604220.97138922 1.00000000 | ||
9 0 1 | ||
7765058.69118643 1.00000000 | ||
|
||
O-U- U- (9S) BASIS TYPE: 2 | ||
# (1S)-[1S] | ||
9 | ||
1 0 1 | ||
470.63607188 1.00000000 | ||
2 0 1 | ||
1013.95467961 1.00000000 | ||
3 0 1 | ||
2184.49913585 1.00000000 | ||
4 0 1 | ||
4706.36071854 1.00000000 | ||
5 0 1 | ||
10139.54679568 1.00000000 | ||
6 0 1 | ||
21844.99135749 1.00000000 | ||
7 0 1 | ||
47063.60718332 1.00000000 | ||
8 0 1 | ||
101395.46795228 1.00000000 | ||
9 0 1 | ||
218449.91356518 1.00000000 | ||
END BASIS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#!/usr/bin/env python | ||
from __future__ import print_function | ||
import os | ||
import sys | ||
from colorstring import * | ||
|
||
if len(sys.argv)==2: | ||
lowdinbin = sys.argv[1] | ||
else: | ||
lowdinbin = "lowdin2" | ||
|
||
testName = sys.argv[0][:-3] | ||
inputName = testName + ".lowdin" | ||
outputName = testName + ".out" | ||
# Reference values and tolerance | ||
|
||
refValues = { | ||
"HF energy" : [-343.383191892820,1E-8], | ||
"U-HOMO" : [-371.890049816287,1E-1], | ||
"H_1-HOMO" : [-1.019360160964,1E-4], | ||
"He_4-HOMO" : [-652.366876763392,1E-1], | ||
"e-HOMO" : [-0.585414450602,1E-4], | ||
} | ||
|
||
testValues = dict(refValues) #copy | ||
for value in testValues: #reset | ||
testValues[value] = 0 #reset | ||
|
||
# Run calculation | ||
|
||
status = os.system(lowdinbin + " -i " + inputName) | ||
|
||
if status: | ||
print(testName + str_red(" ... NOT OK")) | ||
sys.exit(1) | ||
|
||
output = open(outputName, "r") | ||
outputRead = output.readlines() | ||
|
||
# Values | ||
checkArray=[0,0,0,0] | ||
for i in range(0,len(outputRead)): | ||
line = outputRead[i] | ||
if "TOTAL ENERGY =" in line: | ||
testValues["HF energy"] = float(line.split()[3]) | ||
if "Eigenvalues for:" in line: | ||
species=line.split()[2] | ||
if species == "E-": | ||
checkArray[0]=1 | ||
elif species == "H_1": | ||
checkArray[1]=1 | ||
elif species == "MUON": | ||
checkArray[2]=1 | ||
elif species == "HE_4": | ||
checkArray[3]=1 | ||
|
||
if "1 " in line and checkArray[0]==1: | ||
checkArray[0]=0 | ||
testValues["e-HOMO"] = float(line.split()[1]) | ||
if "1 " in line and checkArray[1]==1: | ||
checkArray[1]=0 | ||
testValues["H_1-HOMO"] = float(line.split()[1]) | ||
if "1 " in line and checkArray[2]==1: | ||
checkArray[2]=0 | ||
testValues["U-HOMO"] = float(line.split()[1]) | ||
if "1 " in line and checkArray[3]==1: | ||
checkArray[3]=0 | ||
testValues["He_4-HOMO"] = float(line.split()[1]) | ||
|
||
|
||
output.close() | ||
|
||
passTest = True | ||
|
||
for value in refValues: | ||
diffValue = abs(refValues[value][0] - testValues[value]) | ||
if ( diffValue <= refValues[value][1] ): | ||
passTest = passTest * True | ||
else : | ||
passTest = passTest * False | ||
print("%s %.8f %.8f %.2e" % ( value, refValues[value][0], testValues[value], diffValue)) | ||
|
||
if passTest : | ||
print(testName + str_green(" ... OK")) | ||
else: | ||
print(testName + str_red(" ... NOT OK")) | ||
sys.exit(1) | ||
|