Writers

QM-only input

class QMzyme.Writers.QMWriter(filename, memory, nprocs, full_region=None)

Writes a QM input file for ORCA or Gaussian using AQME qprep.

Parameters:
  • filename (str (required) Example: filename='1oh0_cutoff3') -- Name to be given to calculation input file. Does not need to contain file format suffix.

  • memory (str (optional, default memory='24GB')) -- Memory for the QM calculation (i) Gaussian: total memory; (ii) ORCA: memory per processor.

  • nprocs (int (optional, default nprocs=12)) -- Number of processors used in the QM calculation.

write()

This method writes the QM input files from the information specified from the user within QMzymeModel. Refer to parameters for Writer subclasses for required and optional parameters.

reference()

This method needs to be included in your class. All it should do is create an attribute called reference that provides a citable reference of the scheme, to give credit where credit is due. The reference will be automatically printed when the class is instantiated. This is taken care of in the the super().__init__(model, name) line of your __init__() method.

Example:

self.reference = "1. Alegre‐Requena, J. V., Sowndarya S. V., S., Pérez‐Soto, R., Alturaifi, T. M. & Paton, R. S. AQME: Automated quantum mechanical environments for researchers and educators. WIREs Comput Mol Sci 13, e1663 (2023)."

In some cases, there might not be a direct reference, but there might be relevant work a user might be interested in. Please only refer to the work of interest in the class doc string, not in the reference method.

If there are no references, please only include the line:

self.reference = None

QM/QM2 input

class QMzyme.Writers.QMQM2Writer(filename, memory, nprocs, full_region=None, total_charge=None, total_mult=None, high_region=None, low_region=None)

Writes a QM input file for ORCA or Gaussian using AQME qprep.

Parameters:
  • filename (str, required) -- Name to be given to calculation input file. Does not need to contain file format suffix. Example: filename='1oh0_cutoff3'.

  • memory (str, default='12GB') -- Memory for the QM calculation (i) Gaussian: total memory; (ii) ORCA: memory per processor.

  • nprocs (int, default nprocs=12) -- Number of processors used in the QM calculation.

  • high_region (QMzymeRegion, optional) -- QMzymeRegion with assigned QM method. If not provided, the code will search in CalculateModel.calculation for the 'QM' entry.

  • low_region (QMzymeRegion, optional) -- QMzymeRegion with assigned QM method. If not provided, the code will search in CalculateModel.calculation for the 'QM2' entry.

Notes:

Useful reminder for developers: Example text added to QM input file: .. code-block:: bash

!QM/QM2 WB97X-D3 DEF2-TZVP %QMMM QM2CUSTOMMETHOD "PBE D3BJ DEF2-SVP" QMATOMS {2:3} {6:13} END

The charge and multiplicity above the coordinates section is assigned to the high region (QM atoms).

write(full_region, high_region)

This method writes the QM input files from the information specified from the user within QMzymeModel. Refer to parameters for Writer subclasses for required and optional parameters.

reference()

This method needs to be included in your class. All it should do is create an attribute called reference that provides a citable reference of the scheme, to give credit where credit is due. The reference will be automatically printed when the class is instantiated. This is taken care of in the the super().__init__(model, name) line of your __init__() method.

Example:

self.reference = "1. Alegre‐Requena, J. V., Sowndarya S. V., S., Pérez‐Soto, R., Alturaifi, T. M. & Paton, R. S. AQME: Automated quantum mechanical environments for researchers and educators. WIREs Comput Mol Sci 13, e1663 (2023)."

In some cases, there might not be a direct reference, but there might be relevant work a user might be interested in. Please only refer to the work of interest in the class doc string, not in the reference method.

If there are no references, please only include the line:

self.reference = None

QM/xTB input

class QMzyme.Writers.QMXTBWriter(filename, memory, nprocs, full_region=None, high_region=None, low_region=None, total_charge=None, total_mult=None)

Writes a QM input file for ORCA or Gaussian using AQME qprep.

