pymatgen.io.qchem module

class QcInput(jobs)[source]

Bases: monty.json.MSONable

An object representing a multiple step QChem input file.

Parameters:jobs – The QChem jobs (List of QcInput object)
as_dict()[source]
classmethod from_dict(d)[source]
classmethod from_file(filename)[source]
classmethod from_string(contents)[source]
write_file(filename)[source]
class QcNucVeloc(filename)[source]

Bases: object

class to QChem AMID NucVeloc file.

Args:
filename (str): Filename to parse
time_steps(fs)
The AIMD time stamp for each frame
velocities(a.u.)
The atom velocities for each frame. Format:
[[[x, y, z]
[x, y, z]
... ] ## frame 1
...
[[x, y, z]
[x, y, z]
... ] ## frame N
]
class QcOutput(filename)[source]

Bases: object

final_energy
final_structure
kcal_per_mol_2_eV = 0.043363
class QcTask(molecule=None, charge=None, spin_multiplicity=None, jobtype='SP', title=None, exchange='HF', correlation=None, basis_set='6-31+G*', aux_basis_set=None, ecp=None, rem_params=None, optional_params=None, ghost_atoms=None, method=None)[source]

Bases: monty.json.MSONable

An object representing a QChem input file.

Parameters:
  • molecule – The input molecule. If it is None of string “read”, QChem will read geometry from checkpoint file. If it is a Molecule object, QcInput will convert it into Cartesian coordinates. Valid values: pymatgen Molecule object, “read”, None Defaults to None.
  • charge (int) – Charge of the molecule. If None, charge on molecule is used. Defaults to None.
  • spin_multiplicity (int) – Spin multiplicity of molecule. Defaults to None, which means that the spin multiplicity is set to 1 if the molecule has no unpaired electrons and to 2 if there are unpaired electrons.
  • jobtype (str) – The type the QChem job. “SP” for Single Point Energy, “opt” for geometry optimization, “freq” for vibrational frequency.
  • title (str) – Comments for the job. Defaults to None. Which means the $comment section will be discarded.
  • exchange (str) – The exchange methods of the theory. Examples including: “B” (in pure BLYP), “PW91”, “PBE”, “TPSS”. Defaults to “HF”. This parameter can also be common names of hybrid functionals, such as B3LYP, TPSSh, XYGJOS. In such cases, the correlation parameter should be left as None.
  • correlation (str) – The correlation level of the theory. Example including: “MP2”, “RI-MP2”, “CCSD(T)”, “LYP”, “PBE”, “TPSS” Defaults to None.
  • basis_set (str/dict) – The basis set. If it is a dict, each element can use different basis set.
  • aux_basis_set (str/dict) – Auxiliary basis set. For methods, like RI-MP2, XYG3, OXYJ-OS, auxiliary basis set is required. If it is a dict, each element can use different auxiliary basis set.
  • ecp – Effective core potential (ECP) to be used. If it is a dict, each element can use different ECP.
  • rem_params (dict) – The parameters supposed to write in the $rem section. Dict of key/value pairs. Example: {“scf_algorithm”: “diis_gdm”, “scf_max_cycles”: 100}
  • optional_params (dict) – The parameter for keywords other than $rem section. Dict of key/value pairs. Example: {“basis”: {“Li”: “cc-PVTZ”, “B”: “aug-cc-PVTZ”, “F”: “aug-cc-PVTZ”} “ecp”: {“Cd”: “srsc”, “Br”: “srlc”}}
  • ghost_atom (list) – List of ghost atoms indices. Indices start from 0. The ghost atom will be represented in of the form of @element_symmbol
alternative_keys = {'job_type': 'jobtype', 'symmetry_ignore': 'sym_ignore', 'scf_max_cycles': 'max_scf_cycles'}
alternative_values = {'optimization': 'opt', 'frequency': 'freq'}
as_dict()[source]
disable_symmetry()[source]

Turn the symmetry off.

classmethod from_dict(d)[source]
classmethod from_file(filename)[source]
classmethod from_string(contents)[source]

Creates QcInput from a string.

Parameters:contents – String representing a QChem input file.
Returns:QcInput object
molecule
optional_keywords_list = {'efp_params', 'external_charges', 'svp', 'intracule', 'multipole_field', 'solvent', 'qm_atoms', 'alist', 'svpirf', 'van_der_waals', 'basis2', 'occupied', 'localized_diabatization', 'ecp', 'xc_functional', 'velocity', 'nbo', 'pcm', 'opt', 'aux_basis', 'empirical_dispersion', 'isotopes', 'plots', 'pcm_solvent', 'efp_fragments', 'cdft', 'basis', 'force_field_params', 'swap_occupied_virtual'}
scale_geom_opt_threshold(gradient=0.1, displacement=0.1, energy=0.1)[source]

Adjust the convergence criteria of geometry optimization.

