# pymatgen.io.qchem.inputs module

Classes for reading/manipulating/writing QChem input files.

class QCInput(molecule: Union[pymatgen.core.structure.Molecule, Literal['read']], rem: Dict, opt: Optional[Dict[str, List]] = None, pcm: Optional[Dict] = None, solvent: Optional[Dict] = None, smx: Optional[Dict] = None, scan: Optional[Dict[str, List]] = None, van_der_waals: Optional[Dict[str, float]] = None, vdw_mode: str = 'atomic', plots: Optional[Dict] = None, nbo: Optional[Dict] = None)

  Bases: `monty.json.MSONable`

  An object representing a QChem input file. QCInput attributes represent different sections of a QChem input file. To add a new section one needs to modify __init__, __str__, from_sting and add staticmethods to read and write the new section i.e. section_template and read_section. By design, there is very little (or no) checking that input parameters conform to the appropriate QChem format, this responsible lands on the user or a separate error handling software.

  Parameters

    - molecule (pymatgen Molecule object or "read") – Input molecule. molecule can be set as either a pymatgen Molecule object or as the str “read”. “read” can be used in multi_job QChem input files where the molecule is read in from the previous calculation.

    - rem (dict) – A dictionary of all the input parameters for the rem section of QChem input file. Ex. rem = {‘method’: ‘rimp2’, ‘basis’: ‘6-31*G++’ … }

    - opt (dict of lists) – A dictionary of opt sections, where each opt section is a key and the corresponding values are a list of strings. Stings must be formatted as instructed by the QChem manual. The different opt sections are: CONSTRAINT, FIXED, DUMMY, and CONNECT Ex. opt = {“CONSTRAINT”: [“tors 2 3 4 5 25.0”, “tors 2 5 7 9 80.0”], “FIXED”: [“2 XY”]}

    - pcm (dict) – A dictionary of the PCM section, defining behavior for use of the polarizable continuum model. Ex: pcm = {“theory”: “cpcm”, “hpoints”: 194}

    - solvent (dict) – A dictionary defining the solvent parameters used with PCM. Ex: solvent = {“dielectric”: 78.39, “temperature”: 298.15}

    - smx (dict) – A dictionary defining solvent parameters used with the SMD method, a solvent method that adds short-range terms to PCM. Ex: smx = {“solvent”: “water”}

    - scan (dict of lists) – A dictionary of scan variables. Because two constraints of the same type are allowed (for instance, two torsions or two bond stretches), each TYPE of variable (stre, bend, tors) should be its own key in the dict, rather than each variable. Note that the total number of variable (sum of lengths of all lists) CANNOT be more than two. Ex. scan = {“stre”: [“3 6 1.5 1.9 0.1”], “tors”: [“1 2 3 4 -180 180 15”]}

    - van_der_waals (dict) – A dictionary of custom van der Waals radii to be used when construcing cavities for the PCM model or when computing, e.g. Mulliken charges. They keys are strs whose meaning depends on the value of vdw_mode, and the values are the custom radii in angstroms.

    - vdw_mode (str) – Method of specifying custom van der Waals radii - ‘atomic’ or ‘sequential’. In ‘atomic’ mode (default), dict keys represent the atomic number associated with each radius (e.g., 12 = carbon). In ‘sequential’ mode, dict keys represent the sequential position of a single specific atom in the input structure.

    - plots (dict) – A dictionary of all the input parameters for the plots section of QChem input file.

    - nbo (dict) – A dictionary of all the input parameters for the nbo section of QChem input file.

  static find_sections(string: str) → List

    Find sections in the string.

    Parameters

      string (str) – String

    Returns

      List of sections.

  static from_file(filename: str) → pymatgen.io.qchem.inputs.QCInput

    Create QcInput from file. :param filename: Filename :type filename: str

    Returns

      QcInput

  classmethod from_multi_jobs_file(filename: str) → List[pymatgen.io.qchem.inputs.QCInput]

    Create list of QcInput from a file. :param filename: Filename :type filename: str

    Returns

      List of QCInput objects

  classmethod from_string(string: str) → pymatgen.io.qchem.inputs.QCInput

    Read QcInput from string.

    Parameters

      string (str) – String input.

    Returns

      QcInput

  static molecule_template(molecule: Union[pymatgen.core.structure.Molecule, Literal['read']]) → str
    Parameters

      molecule (Molecule) – molecule

    Returns

      (str) Molecule template.

  static multi_job_string(job_list: List[pymatgen.io.qchem.inputs.QCInput]) → str
    Parameters

      () (job_list) – List of jobs

    Returns

      (str) String representation of multi job input file.

  static nbo_template(nbo: Dict) → str
    Parameters

      () (nbo) –

    Returns

      (str)

  static opt_template(opt: Dict[str, List]) → str

    Optimization template.

    Parameters

      () (opt) –

    Returns

      (str)

  static pcm_template(pcm: Dict) → str

    Pcm run template.

    Parameters

      () (pcm) –

    Returns

      (str)

  static plots_template(plots: Dict) → str
    Parameters

      () (plots) –

    Returns

      (str)

  static read_molecule(string: str) → Union[pymatgen.core.structure.Molecule, Literal['read']]

    Read molecule from string.

    Parameters

      string (str) – String

    Returns

      Molecule

  static read_nbo(string: str) → Dict

    Read nbo parameters from string.

    Parameters

      string (str) – String

    Returns

      (dict) nbo parameters.

  static read_opt(string: str) → Dict[str, List]

    Read opt section from string.

    Parameters

      string (str) – String

    Returns

      (dict) Opt section

  static read_pcm(string: str) → Dict

    Read pcm parameters from string.

    Parameters

      string (str) – String

    Returns

      (dict) PCM parameters

  static read_plots(string: str) → Dict

    Read plots parameters from string.

    Parameters

      string (str) – String

    Returns

      (dict) plots parameters.

  static read_rem(string: str) → Dict

    Parse rem from string.

    Parameters

      string (str) – String

    Returns

      (dict) rem

  static read_scan(string: str) → Dict[str, List]

    Read scan section from a string.

    Parameters

      string – String to be parsed

    Returns

      Dict representing Q-Chem scan section

  static read_smx(string: str) → Dict

    Read smx parameters from string.

    Parameters

      string (str) – String

    Returns

      (dict) SMX parameters.

  static read_solvent(string: str) → Dict

    Read solvent parameters from string.

    Parameters

      string (str) – String

    Returns

      (dict) Solvent parameters

  static read_vdw(string: str) → Tuple[str, Dict]

    Read van der Waals parameters from string.

    Parameters

      string (str) – String

    Returns

      (str, dict) vdW mode (‘atomic’ or ‘sequential’) and dict of van der Waals radii.

  static rem_template(rem: Dict) → str
    Parameters

      () (rem) –

    Returns

      (str)

  static scan_template(scan: Dict[str, List]) → str
    Parameters

      scan (dict) – Dictionary with scan section information. Ex: {“stre”: [“3 6 1.5 1.9 0.1”], “tors”: [“1 2 3 4 -180 180 15”]}

    Returns

      String representing Q-Chem input format for scan section

  static smx_template(smx: Dict) → str
    Parameters

      () (smx) –

    Returns

      (str)

  static solvent_template(solvent: Dict) → str

    Solvent template.

    Parameters

      () (solvent) –

    Returns

      (str)

  static van_der_waals_template(radii: Dict[str, float], mode: str = 'atomic') → str
    Parameters

      - radii (dict) – Dictionary with custom van der Waals radii, in Angstroms, keyed by either atomic number or sequential atom number (see ‘mode’ kwarg). Ex: {1: 1.20, 12: 1.70}

      - mode – ‘atomic’ or ‘sequential’. In ‘atomic’ mode (default), dict keys represent the atomic number associated with each radius (e.g., ‘12’ = carbon). In ‘sequential’ mode, dict keys represent the sequential position of a single specific atom in the input structure. NOTE: keys must be given as strings even though they are numbers!

    Returns

      String representing Q-Chem input format for van_der_waals section

  write_file(filename: str)

    Write QcInput to file.

    Parameters

      filename (str) – Filename

  static write_multi_job_file(job_list: List[pymatgen.io.qchem.inputs.QCInput], filename: str)

    Write a multijob file.

    Parameters

      - () (filename) – List of jobs.

      - () – Filename