cspy-reoptimize command

The cspy-reoptimize command can be used to reoptimize crystal structures in a SQLite3 database after running cspy-csp

cspy-reoptimize [-h] [-x XYZ_FILES [XYZ_FILES ...]] [-c CHARGES] [-m MULTIPOLES] [-a AXIS]
                [-p {fit,fit_disponly,fit_reponly,w99,fit_water_X,Day_halobenzenes,w99_orig_Halogens,w99_orig_H,w99rev_6311,w99rev_6311_s,w99rev_631,w99rev_pcm_6311,w99_s_cl,w99sp,w99rev_pcm_6311_and_Chloride,w99rev_pcm_6311_and_Bromide,w99rev_pcm_6311_and_Iodide,w99rev_pcm_6311_and_Halides,isoPAHAP,PAHAP,nothing,gaff2_LJ,gaff2_fit}]
                [--cutoff CUTOFF] [--energy_window ENERGY_WINDOW] [--energy_cap ENERGY_CAP]
                [-r] [-mq] [--smart-optimization] [-ta] [-mi MINIMIZE_INTERVAL]
                [--initial-min-step INITIAL_MIN_STEP] [--write-interval WRITE_INTERVAL]
                [--log-level LOG_LEVEL] [--keep-files] [--skip-header]
                [--status-file STATUS_FILE]
                database_files [database_files ...]

positional arguments

  • database_files - Database files containing crystals for optimization

options

  • -h, --help - show this help message and exit

  • -x XYZ_FILES, --xyz-files XYZ_FILES - Xyz files containing molecules for generation (default: [])

  • -c CHARGES, --charges CHARGES - Rank0 multipole file

  • -m MULTIPOLES, --multipoles MULTIPOLES - RankN multipole file

  • -a AXIS, --axis AXIS - Axis filename for structure minimization

  • -p POTENTIAL, --potential POTENTIAL - intermolecular potential name (default: fit)

  • --cutoff CUTOFF - dmacrys real space/repulsion-dispersion cutoff (default: calculate)

  • --energy_window ENERGY_WINDOW - Energy window from minimum energy of each database to consider for optimization. (default: 1e+50)

  • --energy_cap ENERGY_CAP - Max energy of the structures to consider for optimization (default: 10000000.0)

  • -r, --restart-minimize - Reminimize the structure from generated structure

  • -mq, --minimize-unique - Only minimize the unique structures

  • --smart-optimization -

    This option optimises all structure within a specified energy window. Then it calculates the distribution

    of energy shifts between the initial and optimised structures and calculates the probability that all remaining crystal structures will have new lattice energies that fall within the specified energy window. The remaining crystal structures are optimised sequentially untill a target probability is reach (i.e. We are confident there are no more high energy structures that will re-optimise into the specified energy window

  • -ta, --threshold-algo - minimize an unminimized threshold algorithm database

  • -mi MINIMIZE_INTERVAL, --minimize-interval MINIMIZE_INTERVAL - minimize structures only at given interval (default: 1)

  • --initial-min-step INITIAL_MIN_STEP - initial minimization step (default: 0)

  • --write-interval WRITE_INTERVAL - Database writing interval. (default: 0.5)

  • --log-level LOG_LEVEL - Log level (default: INFO)

  • --keep-files - Keep DMACRYS and NEIGHCRYS files which, for each structure, are stored in a new directory in the pwd.

  • --skip-header - Skip the mol-CSPy header at the start of the job.

  • --status-file STATUS_FILE - Specify output status file (default: status.txt)

Note

The source code for the command does not exist in the cspy.apps module. It can be located in the cspy.distributed module.

The current implementation of the cspy-reoptimize command allows the user to reoptimize the crystal structures in the SQL database using DMACRYS, PMIN and dftb+.

In a similar fashion to the cspy-csp command, re-optimization steps can be specified by using a cspy.toml file as follows:

[[csp_minimization_step]]
kind = "dmacrys"
electrostatics = "multipoles"

Similarly, if we wanted to run a dftb+ calculation:

[[csp_minimization_step]]
kind = "dftb"

[dftb]
max_steps = 2500
max_force = 0.00058
kpoint_spacing = 0.05
scc_tol = 1e-5
timeout = 3600
single_point = false          # Bool to control whether we run a single-point energy calculation
atomic_pos_opt = true         # Bool to control whether we run a geometry optimisation on the atomic positions
lattice_and_atoms_opt = false # Bool to control whether we run a geometry optimisation on the atomic positions and lattice parameters

Please note that there are a number of different keywords that can be specified under the [dftb] header. The defaults for these can be found in cspy/configuration.py

Note

As of V1.1, The cspy-reoptimize command no longer expects the same inputs as the cspy-csp command. i.e. the user does not need to specify an axis file, xyz files, dmacrys charges file and a dmacrys multipoles file if they are running a dftb calculation. For more information, please see the worked example below.

Example Usage

Please consult the following link to the acetic acid worked example - Step 6: Reoptimize the final crystal structures (optional).