dpdata.gaussian package#
Submodules#
dpdata.gaussian.fchk module#
- dpdata.gaussian.fchk.create_full_hessian(hessian_raw: list | ndarray, natoms: int) ndarray[source]#
Reconstructs the full, symmetric Hessian matrix from a 1D array containing its lower triangular elements.
- Args:
- hessian_raw (list | np.ndarray): A 1D list or NumPy array containing the
lower triangular elements (including the diagonal) of the Hessian matrix.
natoms (int): The number of atoms in the system.
- Returns:
- np.ndarray: A full, symmetric (3*natoms, 3*natoms) Hessian matrix.
- Raises:
- ValueError: If the number of elements in hessian_raw does not match
the expected number for the lower triangle of a (3*natoms, 3*natoms) matrix.
- dpdata.gaussian.fchk.to_system_data(file_name: FileType, has_forces=True, has_hessian=True)[source]#
Read Gaussian fchk file.
- Parameters:
- file_namestr
file name
- has_forcesbool, default True
whether to read force Note: Cartesian Gradient in fchk file is converted to forces by taking negative sign
- has_hessianbool, default True
whether to read hessian
- Returns:
- datadict
system data, including hessian if has_hessian is True
dpdata.gaussian.gjf module#
Generate Gaussian input file.
- dpdata.gaussian.gjf.detect_multiplicity(symbols: ndarray) int[source]#
Find the minimal multiplicity of the given molecules.
- Parameters:
- symbolsnp.ndarray
element symbols; virtual elements are not supported
- Returns:
- int
spin multiplicity
- dpdata.gaussian.gjf.make_gaussian_input(sys_data: dict, keywords: str | list[str], multiplicity: str | int = 'auto', charge: int = 0, fragment_guesses: bool = False, basis_set: str | None = None, keywords_high_multiplicity: str | None = None, nproc: int = 1) str[source]#
Make gaussian input file.
- Parameters:
- sys_datadict
system data
- keywordsstr or list[str]
Gaussian keywords, e.g. force b3lyp/6-31g**. If a list, run multiple steps
- multiplicitystr or int, default=auto
spin multiplicity state. It can be a number. If auto, multiplicity will be detected automatically, with the following rules:
- fragment_guesses=True
multiplicity will +1 for each radical, and +2 for each oxygen molecule
- fragment_guesses=False
multiplicity will be 1 or 2, but +2 for each oxygen molecule
- chargeint, default=0
molecule charge. Only used when charge is not provided by the system
- fragment_guessesbool, default=False
initial guess generated from fragment guesses. If True, multiplicity should be auto
- basis_setstr, default=None
custom basis set
- keywords_high_multiplicitystr, default=None
keywords for points with multiple raicals. multiplicity should be auto. If not set, fallback to normal keywords
- nprocint, default=1
Number of CPUs to use
- Returns:
- str
gjf output string