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: str | None = None, scratch_dir: str | None = None, node_list: list[str] | None = None, jobs_per_node: int = 1, mpi_command: str | None = None, mpi_num_procs: int | None = None, omp_num_threads: int | None = None, memory: int | None = None, comm_port: int | None = None, launcher: str | None = None, slurm: bool = False, slurm_partition: str = '', slurm_walltime: str = '', slurm_account: str = '')
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: str | None
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: int
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 slurm: bool
Return slurm bool.
- property slurm_account: str
Return account.
- property slurm_partition: str
Return partition.
- property slurm_walltime: str
Return SLURM walltime.
- property work_dir: str
Return work directory.
- class daltonproject.program.ExcitationEnergies(excitation_energies: np.ndarray, excitation_energies_per_sym: dict[str, np.ndarray])
Data structure for excitation energies.
- excitation_energies: ndarray
Alias for field number 0
- excitation_energies_per_sym: dict[str, numpy.ndarray]
Alias for field number 1
- class daltonproject.program.HyperfineCouplings(polarization: np.ndarray, direct: np.ndarray, total: np.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: np.ndarray, orbital_coefficients_per_sym: dict[str, np.ndarray])
Data structure for molecular orbital coefficients.
- orbital_coefficients: ndarray
Alias for field number 0
- orbital_coefficients_per_sym: dict[str, numpy.ndarray]
Alias for field number 1
- class daltonproject.program.OrbitalEnergies(orbital_energies: np.ndarray, orbital_energies_per_sym: dict[str, np.ndarray])
Data structure for molecular orbital energies.
- orbital_energies: ndarray
Alias for field number 0
- orbital_energies_per_sym: dict[str, numpy.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: np.ndarray, oscillator_strengths_per_sym: dict[str, np.ndarray])
Data structure for oscillator strengths.
- oscillator_strengths: ndarray
Alias for field number 0
- oscillator_strengths_per_sym: dict[str, numpy.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.
- property dipole: ndarray
Retrieve dipole.
- property dipole_gradients: ndarray
Retrieve gradients of dipole moment with respect to nuclear displacements in Cartesian coordinates.
- property electronic_energy: float
Retrieve electronic energy.
- property energy: float
Retrieve energy.
- property excitation_energies: ndarray
Retrieve excitation energies.
- property filename: str
Retrieve filename.
- property final_geometry: ndarray
Retrieve final geometry.
- property first_hyperpolarizability: ndarray
Retrieve the first hyperpolarizability.
- property gradients: ndarray
Retrieve gradients with respect to nuclear displacements in Cartesian coordinates.
- property hessian: ndarray
Retrieve second derivatives with respect to nuclear displacements in Cartesian coordinates.
- property homo_energy: OrbitalEnergy
Retrieve the highest occupied molecular orbital energy.
- property hyperfine_couplings: HyperfineCouplings
Retrieve hyperfine couplings.
- property lumo_energy: OrbitalEnergy
Retrieve the lowest unoccupied molecular orbital energy.
- property mo_energies: OrbitalEnergies
Retrieve molecular orbital energies.
- property natural_occupations: np.ndarray | dict[int, np.ndarray]
Retrieve natural orbital occupations.
- property nmr_shieldings: ndarray
Retrieve NMR shieldings.
- property nuclear_repulsion_energy: float
Retrieve nuclear-repulsion energy.
- property num_basis_functions: int | NumBasisFunctions
Retrieve the number of basis functions.
- property num_electrons: int
Retrieve the number of electrons.
- property num_orbitals: int | NumOrbitals
Retrieve the number of orbitals.
- property orbital_coefficients: np.ndarray | dict[int, np.ndarray]
Retrieve molecular orbital coefficients.
- property oscillator_strengths: ndarray
Retrieve oscillator strengths.
- property polarizability: ndarray
Retrieve polarizability.
- property polarizability_gradients: PolarizabilityGradients
Retrieve gradients of the polarizability with respect to nuclear displacements in Cartesian coordinates.
- property spin_spin_couplings: ndarray
Retrieve spin-spin couplings.
- property spin_spin_labels: list[str]
Retrieve spin-spin labels.
- property two_photon_cross_sections: ndarray
Retrieve two-photon cross-sections.
- property two_photon_strengths: ndarray
Retrieve two-photon strengths.
- property two_photon_tensors: ndarray
Retrieve two-photon tensors.
- class daltonproject.program.PolarizabilityGradients(frequencies: np.ndarray, values: np.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: Environment | None = None, compute_settings: ComputeSettings | None = None, filename: str | None = 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 – Environment description is missing.
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.