inputht
Generates a gaussian input files from the last geometry of gaussian output files or from the geometry of gaussian input files or a .xyz file using a Header and/or Tail Files which contain everything but the geometry and spin/charge ( which must be provided for .xyz files)
usage: pyssianutils inputht [-h] [-l] [-m MARKER | --no-marker] [-o OUTDIR]
[--step STEP] [-H HEADER] [-T TAIL]
[--charge CHARGE] [--spin SPIN] [--suffix SUFFIX]
files [files ...]
Positional Arguments
- files
Gaussian Input/Output Files
Named Arguments
- -l, --listfile
- When enabled instead of considering the files
provided as the gaussian output files considers the file provided as a list of gaussian output files
Default:
False
- -m, --marker
- Text added to the filename to differentiate
the original file from the newly created one. For example, myfile.com may become myfile_marker.com
Default:
'new'
- --no-marker
The file stems are kept
Default:
False
- -o, --outdir
- Where to create the new files, defaults to the
current directory
Default:
''
- --step
- Will attempt to access the ith optimization step of
a gaussian output file to extract its geometry on all files provided. 'initial geometry'='1'
- -H, --header
- Header File that contains the queue, memory as well
as the gaussian calculation instructions. The output will start at the charge-spin line
- -T, --tail
- Tail File that contains the extra options, such as
pseudopotentials, basis sets
- --charge
Net charge of the whole system
Default:
0
- --spin
spin of the system
Default:
1
- --suffix
Input suffix used for gaussian files, e.g. ".com"
Default:
'.com'
Usage
The util inputht
comes from Input from Head and Tail were both,
head and tail refer to the top and bottom of a file. In general, in gaussian
input files the geometry is placed in the middle of the file, where the actual
calculation requested is in the top of the file and some extra input is placed
at the bottom of the file. Thus, normally we find similar file headers for all
optimizations to minima, optimizations to ts, single points... and the same
for the file tails. inputht
works on the basis of having stored two
files, one with the header and one with the tail, and generating a gaussian
input file from those.
Lets say we have the files:
%nprocshared=2
%mem=4GB
#p opt freq pbepbe genecp nosymm
-C -O -N -H 0
6-31+g(d,p)
****
This type of setup allows the modification of the basis set with relative ease, and will not lead to an error if one of the atom types specified in the basis set section is missing.
We can now create a gaussian input by providing files containing geometries.
For example, if we use gaussview, we can draw a specific geometry, check the
charge and spin and save the file as example1.gjf
without any specifics
of the calculation. To generate the gaussian with the actual theory and keywords
that we have selected:
$ pyssianutils inputht example1.gjf -H minima.head -T basis.tail --no-marker --suffix .com
example1.gjf
This command will generate a file named example1.com
which will contain
the charge, spin and geometry of example1.gjf
, it will start with the
contents of minima.head
and it will end with the contents of
basis.tail
. If the --no-marker
is not used, the generated file
will have a "marker" in the file name. With the default marker the name would
have been example1_new.com
. The --suffix
flag is not necessary
in this specific case (as its default value is ".com") but controls the suffix
of the generated files.
We can also specify multiple files instead of a single one:
$ pyssianutils inputht example*.gjf -H minima.head -T basis.tail --no-marker --suffix .com
example1.gjf
example2.gjf
example3.gjf
[...]
We may instead be interested in re-using a previous gaussian optimization for different reasons. We just need to provide the files.
$ pyssianutils inputht example*.log -H minima.head -T basis.tail --marker run2
example1.log
example2.log
example3.log
[...]
Here we specified --marker run2
to avoid overwriting the input files of
the already existing input files from the outputs that we provided. By default
the last geometry of the optimization will be used, and the charge and spin
used in the calculation will be considered.
If we want to generate an input from a geometry that is not the last one of the
calculation we can also do it with the --step
keyword.
$ pyssianutils inputht example1.log -H minima.head -T basis.tail --step 10 --marker step10
example1.log
We can force a specific value of charge and spin by specifying the
--charge
and --spin
flags:
$ pyssianutils inputht example1.gjf -H minima.head -T basis.tail --charge 0 --spin 1
example1.gjf
Attention
note that charge-spin consistency is not checked at this stage, so if you specified a wrong combination, the gaussian calculation will error out almost instantly.
Finally, if we generated the geometries with a different software, we can also use .xyz files.
$ pyssianutils inputht example1.xyz -H minima.head -T basis.tail --charge 0 --spin 1
example1.xyz
Note
However note that the --charge
and --spin
flags
become specially relevant for .xyz files. Otherwise the default values will
be used.
Two final remarks to consider is that if we want to provide a file listing all
the files with the geometries that we want to use, we can simply use the
--listfile
flag and use the file with the list as input. The second
remark is that we can mix the different types of file containing a geometry
within the same command. In other words:
$ pyssianutils inputht example1.com example2.log example3.xyz -H minima.head -T basis.tail
example1.com
example2.log
example3.xyz
This command will yield correct inputs, but note that example3.xyz will have the
default charge and spin, and specifying the --charge
and --spin
would instead force them into example1.com and example2.log.