Crystal Optimiser API

Introduction

crystal_optimiser.py - an API for crystal structure optimisation.

The main class is ccdc.csp.crystal_optimiser.CrystalOptimiser

Simplest operation is:

>>> from ccdc import io
>>> from ccdc.csp.crystal_optimiser import CrystalOptimiser
>>> csd = io.EntryReader('csd')
>>> crystal = csd.entry('HXACAN').crystal
>>> optimiser = CrystalOptimiser()
>>> optimisation_results = optimiser.optimise(crystal)
>>> optimised_crystal = optimisation_results.optimised_crystal
>>> final_score = optimisation_results.final_score

CrystalOptimiser can also be used to directly score a crystal structure based on the current settings:

>>> score = optimiser.score(crystal)

API

class ccdc.csp.crystal_optimiser.CrystalOptimiser(settings=None)[source]
class Results(results, crystal, original_crystal, optimised_crystal, optimised_name, starting_score, final_score, n_steps)[source]

Holds the results of a CrystalOptimiser calculation.

property final_score

The score of the optimised crystal structure.

property n_steps

The number of steps taken during optimisation.

property optimised_crystal

The optimised crystal structure.

property optimised_name

The name assigned to the optimised structure.

property original_crystal

The original crystal structure used for the optimisation.

property starting_score

The score of the starting crystal structure.

class Settings(_settings=None)[source]

Settings pertaining to the optimiser.

property cell_limit

The maximum % volume change allowed for the unit cell.

property convergence_tolerance

The convergence tolerance for optimisation.

property force_field

The force field choices for optimisation, including: “CLP”, “CSD-OPCS16”, “Dreiding II”, “Momany”, “Gavezzotti”.

property limiting_radius

The limiting radius for optimisation.

property normalise_hydrogens

If hydrogens are to be normalised before optimisation.

property optimise_cell

If unit cell parameters are allowed to change during optimisation.

property optimise_molecule

The choices for molecule optimisation: “Position” or “Geometry”.

property output_format

The file format for the output optimised crystal, one of ‘cif’ or ‘mol2’.

property working_dir

The directory to save the optimised structure file and log file.

minimiser_settings(crystal)[source]

Return the minimiser settings for the optimiser.

optimise(crystal)[source]

Optimise the crystal based on the current settings.

Returns:

A ccdc.csp.crystal_optimiser.CrystalOptimiser.Results instance.

score(crystal)[source]

Score the crystal based on the current settings.