compechem.functions sub-module#

calculate_pka function#

compechem.functions.calculate_pka(protonated, deprotonated)#

Calculates the pKa of a molecule, given the protonated and deprotonated forms assuming that energies have already been computed.

Parameters:
  • protonated (System object) – molecule in the protonated form

  • deprotonated (System object) – molecule in the deprotonated form

Raises:
  • TypeError – Exception raised if either protonated or deprotonated molecules are Ensembles

  • RuntimeError – Exception raised if the difference in number of atoms between protonated and deprotonated species is different from 1 or if a mismatch is detected between electronic levels of theory.

Returns:

pKa – pKa of the molecule.

Return type:

float

auto_calculate_pka function#

compechem.functions.auto_calculate_pka(protonated, method_el, method_vib=None, method_opt=None, ncores=None, maxcore=350)#

Automatically calculates the pKa of a given protonated molecule. The routine computes all the deprotomers of the molecule using CREST, orders the deprotomers according to their energy computed with a user-defined level of theory and calculates the pKa.

Parameters:
  • protonated (System) – The protonated molecule for which the pKa must be computed

  • method_el (Engine) – The computational engine to be used in the electronic level of theory calculations

  • method_vib (Engine (optional)) – The computational engine to be used in the vibronic level of theory calculations. If set to None (default) the pKa will be computed without the vibronic contributions.

  • method_opt (Engine (optional)) – The computational engine to be used in the geometry optimization of the protonated molecule and its deprotomers. If set to None (default) will use xTB gfn2 and the alpb solvent model for water.

  • ncores (int (optional)) – The number of cores to be used in the calculations. If set to None (default) will use the maximun number of available cores.

  • maxcore (int (optional)) – For the engines that supprots it, the memory assigned to each core used in the computation.

Returns:

  • float – pKa of the molecule.

  • System – the structure of the considered deprotomer.


calculate_reduction_potential function#

compechem.functions.calculate_reduction_potential(oxidised, reduced, pH=7.0)#

Calculates the reduction potential of a molecule, given the oxidized and reduced forms assuming that energies have already been computed. The number of electrons exchanged in the process is automatically computed.

Parameters:
  • oxidised (System object) – molecule in the oxidised state

  • reduced (System object) – molecule in the reduced state

  • pH (float) – pH at which the redox potential is evaluated, by default pH=7. This is important in case of a proton-coupled electron transfer (PCET) redox process

Raises:
  • TypeError – Exception raised if either oxidised or reduced molecules are Ensembles

  • RuntimeError – Exception raised if a mismatch is detected between electronic levels of theory.

Returns:

  • float – reduction potential of the molecule.

  • int – number of exchanged electrons

  • int – number of exchanged protons

Return type:

Tuple[float, int, int]

calculate_fukui function#

compechem.functions.calculate_fukui(molecule, engine, spins_states=None, cube_grid=CubeGrids.NORMAL, ncores=None, maxcore=1000)#

Computes the Fukui f+, f- and f0 functions starting from a given input molecule. The functions are saved in Gaussian cube compatible format and stored in the output_densities folder. Localized Fukui functions are also computed from the Mulliken and Hirshfeld charges and saved in the molecule properties. Please notice that the charges in the .fukui.cube produced are replaced by the Mulliken condensed fukui functions.

Parameters:
  • molecule (System) – The System object containing the geometry of the selected molecule (if the geometry has not been optimized, please enable the optimize option)

  • orca (Engine) – The engine object that defines the protocol to be used in the calculation.

  • spin_states (Union[None, List[int]]) – If set to None, when adding or subtracting electrons will automatically switch the spin state from singlet to doublet and vice versa (Maximum one unpaired electrons). If manually set to List[int] will force the spin multeplicities according to the user specified values. The order of the spin multiplicity values is: molecule with one electron added (-1), the molecule as it is (0) and the molecule with one of its electrons removed (+1).

  • cube_grid (Union[CubeGrids, None]) – Resolution for the cube files (default Normal). If set to None the function will avoid the generation of cube files and will only compute condensed fukui values.

  • ncores (int, optional) – The number of cores, by default all available cores (None)

  • maxcore (int) – The maximum amount of memory in MB to be allocated for each core.

  • engine (Union[OrcaInput, XtbInput]) –

  • spins_states (Union[None, List[int]]) –

Return type:

None