Parameters:
  • filename (str, required) -- Name to be given to calculation input file. Does not need to contain file format suffix. Example: filename='1oh0_cutoff3'

  • memory (str, default='12GB') -- Memory for the QM calculation (i) Gaussian: total memory; (ii) ORCA: memory per processor.

  • nprocs (int, default=12) -- Number of processors used in the QM calculation.

  • high_region (QMzymeRegion, optional) -- QMzymeRegion with assigned QM method. If not provided, the code will search in CalculateModel.calculation for the 'QM' entry.

  • low_region (QMzymeRegion, optional) -- QMzymeRegion with assigned xTB method. If not provided, the code will search in CalculateModel.calculation for the 'XTB' entry.

Notes:

Useful for developers. Example input: .. code-block:: bash

!QM/XTB WB97X-D3 DEF2-TZVP %QMMM QMATOMS {2:3} {6:13} END

The charge and mult above the coordinates section is assigned to the high region (QM atoms).

write(full_region, high_region)

This method writes the QM input files from the information specified from the user within QMzymeModel. Refer to parameters for Writer subclasses for required and optional parameters.

reference()

This method needs to be included in your class. All it should do is create an attribute called reference that provides a citable reference of the scheme, to give credit where credit is due. The reference will be automatically printed when the class is instantiated. This is taken care of in the the super().__init__(model, name) line of your __init__() method.

Example:

self.reference = "1. Alegre‐Requena, J. V., Sowndarya S. V., S., Pérez‐Soto, R., Alturaifi, T. M. & Paton, R. S. AQME: Automated quantum mechanical environments for researchers and educators. WIREs Comput Mol Sci 13, e1663 (2023)."

In some cases, there might not be a direct reference, but there might be relevant work a user might be interested in. Please only refer to the work of interest in the class doc string, not in the reference method.

If there are no references, please only include the line:

self.reference = None

QM/MM input

class QMzyme.Writers.QMMMWriter(filename, memory, nprocs, full_region)

Under development.

Developer Classes

If you are interesed in contributing to the QMzyme project by adding a new concrete Writer class, you will need to be familiar with these developer classes. Read more about it in the QMzyme Documentation.

We hope to support multi-scale methods beyond 2 layers in the bear future.

class QMzyme.Writers.Writer(filename, memory, nprocs, full_region)

Abstract Base Class for all calculation input file concrete writer classes. This class provides a rigid structure that imposes the required methods of all concrete writer classes to support community contributions.

If you are interested in contribute to QMzyme by creating a new writer class, see the QMzyme Documentation.

abstractmethod write()

This method writes the QM input files from the information specified from the user within QMzymeModel. Refer to parameters for Writer subclasses for required and optional parameters.

abstractmethod reference()

This method needs to be included in your class. All it should do is create an attribute called reference that provides a citable reference of the scheme, to give credit where credit is due. The reference will be automatically printed when the class is instantiated. This is taken care of in the the super().__init__(model, name) line of your __init__() method.

Example:

self.reference = "1. Alegre‐Requena, J. V., Sowndarya S. V., S., Pérez‐Soto, R., Alturaifi, T. M. & Paton, R. S. AQME: Automated quantum mechanical environments for researchers and educators. WIREs Comput Mol Sci 13, e1663 (2023)."

In some cases, there might not be a direct reference, but there might be relevant work a user might be interested in. Please only refer to the work of interest in the class doc string, not in the reference method.

If there are no references, please only include the line:

self.reference = None
set_constraints()
class QMzyme.Writers.WriterFactory

Factory Class to Register Concrete Writer Classes.

writers = {'QM': <class 'QMzyme.Writers.QMWriter'>, 'QMChargeField': <class 'QMzyme.Writers.QMMMWriter'>, 'QMQM2': <class 'QMzyme.Writers.QMQM2Writer'>, 'QMXTB': <class 'QMzyme.Writers.QMXTBWriter'>}
static register_writer(writer_type, writer)
static make_writer(writer_type, filename, memory, nprocs, **kwargs)

Instantiates and returns the specific concrete writer subclass.