Parameters:
  • gradient – the scale factor for gradient criteria. If less than 1.0, you are tightening the threshold. The base value is 300 × 10E−6
  • displacement – the scale factor for atomic displacement. If less then 1.0, you are tightening the threshold. The base value is 1200 × 10E−6
  • energy – the scale factor for energy change between successive iterations. If less than 1.0, you are tightening the threshold. The base value is 100 × 10E−8.
set_auxiliary_basis_set(aux_basis_set)[source]
set_basis2(basis2_basis_set)[source]
set_basis_set(basis_set)[source]
set_dft_grid(radical_points=128, angular_points=302, grid_type='Lebedev')[source]

Set the grid for DFT numerical integrations.

Parameters:
  • radical_points – Radical points. (Integer)
  • angular_points – Angular points. (Integer)
  • grid_type – The type of of the grid. There are two standard grids: SG-1 and SG-0. The other two supported grids are “Lebedev” and “Gauss-Legendre”
set_ecp(ecp)[source]
set_geom_max_iterations(iterations)[source]

Set the max iterations of geometry optimization.

Parameters:
  • iterations – the maximum iterations of geometry optimization.
  • (Integer)
set_geom_opt_coords_type(coords_type='internal_switch')[source]

Set the coordinates system used in geometry optimization. “cartesian” — always cartesian coordinates. “internal” — always internal coordinates. “internal-switch” — try internal coordinates first, if fails, switch to cartesian coordinates. “z-matrix” — always z-matrix coordinates. “z-matrix-switch” — try z-matrix first, if fails, switch to cartesian coordinates.

Parameters:coords_type – The type of the coordinates. (str)
set_geom_opt_use_gdiis(subspace_size=None)[source]

Use GDIIS algorithm in geometry optimization.

Parameters:subspace_size – The size of the DIIS subsapce. None for default value. The default value is min(NDEG, NATOMS, 4) NDEG = number of moleculardegrees of freedom.
set_integral_threshold(thresh=12)[source]

Cutoff for neglect of two electron integrals. 10−THRESH (THRESH <= 14). In QChem, the default values are: 8 For single point energies. 10 For optimizations and frequency calculations. 14 For coupled-cluster calculations.

Parameters:thresh – The exponent of the threshold. (Integer)
set_max_num_of_scratch_files(num=16)[source]

In QChem, the size of a single scratch is limited 2GB. By default, the max number of scratich is 16, which is cooresponding to 32GB scratch space. If you want to use more scratch disk space, you need to increase the number of scratch files:

Parameters:num – The max number of the scratch files. (Integer)
set_memory(total=None, static=None)[source]

Set the maxium allowed memory.

Parameters:
  • total – The total memory. Integer. Unit: MBytes. If set to None, this parameter will be neglected.
  • static – The static memory. Integer. Unit MBytes. If set to None, this parameterwill be neglected.
set_partial_hessian_atoms(alist, phess=1)[source]
set_scf_algorithm_and_iterations(algorithm='diis', iterations=50)[source]

Set algorithm used for converging SCF and max number of SCF iterations.

Parameters:
  • algorithm – The algorithm used for converging SCF. (str)
  • iterations – The max number of SCF iterations. (Integer)
set_scf_convergence_threshold(exponent=8)[source]

SCF is considered converged when the wavefunction error is less than 10**(-exponent). In QChem, the default values are: 5 For single point energy calculations. 7 For geometry optimizations and vibrational analysis. 8 For SSG calculations

Parameters:exponent – The exponent of the threshold. (Integer)
set_scf_initial_guess(guess='SAD')[source]

Set initial guess method to be used for SCF

Parameters:guess – The initial guess method. (str)
set_velocities(velocities)[source]
Parameters:(au) (velocities) – list of list of atom velocities
Returns:
use_cosmo(dielectric_constant=78.4)[source]

Set the solvent model to COSMO.

Parameters:dielectric_constant – the dielectric constant for the solvent.
use_pcm(pcm_params=None, solvent_key='solvent', solvent_params=None, radii_force_field=None)[source]

Set the solvent model to PCM. Default parameters are trying to comply to gaussian default value

Parameters:
  • pcm_params (dict) – The parameters of “$pcm” section.
  • solvent_key (str) – for versions < 4.2 the section name is “pcm_solvent”
  • solvent_params (dict) – The parameters of solvent_key section
  • radii_force_field (str) – The force fied used to set the solute radii. Default to UFF.
write_file(filename)[source]
xyz_patt = re.compile('^(\\w+)[\\s,]+([\\d\\.eE\\-]+)[\\s,]+([\\d\\.eE\\-]+)[\\s,]+([\\d\\.eE\\-]+)[\\-\\.\\s,\\w.]*$')
zmat_patt = re.compile('^(\\w+)*([\\s,]+(\\w+)[\\s,]+(\\w+))*[\\-\\.\\s,\\w]*$')