pymatgen.io.qchem.inputs module

Classes for reading/manipulating/writing QChem input files.

class QCInput(molecule, rem, opt=None, pcm=None, solvent=None, smx=None)[source]

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”]}

static find_sections(string)[source]

Find sections in the string.

Parameters

string (str) – String

Returns

List of sections.

static from_file(filename)[source]

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

Returns

QcInput

classmethod from_multi_jobs_file(filename)[source]

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

Returns

List of QCInput objects

classmethod from_string(string)[source]

Read QcInput from string.

Parameters

string (str) – String input.

Returns

QcInput

static molecule_template(molecule)[source]
Parameters

molecule (Molecule) – molecule

Returns

(str) Molecule template.

static multi_job_string(job_list)[source]
Parameters

() (job_list) – List of jobs

Returns

(str) String representation of multi job input file.

static opt_template(opt)[source]

Optimization template.

Parameters

() (opt) –

Returns

(str)

static pcm_template(pcm)[source]

Pcm run template.

Parameters

() (pcm) –

Returns

(str)

static read_molecule(string)[source]

Read molecule from string.

Parameters

string (str) – String

Returns

Molecule

static read_opt(string)[source]

Read opt section from string.

Parameters

string (str) – String

Returns

(dict) Opt section

static read_pcm(string)[source]

Read pcm parameters from string.

Parameters

string (str) – String

Returns

(dict) PCM parameters

static read_rem(string)[source]

Parse rem from string.

Parameters

string (str) – String

Returns

(dict) rem

static read_smx(string)[source]

Read smx parameters from string.

Parameters

string (str) – String

Returns

(dict) SMX parameters.

static read_solvent(string)[source]

Read solvent parameters from string.

Parameters

string (str) – String

Returns

(dict) Solvent parameters

static rem_template(rem)[source]
Parameters

() (rem) –

Returns

(str)

static smx_template(smx)[source]
Parameters

() (smx) –

Returns

(str)

static solvent_template(solvent)[source]

Solvent template.

Parameters

() (solvent) –

Returns

(str)

write_file(filename)[source]

Write QcInput to file.

Parameters

filename (str) – Filename

static write_multi_job_file(job_list, filename)[source]

Write a multijob file.

Parameters
  • () (filename) – List of jobs.

  • () – Filename