program

Classes and functions related to interfaces to executable programs.

Defines methods that are required for interfaces to external programs that will run as executables and produce output that will be parsed.

class daltonproject.program.ComputeSettings(work_dir: Optional[str] = None, scratch_dir: Optional[str] = None, node_list: Optional[List[str]] = None, jobs_per_node: Optional[int] = None, mpi_command: Optional[str] = None, mpi_num_procs: Optional[int] = None, omp_num_threads: Optional[int] = None, memory: Optional[int] = None, comm_port: Optional[int] = None, launcher: Optional[str] = None)

Compute settings to be used by Program.compute() implementations.

The settings can be given as arguments during initialization. Defaults are used for any missing argument(s).

property comm_port

Return communication port.

property jobs_per_node: int

Return the number of jobs per node.

property launcher: Optional[str]

Return launcher command.

property memory: int

Return the total amount of memory in MB per node.

property mpi_command: str

Return MPI command.

property mpi_num_procs: int

Return the number of MPI processes.

property node_list: List[str]

Return the list of nodes.

property num_nodes

Return the number of nodes.

property omp_num_threads: int

Return the number of OpenMP threads (per MPI process).

property scratch_dir: str

Return scratch directory.

property work_dir: str

Return work directory.

class daltonproject.program.ExcitationEnergies(excitation_energies: ndarray, excitation_energies_per_sym: Dict[str, ndarray])

Data structure for excitation energies.

excitation_energies: ndarray

Alias for field number 0

excitation_energies_per_sym: Dict[str, ndarray]

Alias for field number 1

class daltonproject.program.HyperfineCouplings(polarization: ndarray, direct: ndarray, total: ndarray)

Data structure for hyperfine couplings.

direct: ndarray

Alias for field number 1

polarization: ndarray

Alias for field number 0

total: ndarray

Alias for field number 2

class daltonproject.program.NumBasisFunctions(tot_num_basis_functions: int, num_basis_functions_per_sym: List[int])

Data structure for the number of basis functions.

num_basis_functions_per_sym: List[int]

Alias for field number 1

tot_num_basis_functions: int

Alias for field number 0

class daltonproject.program.NumOrbitals(tot_num_orbitals: int, num_orbitals_per_sym: List[int])

Data structure for the number of orbitals.

num_orbitals_per_sym: List[int]

Alias for field number 1

tot_num_orbitals: int

Alias for field number 0

class daltonproject.program.OrbitalCoefficients(orbital_coefficients: ndarray, orbital_coefficients_per_sym: Dict[str, ndarray])

Data structure for molecular orbital coefficients.

orbital_coefficients: ndarray

Alias for field number 0

orbital_coefficients_per_sym: Dict[str, ndarray]

Alias for field number 1

class daltonproject.program.OrbitalEnergies(orbital_energies: ndarray, orbital_energies_per_sym: Dict[str, ndarray])

Data structure for molecular orbital energies.

orbital_energies: ndarray

Alias for field number 0

orbital_energies_per_sym: Dict[str, ndarray]

Alias for field number 1

class daltonproject.program.OrbitalEnergy(orbital_energy: float, symmetry: str)

Data structure for a single molecular orbital energy.

orbital_energy: float

Alias for field number 0

symmetry: str

Alias for field number 1

class daltonproject.program.OscillatorStrengths(oscillator_strengths: ndarray, oscillator_strengths_per_sym: Dict[str, ndarray])

Data structure for oscillator strengths.

oscillator_strengths: ndarray

Alias for field number 0

oscillator_strengths_per_sym: Dict[str, ndarray]

Alias for field number 1

class daltonproject.program.OutputParser

Abstract OutputParser class.

The implementation of this class defines methods for parsing output files produced by a program.

abstract property dipole: ndarray

Retrieve dipole.

abstract property dipole_gradients: ndarray

Retrieve gradients of dipole moment with respect to nuclear displacements in Cartesian coordinates.

abstract property electronic_energy: float

Retrieve electronic energy.

abstract property energy: float

Retrieve energy.

abstract property excitation_energies: ndarray

Retrieve excitation energies.

abstract property filename: str

Retrieve filename.

abstract property final_geometry: ndarray

Retrieve final geometry.

abstract property first_hyperpolarizability: ndarray

Retrieve the first hyperpolarizability.

abstract property gradients: ndarray

Retrieve gradients with respect to nuclear displacements in Cartesian coordinates.

abstract property hessian: ndarray

Retrieve second derivatives with respect to nuclear displacements in Cartesian coordinates.

abstract property homo_energy: OrbitalEnergy

Retrieve the highest occupied molecular orbital energy.

abstract property hyperfine_couplings: HyperfineCouplings

Retrieve hyperfine couplings.

abstract property lumo_energy: OrbitalEnergy

Retrieve the lowest unoccupied molecular orbital energy.

abstract property mo_energies: OrbitalEnergies

Retrieve molecular orbital energies.

abstract property natural_occupations: Union[ndarray, Dict[int, ndarray]]

Retrieve natural orbital occupations.

abstract property nmr_shieldings: ndarray

Retrieve NMR shieldings.

abstract property nuclear_repulsion_energy: float

Retrieve nuclear-repulsion energy.

abstract property num_basis_functions: Union[int, NumBasisFunctions]

Retrieve the number of basis functions.

abstract property num_electrons: int

Retrieve the number of electrons.

abstract property num_orbitals: Union[int, NumOrbitals]

Retrieve the number of orbitals.

abstract property orbital_coefficients: Union[ndarray, Dict[int, ndarray]]

Retrieve molecular orbital coefficients.

abstract property oscillator_strengths: ndarray

Retrieve oscillator strengths.

abstract property polarizability: ndarray

Retrieve polarizability.

abstract property polarizability_gradients: PolarizabilityGradients

Retrieve gradients of the polarizability with respect to nuclear displacements in Cartesian coordinates.

abstract property two_photon_cross_sections: ndarray

Retrieve two-photon cross-sections.

abstract property two_photon_strengths: ndarray

Retrieve two-photon strengths.

abstract property two_photon_tensors: ndarray

Retrieve two-photon tensors.

class daltonproject.program.PolarizabilityGradients(frequencies: ndarray, values: ndarray)

Data structure for polarizability gradients.

frequencies: ndarray

Alias for field number 0

values: ndarray

Alias for field number 1

class daltonproject.program.Program

Program base class to enforce program interface.

The interface must implement a compute() method that prepares and executes a calculation, and returns an instance of the OutputParser class.

abstract classmethod compute(molecule: Molecule, basis: Basis, qc_method: QCMethod, properties: Property, environment: Optional[Environment] = None, compute_settings: Optional[ComputeSettings] = None, filename: Optional[str] = None, force_recompute: bool = False) OutputParser

Run a calculation.

Parameters
  • molecule – Molecule on which a calculations is performed. This can also be an atom, a fragment, or any collection of atoms.

  • basis – Basis set to use in the calculation.

  • qc_method – Quantum chemistry method, e.g., HF, DFT, or CC, and associated settings.

  • properties – Properties of molecule to be calculated, geometry optimization, excitation energies, etc.

  • environment – TODO….

  • compute_settings – Settings for the calculation, e.g., number of MPI processes and OpenMP threads, work and scratch directory, etc.

  • filename – Optional user-specified filename that will be used for input and output files. If not specified a name will be generated as a hash of the input.

  • force_recompute – Recompute even if the output files already exist.

Returns

OutputParser instance with a reference to the filename used in the calculation.