scine_autocas.interfaces.molcas.molcas_hdf5_utils

Modify Molcas Hdf5 files.

This module implements a class to read and modify molcas input files. The modification of the orbital hdf5 file allows to change the order of orbitals, required for active space calculations, without using MOLCASs ‘alter’ keyword.

Classes

MolcasHdf5Utils()

Class to handle the Molcas HDF5 files.

class scine_autocas.interfaces.molcas.molcas_hdf5_utils.MolcasHdf5Utils[source]

Class to handle the Molcas HDF5 files.

Attributes

self.nbas: np.ndarray

number of basis functions per symmetry

self.irrep_labels: np.ndarray

name of the symmetries

self.natoms: int = 0

number of atoms

self.module: str = “”

name of the Molcas module

self.orbital_type: str = “”

type of orbitals

# Datasets

self.type_indices: np.ndarray

molcas typeindex for each orbital

self.mo_energies: List[float] = []

array with MO energies ordered first by symmetry, then by energy

# extracted from hdf5 file

self.occupations: List[int] = []

contains the occupation of each orbital, e.g. 0: virtual, 1: singly occupied (uhf), 2: doubly occupied (rhf)

self.symmetries: List[int] = []

contains the symmetry index of each orbtial

self.energy: Union[np.ndarray, float] = 0

contains the energy for every state

__slots__ = ['nbas', 'irrep_labels', 'natoms', 'module', 'orbital_type', 'type_indices', 'mo_energies', 'occupations', 'symmetries', 'energy']
__init__()[source]

Construct class.

nbas: numpy.ndarray

number of basis functions per symmetry

irrep_labels: numpy.ndarray

name of the symmetries

natoms: int

number of atoms

module: str

name of the Molcas module

orbital_type: str

type of orbitals

type_indices: numpy.ndarray

molcas typeindex for each orbital

mo_energies: List[float]

array with MO energies ordered first by symmetry, then by energy

__doc__ = 'Class to handle the Molcas HDF5 files.\n\n    Attributes\n    ----------\n    self.nbas: np.ndarray\n        number of basis functions per symmetry\n    self.irrep_labels: np.ndarray\n        name of the symmetries\n    self.natoms: int = 0\n        number of atoms\n    self.module: str = ""\n        name of the Molcas module\n    self.orbital_type: str = ""\n        type of orbitals\n    # Datasets\n    self.type_indices: np.ndarray\n        molcas typeindex for each orbital\n    self.mo_energies: List[float] = []\n        array with MO energies ordered first by symmetry, then by energy\n    # extracted from hdf5 file\n    self.occupations: List[int] = []\n        contains the occupation of each orbital,\n       e.g. 0: virtual, 1: singly occupied (uhf), 2: doubly occupied (rhf)\n    self.symmetries: List[int] = []\n        contains the symmetry index of each orbtial\n    self.energy: Union[np.ndarray, float] = 0\n        contains the energy for every state\n    '
__module__ = 'scine_autocas.interfaces.molcas.molcas_hdf5_utils'
occupations: List[int]

contains the occupation of each orbital, e.g. 0: virtual, 1: singly occupied (uhf), 2: doubly occupied (rhf)

symmetries: List[int]

contains the symmetry index of each orbtial

energy: Union[numpy.ndarray, float]

contains the energy for every state

modify_hdf5(hdf5_file, cas_orbitals)[source]

Modify the Molcas orbital file, to enable typeindices in Molcas.

The active space is encoded in the hdf5 file.

Parameters
hdf5_filestr

name of the orbital file to modify

cas_orbitalsList[int]

orbital indices corresponding to orbitals in active space

Raises
KeyError

if no typeindices are found in the hdf5 file.

read_hdf5(hdf5_file)[source]

Read required parameters from an Molcas HDF5 file.

Parameters
hdf5_filestr

name of the HDF5 file_name

get_energy(hdf5_file)[source]

Read the DMRG energy from a Molcas HDF5 file.

Parameters
hdf5_filestr

name of the HDF5 file

Returns
self.energyUnion[float, np.ndarray]

if only one state found, then just the energy for this state. else an ndarray with an energy for each root.