scine_autocas.interfaces.serenity

Provide interface to Serenity.

All calls are done through Serenity’s Python interface.

Classes

Serenity(molecules[, settings_dict, load_paths])

Interface to the electronic structure program Serenity.

class scine_autocas.interfaces.serenity.Serenity(molecules, settings_dict=None, load_paths=[])[source]

Interface to the electronic structure program Serenity.

Serenity is called through its Python interface.

See also

settings

Interface.Settings

Notes

The settings object is already in the __slots__ of the base interface.

class Settings(molecules, settings_dict=None)[source]

Control the input parameters and writes input file for Serenity.

__slots__ = ('uhf', 'localisation_method', 'alignment', 'localize_virtuals', 'read_and_write_to_molcas', 'molcas_orbital_files', 'partitioning_thresholds', 'optimized_mapping', 'xyz_files', 'skip_localization', 'score_start', 'score_end', 'system_names', 'use_pi_bias', 'write_orbital_map_file')
__init__(molecules, settings_dict=None)[source]

Construct class.

uhf: bool

Run unrestricted

localisation_method: str

localisation method. Options are PIPEK_MEZEY, BOYS, EDMINSTON_RUEDENBERG, IBO.

alignment

Align orbitals for multiple structures

localize_virtuals

Localize the virtual orbitals

read_and_write_to_molcas

Replace the orbitals in a molcas orbital file

molcas_orbital_files: List[str]

The path to the directory with the molcas orbital files

partitioning_thresholds: List[float]

Direct orbital selection mapping thresholds

optimized_mapping

Optimize the first threshold of the direct orbital selection to give the best mapping

xyz_files: List[str]

The list of xyz files

skip_localization: bool

If true, the orbitals are not localized

score_start

Start score for the threshold search

score_end

Maximum score for the threshold search

system_names: List[str]

The list of system names

use_pi_bias: bool

If true the orbital comparison thresholds are scaled as presented in JCTC 16, 3607 (2020).

write_orbital_map_file: bool

If true, Serenity will write a file containing the orbital mapping.

__doc__ = 'Control the input parameters and writes input file for Serenity.'
__module__ = 'scine_autocas.interfaces.serenity'
__slots__ = ('systems',)
__doc__ = 'Interface to the electronic structure program Serenity.\n\n    Serenity is called through its Python interface.\n\n    Notes\n    -----\n    The settings object is already in the __slots__ of the base interface.\n\n    See Also\n    --------\n    settings : Interface.Settings\n    '
__init__(molecules, settings_dict=None, load_paths=[])[source]

Construct a Serenity interface.

All Serenity-System Controllers are constructed upon call.

Parameters
moleculeMolecule

contains molecular information

settings_dictDict[str, Any], optional

holds additional settings. Must contain the information about all xyz files.

__module__ = 'scine_autocas.interfaces.serenity'
dumper: Optional[Any]

if a dumper is provided in the main class it can be used

settings: Interface.Settings

contains information on the input of the electronic structure program

systems: List[spy.System]
calculate(cas_occupation=None, cas_indices=None)[source]

DMRG calculations including orbitals corresponding to cas_indices and electrons corresponding to occupations.

Parameters
cas_occupation: List[int], optional

contains the occupation for each spatial orbital. 2: doubly occupied, 1: singly occupied, 0: virtual

cas_indices: List[int], optional

contains the indices of the orbitals for the CAS calculation

Notes

Either cas_occupations and cas_indices is provided and a CAS calculation is started, or if none are provided a plain HF calculation is started. This function must be implemented by the corresponding interface.

Return type

Tuple[Union[float, ndarray], Union[ndarray, List[ndarray]], Union[ndarray, List[ndarray]], Union[ndarray, List[ndarray]]]

get_orbital_map()[source]

Getter for an orbital map in terms of orbital groups. See also:

interfaces/__init__.py::get_orbital_map(self)

Return type

Tuple[List[List[List[int]]], List[List[List[int]]]]

write_molcas_orbitals()[source]

Write the orbitals from Serenity to the Molcas files.

load_molcas_orbitals()[source]

Load the orbitals from the Molcas files to Serenity.

load_or_write_molcas_orbitals(write=False)[source]

Read or write orbitals from or to a molcas orbital file. Parameters: ———–

writebool

If true, the orbitals in the molcas orbital file are replaced by Serenity’s orbitals.

static run_scf(sys, settings=None, restricted=True)[source]

Run a SCF calculation for the given system.#

localize_orbitals(sys, loc_settings, template=None)[source]

Localize the orbitals of the given system. If a template system is given and orbital alignment is required, the orbitals are aligned first.

build_fragments(sys)[source]

Build fragments for the system. The number of fragments is determined by the number of partitioning thresholds plus one.

Parameters:
sysspy.System

The system.

Returns:
fragmentsList[spy.System]

The fragments.

build_orbital_map(fragments)[source]

Build the orbital group indices for all systems. Parameters:

fragmentsList[spy.System]

The total list of fragments.

Returns:
Tuple[List[List[List[int]]], List[List[List[int]]]}

The list of mappable orbital groups (vide supra), the list of unmappable orbital groups.

Return type

Tuple[List[List[List[int]]], List[List[List[int]]]]

get_localization_method(label)[source]

Get the Serenity enum for the given keyword.