sith.g09_stretching.from_extreme package

Submodules

sith.g09_stretching.from_extreme.info_from_opt.continuous_e2e(pattern, index1, index2, dir_output='e2e_continuous')[source]

From a set of configurations in xyz files with pattern <all><pattern><all>.xyz, it guarantees that consecutive changes in the distance between the atoms with index1 and index2 are lower than 0.2A.

Parameters:
  • pattern (str) – pattern of the input files. All the files with <all><pattern><all>.xyz will be read.

  • index1 (int) – index of the first atom to align in the x axis. 1-base indexing.

  • index2 (int) – index of the second atom to align in the x axis. 1-base indexing.

  • dir_output (str. Default='e2e_continuous') – directory where to save the output files.

Returns:

  • (ase.Atoms) new trajectory with continuous distance between index1 and

  • index2. It creates the xyz files in dir_output.

sith.g09_stretching.from_extreme.info_from_opt.delta_angles_continuous(d_ij, nrs)[source]

Make the difference of the angles continuous considering the periodicity of them.

Parameters:
  • d_ij (numpy.Array) – set of delta dofs with form [structure][DOF]

  • nrs (int) – Number of distances.

Return type:

(numpy.Array) new set of delta DOFs with delta angles continuous.

Note

Here, it is assumed that the first <nrs> DOFs in d_ij are distances and the rest are angles.

sith.g09_stretching.from_extreme.info_from_opt.info_from_opt(logfile, pattern)[source]

Extracts configurations from a gaussian optimization trajectory and removes the structures that are outliers in the total energy.

Parameters:
  • logfile (str) – gaussian log file.

  • pattern (str) – pattern of the output. The results are xyz files called <pattern><i>.xyz

Returns:

  • (ase.Atoms) new trajectory without the outliers. It creates the xyz files

  • in between.

Note

You can use sith.g09_stretching.from_extreme.info_from_opt.reduce_struct() to make the DOFs of output trajectory continuous.

sith.g09_stretching.from_extreme.info_from_opt.reduce_structs(dir, pattern, print_reduced=False)[source]

Check all the <all>-dofs.dat files and remove those files that represent irrelevant changes. It creates intermedias to guarantee continuous dofs.

Parameters:
  • dir (str) – path to the directory containing all the <all>-dofs.dat files.

  • pattern (str) – pattern for the output files, all of them will be then <pattern><i>.dat

Returns:

  • (numpy.array) new set of DOFs [structure][DOF], which are reduced. In

  • between, it also creates all <pattern><i>,dat.

Module contents

continuous_path

[script] sith/g09_stretching/from_extreme/continuous_path.sh

Creates the com files from the a set of xyz structures, and submit the jobs
with :bashscript: (-S here
refers to these subjobs)

-c Use this flag to run in a cluster. When -p is not defined, and you run in
a slurm job manager system, the number of processors is equal to the
number of cores asked in the submission of the job.
-i <index1,index2> indexes of the atoms used for constraining the distance
of the intermedia structures when optimizing. If this flag is not used
and a pdb is given through flag ‘-t’, indexes 1 and 2 will correspond to
the CH3 atoms in ACE and NME residues defined in the pdb if they exist.
-l <xc,base=”bmk,6-31+g”> level of DFT theory.
-n <name> this script will collect all the <name>.xyz files sorted in
alphabetic order as initial path. If this is a directory, this script
will create a subdirectory there called ‘conopt’ and copy the
<name>.xyz files to that subdirectory first.
-p <processors=1> number of processors per gaussian job. See description of
flag -c.
-S <job_options=’’> options for submitting a new job. This flag only makes
sense in slurm cluster. Please, do not include a name (-J), nor the
number of cores (-n, use -p for this). The input should be as in the next
example: "–partition=cpu –nice".
-t <template.pdb> pdb file used to read the indexes if -i is not
used.

-v verbose
-h prints this message.

workflow_from_extreme

[script] sith/g09_stretching/from_extreme/workflow_from_extreme.sh

This tool creates the files to do the sith analysis by optimizing a molecule,
then takes the intermedia steps and prepares a constrained optimization of each
one of them with :bashscript:
after creating intermedias states that guarantee continuity in the degrees of
freedom. This script submits in parallel each one of those optimizations with
:bashscript: (-S here refers
to these subjobs).

-a <alias> new name of the xyz file and subsequent files in directory
‘from_extreme’.
-c Use this flag to run in a cluster. When -p is not defined, and you run in
a slurm job manager system, the number of processors is equal to the
number of cores asked in the submission of the job.
-i <index1,index2> indexes of the atoms used for constraining the distance
of the intermedia structures when optimizing. If this flag is not used
but a pdb file is given (-t), indexes 1 and 2 will correspond to the CH3
atoms in ACE and NME residues defined in the pdb if they exist.
-l <xc,base=”bmk,6-31+g”> level of DFT theory.
-m <molecule> directory or coordinates file of configuration to be relaxed.
For example, "./AAA/" a trialanine configuration (‘last’ after
organizing all xyz files alphabetically all AAA*.xyz files in ./AAA/).
-p <processors=1> number of processors per gaussian job. See description of
flag -c.
-r Use it to restart, in which case no directory will be created and the new
<molecule>-optext.log is assumed to exist in the working directory.
-S <job_options=’’> options for submitting a new job. This flag only makes
sense in slurm cluster. Please, do not include a name (-J), nor the
number of cores (-n, use -p for this). The input should be as in the next
example: "–partition=cpu –nice".
-t <template.pdb> template pdb file to define indexes if -i is not used.

-v verbose.
-h prints this message.

Note
—-

The outputs are stored in a directory called ‘from_extreme’/

This tool requires gaussian and sklearn.

opt_and_forces

[script] sith/g09_stretching/from_extreme/opt_and_forces.sh

This code submits a gaussian job (typically an optimization) and uses the
output to compute the forces.

-c Use this flag to run in a cluster. When -p is not defined, and you run in
a slurm job manager system, the number of processors is equal to the
number of cores asked in the submission of the job.
-f <com file> name of the gaussian input file without extension (.com). The
output is has the same name, but .log extension.
-F use this flag fo AVIOD force calculation after optimization.
-p <processors=1> number of processors per gaussian job. See description of
flag -c.
-P <pattern=’conopt’> pattern to be replaced by ‘forces’ in the name of the
output files of the optimization when submitting the forces.
-S <job_options=’’> options for submitting a new job. This flag only makes
sense in slurm cluster. Please, do not include a name and add the options
as in the next example: “–partition=cpu –nice”.
-r if the optimization did not converge, restart it from the last
geometry.

-v verbose.
-h prints this message.

extr_dofs

[script] sith/g09_stretching/from_extreme/extr_dofs.sh

This tool extract the dofs of a set of xyz files using the gaussian tool
‘newzmat’. The ouput are files called <xyz file with pattern>-dofs.dat, where
pattern comes from -f flag.

-f <xyz files pattern>. The code will look for <pattern>.xyz

-h prints this message.