Dalton files (chemistry_files.dalton
)
Files from the Dalton software.
Note
About DALTON.PROP
:
NORD = 0 energy (ground or excited)
1 exp. value
2 Linear response function
3 Quadratic response function
4 Cubic response function
-1 ground - excited transition matrix element, <0|x|i>
-2 excited - excited transition matrix element, |<i|x|f>|
-11 First order excited state property, <i|x|i>
-20 <0|x|i><i|y|0>
-21 w*<0|x|i><i|y|0>
-22 (w_f - w_i)*|<i|x|f>|^2
-30 D_pa
-31 D_pe
-32 D_pc
-33 w1w2D_pa
-34 w1w2D_pe
-35 w1w2D_pc
400 oscillator strength
401 chemical shielding isotropic
402 chemical shielding tensor
- qcip_tools.chemistry_files.dalton.ALLOWED_LEVEL_0_MODULES = ['**DALTON', '**INTEGRAL', '**WAVE F', '**START', '**EACH S', '**PROPERTIES', '**RESPONSE']
Name of the allowed modules in dalton (according to documentation)
- class qcip_tools.chemistry_files.dalton.ArchiveOutput
Archive output of Dalton. Contains lots of information for who can extract them.
self.molecule
: the molecule (qcip_tools.molecule.Molecule
)self.tar_file
: pipe to the tar file (tarfile.TarFile
)
- classmethod attempt_identification(f)
A dalton archive does contain a lot of files name “DALTON”
- file_type = 'DALTON_ARCHIVE'
The identifier
- classmethod from_molecule(molecule, *args, **kwargs)
Create an object out of a molecule
- Parameters:
molecule (qcip_tools.molecule.Molecule) – the molecule
- Return type:
- get_file(name)
Get a
io.BufferedReader
from a filename, if exists. Note that you getbytes
out of that kind of objects, so you need todecode()
them.- Parameters:
name (str) – file name
- Return type:
io.BufferedReader
- classmethod possible_file_extensions()
Return the common extention of this kind of files
- Return type:
list
- read(f)
Expects
f
to be open on binary mode.Note
In Dalton archive, the molecule is given in a old, weird format, called “molplt”. Information about it is given in this webpage.
- Parameters:
f (file) – File
- class qcip_tools.chemistry_files.dalton.Input
Dalton dal input file.
Does NOT contain a molecule!
Note
Since Dalton only interpret the 7 first characters of any module (
**
included), the storage key is reduced to 5 characters.self.module
: modules (collections.OrderedDict
of InputModule)
- classmethod attempt_identification(f)
Very specific beginning (
**DALTON INPUT
) and end ('*END OF INPUT
)
- file_type = 'DALTON_DAL'
The identifier
- classmethod possible_file_extensions()
Return the common extention of this kind of files
- Return type:
list
- read(f)
- Parameters:
f (file) – File
- class qcip_tools.chemistry_files.dalton.InputCard(name=None, parameters=None)
Dalton input card
- Parameters:
name (str) – name of the module
parameters (list) – the parameters
- exception qcip_tools.chemistry_files.dalton.InputFormatError
- class qcip_tools.chemistry_files.dalton.InputModule(level=1, name=None, input_cards=None, submodules=None)
The dalton (sub)modules, with level indicating it they are module (level=0) or submodule (level=1)
Note
Since Dalton only interpret the 7 first characters of any input card or module (
*
or.
included), the storage key is reduced to that.- Parameters:
level (int) – level of the module (either 0 if principal or 1 if submodule)
name (str) – name of the module
input_cards (collections.OrderedDict) – The eventual input cards
submodules (collections.OrderedDict) – The eventual sub modules
- set_input_card(input_card, force=True)
Set an input card
- Parameters:
input_card (InputCard) – module
force (bool) – force replacing the card if exists
- set_submodule(submodule, force=False)
Set up a submodule
- Parameters:
submodule (qcip_tools.chemistry_files.dalton.InputModule) – module
force (bool) – force replacing the submodule if exists
- update(r)
Update a module with respect to another
- Parameters:
r (InputModule) – source module
- exception qcip_tools.chemistry_files.dalton.InputModuleError
- class qcip_tools.chemistry_files.dalton.MoleculeInput
Dalton mol input file.
Warning
Multiplicity seems to be given in the .dal file, so it may be wrong!!
self.molecule
: the molecule (qcip_tools.molecule.Molecule
)self.title
: the title (str
)self.basis_set
: the basis set (str
)
- classmethod attempt_identification(f)
A dalton molecule is quite unique (“charge=”)
- file_type = 'DALTON_MOL'
The identifier
- classmethod from_molecule(molecule, title='', basis_set='', *args, **kwargs)
Create a file from molecule
- Parameters:
molecule (qcip_tools.molecule.Molecule) – the molecule
title (str) – title of the run
basis_set (str) – the basis set
- Return type:
- classmethod possible_file_extensions()
Return the common extention of this kind of files
- Return type:
list
- read(f)
- Parameters:
f (file) – File
- to_string(in_angstrom=True, nosym=False, group_atoms=False)
- Parameters:
in_angstrom – gives the atomic coordinates in angstrom
nosym (bool) – specify “nosymmetry”
group_atoms (bool) – group of the same type together (the order may be lost)
- Type:
in_angstrom: bool
- Return type:
str
- write(f, in_angstrom=True, nosym=False, group_atoms=False)
- Parameters:
f (file) – File
in_angstrom – gives the atomic coordinates in angstrom
nosym (bool) – specify “nosymmetry”
group_atoms (bool) – group of the same type together (the order may be lost)
- Type:
in_angstrom: bool
- class qcip_tools.chemistry_files.dalton.Output
Output of Dalton.
self.molecule
: the molecule (qcip_tools.molecule.Molecule
)self.lines
: the lines of the file (list
ofstr
)self.sections
: the different sections (list
of OutputSection)
- classmethod attempt_identification(f)
A dalton output … Does contains a lot of (european) countries and universities name at some point (and a little bit of “Dalton” as well)
- file_type = 'DALTON_LOG'
The identifier
- get_inputs()
Fetch the inputs from the log file
- Return type:
tuple
- read(f)
- Parameters:
f (file) – File
- exception qcip_tools.chemistry_files.dalton.OutputFormatError
- class qcip_tools.chemistry_files.dalton.OutputSection(section, line_start, line_end)
Remind when a section is entered and exited
- Parameters:
section (str) – name of the section
- exception qcip_tools.chemistry_files.dalton.WrongNumberOfData(n, p)
- qcip_tools.chemistry_files.dalton.check_module(name)
Check if the module name is allowed
- Parameters:
name (str) – name of the module
- Return type:
bool
- qcip_tools.chemistry_files.dalton.dalton__archive_output__property__computed_energies(obj, *args, **kwargs)
Get the energies. Returns only the energy found on top of
DALTON.PROP
as the total energy (+labeled)- Parameters:
obj (qcip_tools.chemistry_files.dalton.ArchiveOutput) – object
- Return type:
dict
- qcip_tools.chemistry_files.dalton.dalton__archive_output__property__electrical_derivatives(obj, *args, **kwargs)
Get electrical derivatives in Dalton archives. Returns a dictionary of dictionaries:
+ "F" + static : ElectricDipole + "FF": + static : PolarizabilityTensor + "FD": + 0.042 : PolarizabilityTensor + ... + "FDD": + static : FirstHyperpolarizabilityTensor + ... + ...
Note
CC response calculations in Dalton are nice, since it allows form many order of response at the same time (thought it takes some memory) and it gives all the responses in one single file: DALTON.PROP.
On the other hand, the
**RESPONSE
module of dalton does not allows for many order at the same time, and is f***g inconsistent:dipole moment is in DALTON.PROP
alpha is in DALTON.PROP, but only the non-zero components (and you need to assume permutation)
beta is in RESULTS.RSP, because why not. You need to assume Kleinman condition for SHG, and optical rectification is assumed to be the same as EOP, just permuted (and I’m not entirely sure of the validity of what I did there).
If you use the patched version of Dalton (see installation part), results are then available in DALTON.PROP (but you still need to assume permutation).
gamma is in DALTON.PROP (main source, but only non-zero components that contribute to \(\gamma_{||}\)) and also in RESULTS.RSP. You need to use an hidden option,
.GAMALL
to get all components of the gamma tensor (otherwise only the one contributing to :math:`gamma_{||}` are computed). The rest of the components are obtained from RESULT.RSP (when symmetry is assumed) if.GAMALL
is used. Note that the first frequency is non-null for dc-Kerr, while it is the last one with CC response module (so it isdDFF
in with RESPONSE anddFFD
with CC).If you use the patched version, everything (!) is in DALTON.PROP.
- Parameters:
obj (qcip_tools.chemistry_files.dalton.ArchiveOutput) – object
- Return type:
dict
- qcip_tools.chemistry_files.dalton.dalton__archive_output__property__excitations(obj, *args, **kwargs)
Get excitations in Dalton archives. Returns a dictionary of tensor
Warning
The excitations are NOT sorted by energy (since Dalton groups them by symmetry)
- Parameters:
obj (qcip_tools.chemistry_files.dalton.ArchiveOutput) – object
- Return type:
dict
- qcip_tools.chemistry_files.dalton.dalton__archive_output__property__geometrical_derivatives(obj, *args, **kwargs)
Get geometrical derivatives in Dalton archives. Returns a dictionary of tensor
Note
Only return geometrical hessian
- Parameters:
obj (qcip_tools.chemistry_files.dalton.ArchiveOutput) – object
- Return type:
dict
- qcip_tools.chemistry_files.dalton.dalton__output__computed_energies(obj, *args, **kwargs)
Get the energies. Find the SCF/DFT energy, as well as the CCx one (which is given with MP2).
Note
Not (yet?) CI, CASCI or MCSCF
Probably wrong on geometry optimization.
- Parameters:
obj (qcip_tools.chemistry_files.dalton.Output) – object
- Return type:
dict
- qcip_tools.chemistry_files.dalton.dalton__output__get_geometrical_derivatives(obj, *args, **kwargs)
Get the cartesian gradient out of a dalton calculation output
- Parameters:
obj (qcip_tools.chemistry_files.dalton.Output) – object
- Return type:
dict