Instantiating qc2Data class

We start with a very simple example:

 1from ase.build import molecule
 2from qc2.data import qc2Data
 3
 4# set ASE Atoms object
 5mol = molecule('H2')
 6
 7# instantiate qc2Data class
 8qc2data = qc2Data(
 9    molecule=mol,
10    filename='h2.hdf5',
11    schema='qcschema'
12)

Here, the first argument molecule represents an instance of ASE Atoms. If this attribute is not provided, molecule will default to an empty Atoms() object.

In the code snippet above, schema and filename are used to specify the format and name of the file in which qchem data is saved. These arguments will later be passed to a chosen qc2-ASE calculator, as discussed in Saving qchem data into formatted data files. Similarly to schema_format, the available options for the schema argument are qcschema or fcidump, which determine whether the filename should have the extensions *.hdf5 (*.h5) or *.fcidump, respectively.

Here is an example of how to instantiate qc2Data to save data according to fcidump format:

 1from ase.build import molecule
 2from qc2.data import qc2Data
 3
 4# instantiate ASE Atoms object
 5mol = molecule('H2')
 6
 7# now use fcidump format
 8qc2data = qc2Data(
 9    molecule=mol,
10    filename='h2.fcidump',
11    schema='fcidump'
12)