/usr/share/psi4/fsapt/fsaptdiff.py is in psi4-data 1:1.1-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | #!/usr/bin/env python
#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2017 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, version 3.
#
# Psi4 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with Psi4; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# @END LICENSE
#
import sys, os
sys.path.append('%s/fsapt' % os.environ['PSIDATADIR'])
from fsapt import *
# => Driver Code <= #
if __name__ == '__main__':
# > Working Dirname < #
if len(sys.argv) == 3:
dirA = sys.argv[1]
dirB = sys.argv[2]
dirD = '.'
elif len(sys.argv) == 4:
dirA = sys.argv[1]
dirB = sys.argv[2]
dirD = sys.argv[3]
else:
raise Exception('Usage: fsapt.py dirnameA dirnameB [dirnameD]')
# Make dirD if needed
if not os.path.exists(dirD):
os.makedirs(dirD)
# > Order-2 Analysis < #
fh = open('%s/fsapt.dat' % dirA, 'w')
fh, sys.stdout = sys.stdout, fh
print(' ==> F-ISAPT: Links by Charge <==\n')
stuffA = computeFsapt(dirA, False)
print(' => Full Analysis <=\n')
printOrder2(stuffA['order2'], stuffA['fragkeys'])
print(' => Reduced Analysis <=\n')
printOrder2(stuffA['order2r'], stuffA['fragkeysr'])
fh, sys.stdout = sys.stdout, fh
fh.close()
fh = open('%s/fsapt.dat' % dirB, 'w')
fh, sys.stdout = sys.stdout, fh
print(' ==> F-ISAPT: Links by Charge <==\n')
stuffB = computeFsapt(dirB, False)
print(' => Full Analysis <=\n')
printOrder2(stuffB['order2'], stuffB['fragkeys'])
print(' => Reduced Analysis <=\n')
printOrder2(stuffB['order2r'], stuffB['fragkeysr'])
fh, sys.stdout = sys.stdout, fh
fh.close()
fh = open('%s/fsapt.dat' % dirD, 'w')
fh, sys.stdout = sys.stdout, fh
print(' ==> F-ISAPT: Links by Charge <==\n')
order2D = diffOrder2(stuffA['order2r'], stuffB['order2r'])
print(' => Reduced Analysis <=\n')
printOrder2(order2D, stuffB['fragkeysr'])
fh, sys.stdout = sys.stdout, fh
fh.close()
fh = open('%s/fsapt.dat' % dirA, 'a')
fh, sys.stdout = sys.stdout, fh
print(' ==> F-ISAPT: Links 50-50 <==\n')
stuffA = computeFsapt(dirA, True)
print(' => Full Analysis <=\n')
printOrder2(stuffA['order2'], stuffA['fragkeys'])
print(' => Reduced Analysis <=\n')
printOrder2(stuffA['order2r'], stuffA['fragkeysr'])
fh, sys.stdout = sys.stdout, fh
fh.close()
fh = open('%s/fsapt.dat' % dirB, 'a')
fh, sys.stdout = sys.stdout, fh
print(' ==> F-ISAPT: Links 50-50 <==\n')
stuffB = computeFsapt(dirB, True)
print(' => Full Analysis <=\n')
printOrder2(stuffB['order2'], stuffB['fragkeys'])
print(' => Reduced Analysis <=\n')
printOrder2(stuffB['order2r'], stuffB['fragkeysr'])
fh, sys.stdout = sys.stdout, fh
fh.close()
fh = open('%s/fsapt.dat' % dirD, 'a')
fh, sys.stdout = sys.stdout, fh
print(' ==> F-ISAPT: Links 50-50 <==\n')
order2D = diffOrder2(stuffA['order2r'], stuffB['order2r'])
print(' => Reduced Analysis <=\n')
printOrder2(order2D, stuffB['fragkeysr'])
fh, sys.stdout = sys.stdout, fh
fh.close()
# > Order-1 PBD Files < #
pdbA = PDB.fromGeom(stuffA['geom'])
printOrder1(dirA, stuffA['order2r'], pdbA, stuffA['frags'])
pdbB = PDB.fromGeom(stuffB['geom'])
printOrder1(dirB, stuffB['order2r'], pdbB, stuffB['frags'])
# Using A geometry
printOrder1(dirD, order2D, pdbA, stuffA['frags'])
|