AMS driver and engines¶
The AMS driver is a new program introduced in the 2018 release that unifies the way in which different computational engines of the Amsterdam Modeling Suite are called. You can find more information about the AMS driver in the corresponding part of the documentation.
Preparing input¶
Tip
Starting with AMS2024, you can also use PISA (Python Input System for AMS) to specify the input to AMS.
However, almost all PLAMS examples still use the input description described on this page.
Note
Input files handling in the AMS driver is case insensitive.
The input file for the AMS driver consists of keys and values organized in blocks and subblocks:
Task GeometryOptimization
GeometryOptimization
Convergence
Gradients 1.0e-4
End
End
Properties
NormalModes true
End
System
Atoms
C 0.00000000 0.00000000 0.00000000
H 0.63294000 -0.63294000 -0.63294000
H -0.63294000 0.63294000 -0.63294000
H 0.63294000 0.63294000 0.63294000
H -0.63294000 -0.63294000 0.63294000
End
End
Engine DFTB
Model DFTB3
ResourcesDir DFTB.org/3ob-3-1
EndEngine
Such a structure can be reflected in a natural way by a multi-level character of Settings.
The example input file presented above can be generated by:
s = Settings()
#AMS driver input
s.input.ams.Task = 'GeometryOptimization'
s.input.ams.GeometryOptimization.Convergence.Gradients = 1.0e-4
s.input.ams.Properties.NormalModes = 'true'
#DFTB engine input
s.input.DFTB.Model = 'DFTB3'
s.input.DFTB.ResourcesDir = 'DFTB.org/3ob-3-1'
m = Molecule('methane.xyz')
j = AMSJob(molecule=m, settings=s)
j.run()
If an entry is a regular key-value pair it is printed in one line (like Task GeometryOptimization above).
If an entry is a nested Settings instance it is printed as a block and entries inside this instance correspond to the contents of that block.
One of the blocks is special: the engine block.
It defines the computational engine used to perform the task defined in all other blocks.
The contents of the engine block are not processed by the AMS driver, but rather passed to the corresponding engine instead.
Because of that every AMS input file can be seen as composed of two distinct parts: the engine input (everything inside the engine block) and the driver input (everything apart from the engine block).
That distinction is reflected by how a Settings instance for AMSJob is structured.
As we can see, the input branch of job settings is divided into two branches: the ams branch for the driver input and the DFTB branch for the engine input.
Note
In general, PLAMS will use all the contents of the ams branch (spelling not case-sensitive) to construct the driver input and the contents of every other branch to construct a separate engine block with the same name as the branch (like DFTB in the example above).
At present, only applications with a single engine block are implemented in the AMS driver, but that will most likely change in the near future.
The contents of each branch of myjob.settings.input are translated to a string using the same logic:
Entries within each block (including the top level) are listed in the alphabetical order.
Both keys and values are kept in their original case.
Strings used as values can contain spaces and all kinds of special characters, including new lines. They are printed in an unchanged form in the input file.
If you need to put a key without any value, you can use
Trueor an empty string as a value:s.input.ams.block.key = True s.input.ams.otherkey = '' ### translates to: block key end otherkey
If a value of a key is
FalseorNonethe key is omitted.An empty
Settingsinstance produces an empty block:s.input.ams.emptyblock = Settings() s.input.ams.otherblock #short syntax equivalent to the line above ### translates to: emptyblock end otherblock end
More instances of the same key within one block can be achieved by using a list of values instead of a single value:
s.input.ams.constraints.atom = [1,5,4] s.input.ams.constraints.block = ['ligand', 'residue'] ### translates to: constraints atom 1 atom 5 atom 4 block ligand block residue end
Some blocks require (or allow) something to be put in the header line, next to the block name. Special key
_his helpful in these situations:s.input.ams.block._h = 'header=very important' s.input.ams.block.key1 = 'value1' s.input.ams.block.key2 = 'value2' ### translates to: someblock header=very important key1 value1 key2 value2 end
Another kind of special key can be used to override the default alphabetical ordering of entries within a block, or just to insert arbitrary strings into the block:
s.input.ams.block._1 = 'entire line that has to be the first line of block' s.input.ams.block._2 = 'second line' s.input.ams.block._4 = 'I will not be printed' s.input.ams.block.key1 = 'value1' s.input.ams.block.key2 = 'value2' ### translates to: block entire line that has to be the first line of block second line key1 value1 key2 value2 end
If a value of a key needs to be a path to some KF file with results of a previous AMS calculation, an instance of
AMSJoborAMSResults(or directlyKFFile) can be used (seeAMSJob.get_input()for details):oldjob = AMSJob(...) oldjob.run() newjob = AMSJob(...) newjob.settings.input.ams.loadsystem.file = oldjob newjob.settings.input.ams.loadengine = (oldjob, 'dftb') ### translates to: loadengine /home/user/plams_workdir/oldjob/dftb.rkf loadsystem file = /home/user/plams_workdir/oldjob/ams.rkf end
Convert AMS text-style input to a Settings object (this requires that the SCM python package is installed):
text = ''' Task GeometryOptimization Engine DFTB Model GFN1-xTB EndEngine ''' sett = AMSJob.from_input(text).settings print(sett) # output: input: dftb: model: GFN1-xTB ams: task: GeometryOptimization
Note
The algorithm translating Settings contents into an input file does not check the correctness of the given data - it simply takes keys and values from Settings and prints them in the text file.
Due to that you are not going to be warned if you make a typo, use a wrong keyword or improper syntax.
Preparing runscript¶
Runscripts for the AMS driver are very simple (see AMSJob.get_runscript()).
The only adjustable option (apart from usual pre, post, shebang and stdout_redirect which are common for all single jobs) is myjob.settings.runscript.nproc, indicating the number of parallel processes to run AMS with (like with -n flag or NSCM environmental variable).
Molecule handling¶
There are several ways in which the description of the simulated system can be supplied to AMSJob.
The most convenient one is simply by passing a Molecule instance:
mol = Molecule('/path/to/some/file.xyz')
myjob = AMSJob(name='test', molecule=mol, settings=...)
or:
mol = Molecule('/path/to/some/file.xyz')
myjob = AMSJob(...)
myjob.molecule = mol
Note
Instead of passing a Molecule object to AMSJob, you have the option to use a Chemical System as well.
A Molecule instance stored as the molecule attribute is automatically processed during the input file preparation and printed in the proper format (see AMS manual for details).
Various details of this process can be adjusted based on attributes of the supplied Molecule.
If mol.lattice is nonempty, the information about periodicity vectors is printed to the lattice subblock of the system block.
If the supplied lattice consists of 1 or 2 vectors that do not follow the convention required by AMS (1D – vector aligned with X axis; 2D – vectors aligned with XY plane) the whole system is rotated to meet these criteria.
If mol.properties.charge exists, it is used as the charge key in the system block.
Moreover, each Atom present in the supplied Molecule has its own properties attribute that can be used to adjust the details of the line generated for this atom in the atoms block:
The atomic symbol is generated based on the atomic number stored in the
atnumattribute of theAtom. The atomic number of 0 corresponds to the “dummy atom” for which the symbol is empty.If
atom.properties.ghostexists and isTrue, the atomic symbol is prefixed withGh..If
atom.properties.nameexists, the name is added after the atomic symbol, separated by a single dot.Leading, trailing and double dots are removed from the atomic symbol.
If
atom.properties.suffixexists, it is placed at the end of the line, after the numerical coordinates (it should ba a string)
Example:
mol = Molecule('xyz/Ethanol.xyz')
mol[1].properties.ghost = True
mol[2].properties.name = 'D'
mol[3].properties.ghost = True
mol[3].properties.name = 'T'
mol[4].properties.atnum = 0
mol[4].properties.name = 'J.XYZ'
mol[5].properties.atnum = 0
mol[5].properties.name = 'J.ASD'
mol[5].properties.ghost = True
mol[6].properties.suffix = 'whatever text'
myjob = AMSJob(molecule=mol)
The corresponding fragment of the input file produced by the above code:
system
atoms
1 Gh.C 0.01247 0.02254 1.08262
2 C.D -0.00894 -0.01624 -0.43421
3 Gh.H.T -0.49334 0.93505 1.44716
4 J.XYZ 1.05522 0.04512 1.44808
5 Gh.J.ASD -0.64695 -1.12346 2.54219
6 H 0.50112 -0.91640 -0.80440 whatever text
7 H 0.49999 0.86726 -0.84481
8 H -1.04310 -0.02739 -0.80544
9 O -0.66442 -1.15471 1.56909
end
end
Another, more cumbersome way to provide the system information to AMSJob is to manually populate the system block in job settings:
s = Settings()
s.input.ams.system.atoms._1 = 'H 0.0 0.0 0.0'
s.input.ams.system.atoms._2 = 'O 1.0 0.0 0.0'
s.input.ams.system.charge = 1.0
#other settings adjustments
myjob = AMSJob(settings=s)
An alternative way of supplying molecular coordinates is to use the GeometryFile key in the system block:
s = Settings()
s.input.ams.system.geometryfile = '/path/to/some/file.xyz'
#other settings adjustments
myjob = AMSJob(settings=s)
Currently only the extended XYZ format is supported.
Finally, one could use the LoadSystem top-level key and point to an existing .rkf file with results of some previous calculation:
s = Settings()
s.input.loadsystem = '/path/to/some/ams.rkf'
#other settings adjustments
myjob = AMSJob(settings=s)
Multiple molecules¶
The AMS driver allows multiple occurrences of the system block in the input file.
Different system blocks are distinguished by their names defined in the header of the block:
system protein
atoms
...
end
end
system ligand
atoms
...
end
end
The system without such a name is considered the main system.
Multiple systems can be used in AMSJob by setting the molecule attribute to a dictionary, instead of a single Molecule.
Such a dictionary should have strings as keys and Molecule instances as values.
The main system should have '' (an empty string) as a key.
Other methods of providing the contents of the system block mentioned above can also be used to provide multiple system blocks.
myjob.settings.input.ams.system can be a list containing multiple Settings instances, one for each system.
Each such instance can be have manually filled atoms block or use the geometryfile key.
Special header _h key can be used to set headers and hence names of different system blocks.
Multiple instances of the LoadSystem key (also provided as a list, also with _h headers) can also be used.
All the methods mentioned above (molecule attribute, GeometryFile, LoadSystem, manual system block preparation) can be combined in any configuration.
In case of a conflict, the data stored in settings.input.ams.system takes precedence over molecule.
It is, however, the user’s responsibility to make sure that among all the systems provided there is exactly one main system (without a name).
AMSJob API¶
- class AMSJob(name='plamsjob', molecule=None, settings=None, depend=None)[source]¶
A single computation with the AMS driver.
- Parameters:
- run(jobrunner=None, jobmanager=None, watch=False, **kwargs)[source]¶
Run the job using jobmanager and jobrunner (or defaults, if
None).If watch is set to
True, the contents of the AMS driver logfile will be forwarded line by line to the PLAMS logfile (and stdout), allowing for an easier monitoring of the running job. Note that forwarding the AMS driver logfile makes this method block until execution finishes, even when using a parallelJobRunner.Other keyword arguments (**kwargs) are stored in
runbranch of job’s settings.- Parameters:
jobrunner (JobRunner | None) – runner used to execute the job, or
Nonefor the configured defaultjobmanager (JobManager | None) – manager used for the job, or
Nonefor the configured defaultwatch (bool) – forward new AMS log lines while the job runs
kwargs (Any) – values stored in the
runbranch of the job settings
- Returns:
results associated with this job
- Return type:
- get_input()[source]¶
Generate the input file. This method is just a wrapper around
_serialize_input().Each instance of
AMSJoborAMSResultspresent as a value insettings.inputbranch is replaced with an absolute path toams.rkffile of that job.If you need to use a path to some engine specific
.rkffile rather than the mainams.rkffile, you can to it by supplying a tuple(x, name)wherexis an instance ofAMSJoborAMSResultsandnameis a string with the name of the.rkffile you want. For example,(myjob, 'dftb')will transform to the absolute path todftb.rkffile inmyjob’s folder, if such a file is present.Instances of
KFFileare replaced with absolute paths to corresponding files.- Returns:
serialized AMS input
- Return type:
- get_runscript()[source]¶
Generate the runscript. Returned string is of the form:
unset AMS_SWITCH_LOGFILE_AND_STDOUT AMS_JOBNAME=jobname AMS_RESULTSDIR=. $AMSBIN/ams [-n nproc] --input=jobname.in [>jobname.out]
-nflag is added ifsettings.runscript.nprocexists.[>jobname.out]is used based onsettings.runscript.stdout_redirect. Ifsettings.runscript.preamble_linesexists, those lines will be added to the runscript verbatim before the execution of AMS. Ifsettings.runscript.postamble_linesexists, those lines will be added to the runscript verbatim after the execution of AMS.- Returns:
shell runscript for the job
- Return type:
- check()[source]¶
Check whether the main RKF file reports normal termination.
- Returns:
whether the job terminated normally without reported errors
- Return type:
- get_errormsg()[source]¶
Return an error message for a failed job.
- Returns:
error message, or
Nonefor a successful job- Return type:
str | None
- hash_input()[source]¶
Calculate the hash of the input file.
All instances of
AMSJoborAMSResultspresent as values insettings.inputbranch are replaced with hashes of corresponding job’s inputs. Instances ofKFFileare replaced with absolute paths to corresponding files.- Returns:
SHA-256 hash of the serialized input
- Return type:
- get_task()[source]¶
Return the AMS task from the job settings.
- Returns:
task name, or
Noneif it is not defined- Return type:
str | None
- classmethod load_external(path, settings=None, molecule=None, finalize=False, fmt='ams')[source]¶
Load an external job from path.
In this context an “external job” is an execution of some external binary that was not managed by PLAMS, and hence does not have a
.dillfile. It can also be used in situations where the execution was started with PLAMS, but the Python process was terminated before the execution finished, resulting in steps 9-12 of Running a job not happening.All the files produced by your computation should be placed in one folder and path should be the path to this folder or a file in this folder. The name of the folder is used as a job name. Input, output, error and runscript files, if present, should have names defined in
_filenamesclass attribute (usually[jobname].in,[jobname].out,[jobname].errand[jobname].run). It is not required to supply all these files, but in most cases one would like to use at least the output file, in order to use methods likegrep_output()orget_output_chunk(). If path is an instance of an AMSJob, that instance is returned.This method is a class method, so it is called via class object and it returns an instance of that class:
>>> a = AMSJob.load_external(path='some/path/jobname') >>> type(a) scm.plams.interfaces.adfsuite.ams.AMSJob
You can supply
SettingsandMoleculeinstances as settings and molecule parameters, they will end up attached to the returned job instance. If you don’t do this, PLAMS will try to recreate them automatically using methodsrecreate_settings()andrecreate_molecule()of the correspondingResultssubclass. If noSettingsinstance is obtained in either way, the defaults fromconfig.jobare copied.You can set the finalize parameter to
Trueif you wish to run the whole_finalize()on the newly created job. In that case PLAMS will perform the usualcheck()to determine the job status (successful or failed), followed by cleaning of the job folder (Cleaning job folder),postrun()and pickling (Pickling). If finalize isFalse, the status of the returned job is copied.- Parameters:
path (str) – results directory or a file within it
settings (Settings | None) – settings to attach, or
Noneto reconstruct them when possiblemolecule (Molecule | None) – molecule to attach, or
Noneto reconstruct it when possiblefinalize (bool) – run the normal job finalization steps after loading
fmt (str) – input format:
ams,qe,gaussian,vasp, orany
- Returns:
job representing the external results
- Return type:
The available formats behave as follows:
amsloads a finished AMS job.qeconverts Quantum ESPRESSO output toams.rkfandqe.rkf.gaussianconverts Gaussian output to AMS-compatible RKF files.vaspconverts a VASPOUTCARtoams.rkfandvasp.rkf.anydetects the format automatically.
This method can also be used to convert a finished VASP job to an AMSJob. If you supply the path to a folder containing OUTCAR, then a subdirectory will be created in this folder called AMSJob. In the AMSJob subdirectory, two files will be created: ams.rkf and vasp.rkf, that contain some of the results from the VASP calculation. If the AMSJob subdirectory already exists, the existing ams.rkf and vasp.rkf files will be reused. NOTE: the purpose of loading VASP data this way is to let you call for example job.results.get_energy() etc., not to run new VASP calculations!
- classmethod from_input(text_input, **kwargs)[source]¶
Create an AMS job from AMS-style text input.
- Parameters:
- Returns:
job containing the parsed settings and systems
- Raises:
ImportError – if the SCM input parser is unavailable
JobError – if molecules are supplied both in the input and as a keyword argument
- Return type:
Example:
text = ''' Task GeometryOptimization Engine DFTB Model GFN1-xTB EndEngine ''' job = AMSJob.from_input(text)
Note
If molecule is included in the keyword arguments to this method, the text_input may not contain any System blocks. In other words, the molecules to be used either need to come from the text_input, or the keyword argument, but not both.
If settings is included in the keyword arguments to this method, the
Settingscreated from the text_input will be soft updated with the settings from the keyword argument. In other words, the text_input takes precedence over the settings keyword argument.
- classmethod from_inputfile(filename, heredoc_delimit='eor', **kwargs)[source]¶
Construct an
AMSJobinstance from an AMS input or run file.If a runscript is provided, this method attempts to extract the input based on the heredoc delimiter (see heredoc_delimit).
- Parameters:
filename (str) – path to the input or run file
heredoc_delimit (str) – heredoc delimiter used by a run file
kwargs (Any) – additional arguments forwarded to
from_input()
- Returns:
job containing the parsed input
- Return type:
- static settings_to_mol(s)[source]¶
Remove the
s.input.ams.systemblock and convert it to molecules.The provided settings should be in the same style as the ones produced by the SCM input parser. Dictionary keys are taken from the header of each system block. The existing s.input.ams.system block is removed in the process, assuming it was present in the first place.
AMSResults API¶
- class AMSResults(*args, **kwargs)[source]¶
Results from an AMS calculation.
Methods with a unit argument convert numerical results to that unit.
Methods that expose RKF variables directly, including
readrkf(),read_rkf_section(), andget_history_property(), return values in their RKF storage units without conversion.When running with
amspython, useAKFReaderto inspect the unit and metadata of an RKF variable:from scm.akfreader import AKFReader reader = AKFReader(results.rkfpath("engine")) print(reader.units("AMSResults%Energy")) print(reader.description("AMSResults%Energy"))
- class EnergyLandscape(results)[source]¶
Stationary points, fragments, and connectivity from a PES exploration.
Integer indexing uses one-based state identifiers; iteration follows landscape order.
- Parameters:
results (AMSResults) – AMS results containing an
EnergyLandscapesection, orNoneto create an empty landscape
- class Fragment(landscape, engfile, energy, mol)[source]¶
An isolated fragment represented in an energy landscape.
energyis in hartree, andmoleculecoordinates and lattice vectors are in angstrom. Theidproperty is a one-based identifier.- Parameters:
landscape (AMSResults.EnergyLandscape) – containing energy landscape
engfile (str) – engine RKF identifier for this fragment
energy (float) – fragment energy in hartree
mol (Molecule) – fragment geometry
- __weakref__¶
list of weak references to the object (if defined)
- class FragmentedState(landscape, energy, composition, connections=None, adsorptionPrefactors=None, desorptionPrefactors=None)[source]¶
A state composed of multiple isolated fragments.
energyis in hartree, and theidproperty is a one-based identifier. Composition and connection values are stored internally as zero-based indices. Adsorption prefactors are in(bar*s)^-1and desorption prefactors are ins^-1.- Parameters:
landscape (AMSResults.EnergyLandscape) – containing energy landscape
energy (float) – fragmented-state energy in hartree
connections (Sequence[int] | None) – zero-based connected-state indices
adsorptionPrefactors (Sequence[float] | None) – adsorption prefactors in
(bar*s)^-1for the connectionsdesorptionPrefactors (Sequence[float] | None) – desorption prefactors in
s^-1for the connections
- __weakref__¶
list of weak references to the object (if defined)
- class State(landscape, engfile, energy, mol, count, isTS, reactantsID=None, productsID=None, prefactorsFromReactant=None, prefactorsFromProduct=None)[source]¶
A local minimum or transition state in an energy landscape.
energyis in hartree, andmoleculecoordinates and lattice vectors are in angstrom.id,display_id,reactantsID, andproductsIDare one-based identifiers.- Parameters:
landscape (AMSResults.EnergyLandscape) – containing energy landscape
engfile (str) – engine RKF identifier for this state
energy (float) – state energy in hartree
mol (Molecule) – state geometry
count (int) – number of times the state was found
isTS (bool) – whether the state is a transition state
reactantsID (int | None) – one-based reactant-state identifier
productsID (int | None) – one-based product-state identifier
prefactorsFromReactant (float | None) – forward rate prefactor in
s^-1prefactorsFromProduct (float | None) – backward rate prefactor in
s^-1originalID – identifier displayed for a state copied to a sub-landscape
- __weakref__¶
list of weak references to the object (if defined)
- __weakref__¶
list of weak references to the object (if defined)
- property fragmented_states: List[FragmentedState]¶
Return all fragmented states.
- Returns:
fragmented states in landscape order
- property fragments: List[Fragment]¶
Return all isolated fragments.
- Returns:
isolated fragments in landscape order
- are_orbitals_fractionally_occupied(engine=None)[source]¶
Return whether fractional orbital occupations were detected.
In this case the HOMO and LUMO labels depend on an arbitrary occupied/empty demarcation.
- collect()[source]¶
Collect the job files and create an
KFFileinstance for each RKF file.Engine result files are discovered through
ams.rkfand stored inrkfsunder their filenames without the.rkfextension. This method is called automatically when job execution finishes.- Return type:
None
- collect_rkfs()[source]¶
Collect the RKF files referenced by the main
ams.rkffile.Populate
rkfswith the main file underamsand engine files under their filename without the.rkfextension. Log a warning whenams.rkfis unavailable.- Return type:
None
- get_ase_atoms(section, file='ams')[source]¶
Return an ASE
Atomsobject stored in an RKF section.Positions and cell vectors are in angstrom.
- get_atomic_temperatures_at_step(step, history_section='MDHistory')[source]¶
Return the atomic temperatures at a trajectory step.
- get_band_structure(bands=None, unit='hartree', only_high_symmetry_points=False)[source]¶
Return the electronic band structure from a DFTB, BAND, or Quantum ESPRESSO calculation.
For unrestricted calculations, alternating stored bands belong to the spin-up and spin-down channels. The returned values can be passed to
plot_band_structure.- Parameters:
- Returns:
path coordinates, spin-up energies, spin-down energies, point labels, and Fermi energy. Energy arrays have shape
(len(x), len(bands)); for restricted calculations the two arrays are identical. Labels are empty for points that are not high-symmetry points.- Return type:
- get_bulkmodulus(unit='au', engine=None)[source]¶
Return the bulk modulus from
AMSResults%BulkModulus.
- get_charges(engine=None)[source]¶
Return the atomic charges in elementary-charge units.
- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result file- Returns:
array of shape
(n_atoms,)in elementary-charge units,e- Return type:
ndarray
- get_density_along_axis(axis='z', density_type='mass', start_fs=0, end_fs=None, every_fs=None, bin_width=0.1, atom_indices=None)[source]¶
Calculate the atomic density along a Cartesian coordinate axis.
This only works if the axis is perpendicular to the other two axes. The system must be 3D-periodic and the number of atoms cannot change during the trajectory.
- Parameters:
axis (str) – Cartesian axis, one of
x,y, orzdensity_type (str) –
massforg/cm^3,numberforangstrom^-3, orhistogramfor the mean number of atoms per frame and binstart_fs (float) – start time in femtoseconds
end_fs (float | None) – end time in femtoseconds, or
Nonefor the end of the trajectoryevery_fs (float | None) – sampling interval in femtoseconds, or
Nonefor every framebin_width (float) – target bin width in angstrom
atom_indices (Sequence[int] | None) – one-based atom indices, or
Nonefor all atoms
- Returns:
bin-center coordinates in angstrom and the selected density
- Return type:
Tuple[ndarray, ndarray]
- get_diffusion_coefficient_from_velocity_acf(times=None, acf=None, n_dimensions=3)[source]¶
Integrate a velocity autocorrelation function to obtain a diffusion coefficient.
If
timesoracfis None, then a default velocity autocorrelation function will be calculated.- Parameters:
times (ndarray | None) – correlation times in femtoseconds
acf (ndarray | None) – velocity autocorrelation in
angstrom^2/fs^2n_dimensions (int) – number of spatial dimensions included in the autocorrelation
- Returns:
times in femtoseconds and cumulative diffusion coefficients in
m^2/s- Return type:
Tuple[ndarray, ndarray]
- get_dipole_derivatives_acf(start_fs=0, end_fs=None, every_fs=None, max_dt_fs=None, x=True, y=True, z=True, normalize=False)[source]¶
Calculate the autocorrelation function of the dipole derivative.
- Parameters:
start_fs (float) – start time in femtoseconds, defaults to
0end_fs (float | None) – end time in femtoseconds, defaults to the end of the trajectory
every_fs (float | None) – sampling interval in femtoseconds, defaults to every frame
max_dt_fs (float | None) – maximum correlation time in femtoseconds
x (bool) – include the x component, defaults to
Truey (bool) – include the y component, defaults to
Truez (bool) – include the z component, defaults to
Truenormalize (bool) – normalize the autocorrelation function to one at time zero, defaults to
False
- Returns:
tuple containing the correlation times in femtoseconds and the dipole-derivative autocorrelation function. A normalized autocorrelation function is dimensionless; otherwise its unit is
(e*bohr/fs)^2.- Return type:
Tuple[ndarray, ndarray]
- get_dipole_history(dipole_unit='e*bohr')[source]¶
Return the molecular dipole moment for each saved frame.
- Parameters:
dipole_unit (str) – dipole-moment unit of the returned values, defaults to
e*bohr- Returns:
array of shape
(n_frames, 3)indipole_unit- Return type:
ndarray
- get_dipolegradients(engine=None)[source]¶
Return the nuclear gradients of the electric dipole moment.
- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result file- Returns:
array of shape
(3 * n_atoms, 3)in the atomic unit of dipole derivative, equivalent toe- Return type:
ndarray
- get_dipolemoment(engine=None)[source]¶
Return the electric dipole moment in
e*bohr.- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result file- Returns:
array of shape
(3,)containing the Cartesian components ine*bohr- Return type:
ndarray
- get_elastictensor(engine=None)[source]¶
Return the elastic tensor in Voigt notation from
AMSResults%ElasticTensor.- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result file- Returns:
array with shape
(1, 1),(3, 3), or(6, 6)for 1D, 2D, or 3D periodicity, respectively, inhartree/bohr^n_lattice_vectors- Return type:
ndarray
- get_energy(unit='hartree', engine=None)[source]¶
Return the final energy from
AMSResults%Energy.The meaning of the final energy depends on the engine; see the corresponding engine documentation.
- get_energy_landscape()[source]¶
Return the energy landscape from an AMS PES exploration.
The returned object is of the type
AMSResults.EnergyLandscapeand offers convenient access to the states’ energies, geometries as well as the information on which transition states connect which minima. State and fragment energies are in hartree, while molecular coordinates are in angstrom.el = results.get_energy_landscape() print(el) for state in el: print(f"Energy = {state.energy} hartree") print(f"Is transition state = {state.isTS}") print("Geometry:", state.molecule) if state.isTS: print(f"Forward barrier: {state.energy - state.reactants.energy} hartree") print(f"Backward barrier: {state.energy - state.products.energy} hartree")
- Returns:
stationary points, fragments, and their connectivity
- Return type:
- get_energy_uncertainty(unit='hartree', engine=None)[source]¶
Return the final energy uncertainty from
AMSResults%EnergyUncertainty.The meaning of the uncertainty depends on the engine; see the corresponding engine documentation.
- get_errormsg()[source]¶
Return an error message for the associated job.
See
Job.get_errormsgfor more information.- Returns:
error message, or
Nonefor a successful job- Return type:
str | None
- get_exit_condition_message()[source]¶
Return the driver exit-condition message.
- Returns:
stored message, or an empty string if none is available
- Return type:
- get_force_constants(engine=None)[source]¶
Return the vibrational force constants.
- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result file- Returns:
array of shape
(n_normal_modes,)inhartree/bohr^2- Return type:
ndarray
- get_forcefield_params(engine=None)[source]¶
Return force-field information from an engine RKF file.
- Parameters:
engine (str | None) – engine RKF file identifier, defaults to the unique main engine
- Returns:
tuple containing the atomic charges in elementary-charge units, the force-field atom type for each atom, and the combined
ForceFieldPatch. The patch isNonewhen the RKF file contains no patches.- Return type:
- get_frequency_spectrum(engine=None, broadening_type='gaussian', broadening_width=40, min_x=0, max_x=4000, x_spacing=0.5, post_process=None)[source]¶
Return a broadened vibrational-frequency spectrum with unit mode intensities.
Height-normalized profiles produce a dimensionless spectrum. Area-normalized profiles produce a spectrum in
(cm^-1)^-1. Withmax_to_1, the spectrum is dimensionless.- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result filebroadening_type (Literal['gaussian', 'lorentzian']) – line shape and whether unit weights define peak heights or integrated areas
broadening_width (int) – broadening width in
cm^-1min_x (int) – lower frequency-grid bound in
cm^-1max_x (int) – upper frequency-grid bound in
cm^-1x_spacing (float) – frequency-grid spacing in
cm^-1post_process (Literal['max_to_1'] | None) – normalize the spectrum maximum to one, or
None
- Returns:
frequency grid in
cm^-1and broadened unit-weight intensities- Return type:
Tuple[ndarray, ndarray]
- get_gradients(energy_unit='hartree', dist_unit='bohr', engine=None)[source]¶
Return the final nuclear energy gradients from
AMSResults%Gradients.These values are energy gradients, not forces. Forces are the negative gradients.
- Parameters:
- Returns:
gradient array of shape
(n_atoms, 3)inenergy_unit / dist_unit- Return type:
ndarray
- get_gradients_magnitude_uncertainty(energy_unit='hartree', dist_unit='bohr', engine=None)[source]¶
Return the propagated uncertainty of each final-gradient magnitude.
The values are read from
AMSResults%GradientsMagnitudeUncertainty.- Parameters:
- Returns:
uncertainty array of shape
(n_atoms,)inenergy_unit / dist_unit- Return type:
ndarray
- get_gradients_uncertainty(energy_unit='hartree', dist_unit='bohr', engine=None)[source]¶
Return the final-gradient uncertainties from
AMSResults%GradientsUncertainty.- Parameters:
- Returns:
uncertainty array of shape
(n_atoms, 3)inenergy_unit / dist_unit- Return type:
ndarray
- get_green_kubo_viscosity(start_fs=0, end_fs=None, every_fs=None, max_dt_fs=None, xy=True, yz=True, xz=True, pressuretensor=None)[source]¶
Calculate viscosity from the off-diagonal pressure-tensor autocorrelation function.
- Parameters:
start_fs (float) – start time in femtoseconds
end_fs (float | None) – end time in femtoseconds, or
Nonefor the end of the trajectoryevery_fs (float | None) – sampling interval in femtoseconds, or
Nonefor every framemax_dt_fs (float | None) – maximum correlation time in femtoseconds
xy (bool) – include the xy pressure-tensor component
yz (bool) – include the yz pressure-tensor component
xz (bool) – include the xz pressure-tensor component
pressuretensor (ndarray | None) – pressure tensors in
hartree/bohr^3with shape(n_frames, 6), orNoneto read them fromams.rkf
- Returns:
integration times in femtoseconds and cumulative viscosity in
mPa*s- Return type:
Tuple[ndarray, ndarray]
- get_hessian(engine=None)[source]¶
Return the Cartesian nuclear Hessian from
AMSResults%Hessian.The matrix contains ordinary second derivatives of the total energy and is not mass-weighted.
- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result file- Returns:
array of shape
(3 * n_atoms, 3 * n_atoms)inhartree/bohr^2- Return type:
ndarray
- get_history_length(history_section='History')[source]¶
Return the number of entries in an
ams.rkfhistory section.
- get_history_molecule(step)[source]¶
Return the molecule at a trajectory step from the
Historysection ofams.rkf.All data used by this method is taken from
ams.rkffile. Themoleculeattribute of the corresponding job is ignored. Coordinates and lattice vectors in the returned molecule are in angstrom.- Parameters:
step (int) – one-based history step number
- Returns:
molecule at the requested step, or
Noneifams.rkfis unavailable- Raises:
KeyError – if the requested step is outside the stored history
ResultsError – if the stored coordinates and molecular system have different sizes
- Return type:
Molecule | None
- get_history_property(varname, history_section='History')[source]¶
Return all saved values of a history variable.
- get_history_variables(history_section='History')[source]¶
Return the variable names stored in an
ams.rkfhistory section.
- get_homo_energies(unit='Hartree', engine=None)[source]¶
Return the HOMO energy of each spin channel.
See also
are_orbitals_fractionally_occupied().
- get_input_molecule()[source]¶
Return a
Moleculeinstance with the initial coordinates.All data used by this method is taken from
ams.rkffile. Themoleculeattribute of the corresponding job is ignored.- Returns:
input structure reconstructed from
ams.rkf, with coordinates and lattice vectors in angstrom- Return type:
- get_input_molecules()[source]¶
Return a dictionary mapping the name strings from the AMS input file to
Moleculeinstances.The main molecule (aka the one that did not have a string in the block header in the input file) will be returned under the key of the empty string “”. All data used by this method is taken from
ams.rkffile. Themoleculeattribute of the corresponding job is ignored.
- get_input_system()[source]¶
Return a
ChemicalSysteminstance with the initial coordinates.All data used by this method is taken from
ams.rkffile. Themoleculeattribute of the corresponding job is ignored.Note that
ChemicalSystemis only available within AMS python. If unavailable, the call will raise an error.- Returns:
input system reconstructed from
ams.rkf, with coordinates and lattice vectors in angstrom- Return type:
ChemicalSystem
- get_ir_intensities(engine=None)[source]¶
Return the IR intensities in
km/mol.- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result file- Returns:
array of shape
(n_normal_modes,)inkm/mol- Return type:
ndarray
- get_ir_spectrum(engine=None, broadening_type='gaussian', broadening_width=40, min_x=0, max_x=4000, x_spacing=0.5, post_process=None)[source]¶
Return a broadened IR spectrum.
Frequencies are in
cm^-1. Height-normalized profiles produce intensities inkm/mol; area-normalized profiles produce intensities in(km/mol)/(cm^-1). Withall_intensities_to_1, the physical intensities are replaced by unit weights, giving a dimensionless height profile or an area profile in(cm^-1)^-1. Withmax_to_1, the spectrum is dimensionless.- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result filebroadening_type (Literal['gaussian', 'lorentzian']) – line shape and whether line intensities define peak heights or integrated areas
broadening_width (int) – broadening width in
cm^-1min_x (int) – lower frequency-grid bound in
cm^-1max_x (int) – upper frequency-grid bound in
cm^-1x_spacing (float) – frequency-grid spacing in
cm^-1post_process (Literal['all_intensities_to_1', 'max_to_1'] | None) – replace line intensities with one, normalize the spectrum maximum, or
None
- Returns:
frequency grid in
cm^-1and broadened intensities in the convention described above- Return type:
Tuple[ndarray, ndarray]
- get_ir_spectrum_md(times=None, acf=None, max_dt_fs=None, max_freq=5000, number_of_points=None)[source]¶
Calculate an IR spectrum from a dipole-derivative autocorrelation function.
If
timesoracfis omitted, a normalized dipole-derivative autocorrelation function is calculated.- Parameters:
times (ndarray | None) – correlation times in femtoseconds, such as those returned by
get_dipole_derivatives_acf()acf (ndarray | None) – dipole-derivative autocorrelation function
max_dt_fs (float | None) – maximum correlation time in femtoseconds used when calculating the default autocorrelation function
max_freq (float | None) – maximum returned frequency in
cm^-1, defaults to5000number_of_points (int | None) – number of spectrum points, defaults to a spacing of approximately
1 cm^-1
- Returns:
tuple containing the frequencies in
cm^-1and the IR intensities. The internally generated normalized autocorrelation function gives arbitrary intensity units. When an autocorrelation function is supplied, the numerical scale follows that function.- Return type:
Tuple[ndarray, ndarray]
- get_irc_results(molecules=True, unit='au')[source]¶
Return the converged points from an intrinsic reaction coordinate calculation.
IRCGradMaxandIRCGradRmsare returned in their RKF storage convention. AMS uses mass-weighted atomic units during IRC steps and ordinary atomic units during final minimization.- Parameters:
- Returns:
dictionary containing
Energies,RelativeEnergies,LeftBarrier, andRightBarrierinunit;PathLengthandArcLengthin angstrom; dimensionlessIRCIterationand one-basedHistoryIndices;IRCDirectionvalues;IRCGradMaxandIRCGradRmsin the convention above; and, whenmoleculesisTrue,Moleculeswith coordinates in angstrom- Return type:
- get_lumo_energies(unit='Hartree', engine=None)[source]¶
Return the LUMO energy of each spin channel.
See also
are_orbitals_fractionally_occupied().
- get_main_ase_atoms(get_results=False)[source]¶
Return an ASE
Atomsinstance with the final coordinates.Positions and cell vectors are in angstrom. When results are attached, ASE conventions are used: energy is in eV, forces in eV/angstrom, stress in eV/angstrom^3, and charges in elementary-charge units.
- Parameters:
get_results (bool) – attach available energy, forces, stress, and charges through an ASE
SinglePointCalculator- Returns:
final structure as an ASE
Atomsinstance- Return type:
AseAtoms
- get_main_engine_name()[source]¶
Return the identifier of the main engine result file.
Geometry-optimization step files and Hybrid subengine files are excluded. For molecular dynamics, the most recent
MDStepfile is selected.- Returns:
main engine result identifier
- Raises:
ValueError – if no unique main engine result file can be determined
- Return type:
- get_main_molecule()[source]¶
Return a
Moleculeinstance with the final coordinates.All data used by this method is taken from
ams.rkffile. Themoleculeattribute of the corresponding job is ignored.- Returns:
final structure reconstructed from
ams.rkf, with coordinates and lattice vectors in angstrom- Return type:
- get_main_system()[source]¶
Return a
ChemicalSysteminstance with the final coordinates.All data used by this method is taken from
ams.rkffile. Themoleculeattribute of the corresponding job is ignored.Note that
ChemicalSystemis only available within AMS python. If unavailable, the call will raise an error.- Returns:
final system reconstructed from
ams.rkf, with coordinates and lattice vectors in angstrom- Return type:
ChemicalSystem
- get_molecule(section, file='ams')[source]¶
Return a
Moleculestored in an RKF section.All data used by this method is taken from the chosen
.rkffile. Themoleculeattribute of the corresponding job is ignored. Coordinates and lattice vectors in the returned molecule are in angstrom.- Parameters:
- Returns:
molecule reconstructed from the RKF section
- Raises:
ValueError – if the section does not contain a molecule
- Return type:
- get_neb_results(molecules=True, unit='au')[source]¶
Return results from a nudged elastic band calculation.
- Parameters:
- Returns:
dictionary containing dimensionless
nImagesandnIterationscounts; theClimbingflag;HighestIndex;Energies,LeftBarrier,RightBarrier, andReactionEnergyinunit; one-basedHistoryIndices; and, whenmoleculesisTrue,Moleculeswith coordinates in angstrom.nImagesexcludes the endpoints, whileEnergiesandMoleculesinclude them.- Return type:
- get_normal_modes(engine=None, mass_weighted_hessian_eigenvectors=False)[source]¶
Return the normal-mode displacement vectors.
By default, return the unweighted Cartesian displacement vectors stored in
Vibrations%NoWeightNormalMode. Ifmass_weighted_hessian_eigenvectorsis enabled, scale each atomic displacement by the square root of the ratio between its atomic mass and the mode’s reduced mass.
- get_orbital_energies(unit='Hartree', engine=None)[source]¶
Return the orbital energies for each spin channel.
- get_orbital_occupations(engine=None)[source]¶
Return the orbital occupations for each spin channel.
Restricted occupations range from zero to two; unrestricted and spin-orbit occupations range from zero to one.
- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result file- Returns:
dimensionless array of shape
(n_spin, n_orbitals)- Return type:
ndarray
- get_pesscan_results(molecules=True)[source]¶
Return scan coordinates, energies, and convergence data for a PES scan.
- Parameters:
molecules (bool) – include
Moleculeswith one structure per PES point- Returns:
dictionary containing:
RaveledScanCoordsandScanCoords: flat and grouped scan-coordinate namesnRaveledScanCoordsandnScanCoords: corresponding dimensionless countsRaveledUnitsandUnits: corresponding units, chosen frombohr,bohr^2,bohr^3, andradianaccording to coordinate typeRaveledPESCoords: values for every flat coordinate in itsRaveledUnitsentryOrigScanCoords: grouped names in their newline-separated RKF representationnPESPoints: dimensionless number of PES pointsPES: energies in hartreeConverged: geometry-optimization convergence flagsHistoryIndices: one-based indices into theHistorysectionConstrainedAtoms: one-based indices of atoms occurring in scan coordinatesProperties: engine properties in their RKF storage units; populated whenCalcPropertiesAtPESPointswas enabledMolecules: structures with coordinates in angstrom, present only whenmoleculesisTrue
- Return type:
- get_phonons_band_structure(bands=None, unit='hartree', only_high_symmetry_points=False)[source]¶
Return the phonon band structure.
The returned values can be passed directly to
plot_phonons_band_structure().- Parameters:
- Returns:
tuple containing the one-dimensional reciprocal-path plotting coordinate, an array of shape
(len(x), len(bands))with the phonon band energies inunit, and the labels for the points inx. Each column in the energy array is a band. Non-high-symmetry points have an empty label.- Return type:
- get_phonons_dos(unit='hartree')[source]¶
Return the phonon density of states (DOS).
The returned values can be passed directly to
plot_phonons_dos().- Parameters:
unit (str) – energy unit for the energy grid, defaults to
hartree- Returns:
tuple containing the one-dimensional energy grid in
unit, the total DOS in1 / unit, the DOS per species in1 / unit, and the DOS per atom in1 / unit. The decomposed DOS values are dictionaries of one-dimensional arrays. They are empty when the corresponding decomposition is absent. Atom keys contain the species and one-based atom index.- Return type:
Tuple[ndarray, ndarray, Dict[str, ndarray], Dict[str, ndarray]]
- get_phonons_thermodynamic_properties(temperature_unit='K', properties_unit=('hartree', 'kB'))[source]¶
Return phonon thermodynamic properties as functions of temperature.
- Parameters:
temperature_unit (str) – unit for the returned temperatures, defaults to
K. This may beKor an energy-equivalent unit supported byUnits.properties_unit (Sequence[str]) – two-element sequence containing the energy unit for internal and free energies, followed by the unit for specific heat and entropy, defaults to
("hartree", "kB"). The second value may bekB,J/K,J/K/mol,eV/K, oreV/K/mol.
- Returns:
tuple containing a one-dimensional temperature array in
temperature_unit, a dictionary of property arrays, and a dictionary specifying the unit of each property. Possible property keys areInternal Energy,Free Energy,Specific Heat, andEntropy.- Return type:
- get_poissonratio(engine=None)[source]¶
Return the dimensionless Poisson ratio from
AMSResults%PoissonRatio.
- get_polarizability(engine=None)[source]¶
Return the polarizability in
(e * bohr)^2 / hartree.- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result file- Returns:
symmetric Cartesian tensor of shape
(3, 3)- Raises:
ValueError – if the stored polarizability has an unsupported shape
- Return type:
ndarray
- get_power_spectrum(times=None, acf=None, max_dt_fs=None, max_freq=None, number_of_points=None)[source]¶
Calculate a power spectrum from the velocity autocorrelation function.
If
timesoracfis None, then a default velocity autocorrelation function will be calculated.- Parameters:
times (ndarray | None) – correlation times in femtoseconds, as returned by
get_velocity_acf()acf (ndarray | None) – velocity autocorrelation function
max_dt_fs (float | None) – maximum correlation time in femtoseconds used for the default autocorrelation function
max_freq (float | None) – maximum returned frequency in
cm^-1, defaults to5000number_of_points (int | None) – number of spectrum points, defaults to approximately
1 cm^-1spacing
- Returns:
frequencies in
cm^-1and corresponding intensities. The internally generated normalized autocorrelation function gives arbitrary intensity units; for a supplied autocorrelation function, the numerical scale follows that function.- Return type:
Tuple[ndarray, ndarray]
- get_property_at_step(step, varname, history_section='History')[source]¶
Return a history variable at one step.
- Parameters:
- Returns:
stored value without unit conversion, or
Noneifams.rkfis unavailable; its type, shape, and unit depend on the variable- Return type:
TRead | None
- get_pvdos(engine=None)[source]¶
Return the partial vibrational density of states (PVDOS).
- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result file- Returns:
dimensionless array of shape
(n_normal_modes, n_atoms)with values between zero and one- Return type:
ndarray
- get_raman_intensities(engine=None)[source]¶
Return the Raman intensities in
angstrom^4/amu.- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result file- Returns:
array of shape
(n_normal_modes,)inangstrom^4/amu- Return type:
ndarray
- get_raman_spectrum(engine=None, broadening_type='gaussian', broadening_width=40, min_x=0, max_x=4000, x_spacing=0.5, post_process=None)[source]¶
Return a broadened Raman spectrum.
Frequencies are in
cm^-1. Height-normalized profiles produce intensities inangstrom^4/amu; area-normalized profiles produce intensities in(angstrom^4/amu)/(cm^-1). Withall_intensities_to_1, the physical intensities are replaced by unit weights, giving a dimensionless height profile or an area profile in(cm^-1)^-1. Withmax_to_1, the spectrum is dimensionless.- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result filebroadening_type (Literal['gaussian', 'lorentzian']) – line shape and whether line intensities define peak heights or integrated areas
broadening_width (int) – broadening width in
cm^-1min_x (int) – lower frequency-grid bound in
cm^-1max_x (int) – upper frequency-grid bound in
cm^-1x_spacing (float) – frequency-grid spacing in
cm^-1post_process (Literal['all_intensities_to_1', 'max_to_1'] | None) – replace line intensities with one, normalize the spectrum maximum, or
None
- Returns:
frequency grid in
cm^-1and broadened intensities in the convention described above- Return type:
Tuple[ndarray, ndarray]
- get_reduced_masses(engine=None)[source]¶
Return the vibrational reduced masses.
- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result file- Returns:
array of shape
(n_normal_modes,)in atomic mass units (amu)- Return type:
ndarray
- get_shearmodulus(unit='au', engine=None)[source]¶
Return the shear modulus from
AMSResults%ShearModulus.
- get_smallest_homo_lumo_gap(unit='Hartree', engine=None)[source]¶
Return the smallest HOMO-LUMO gap across spin channels.
See also
are_orbitals_fractionally_occupied().
- get_stresstensor(engine=None)[source]¶
Return the clamped-ion Cartesian stress tensor from
AMSResults%StressTensor.- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result file- Returns:
array of shape
(n_lattice_vectors, n_lattice_vectors)inhartree/bohr^n_lattice_vectors. This is energy per length for 1D periodicity, energy per area for 2D periodicity, and pressure for 3D periodicity.- Return type:
ndarray
- get_system(section, file='ams')[source]¶
Return a
ChemicalSystemstored in an RKF section.All data used by this method is taken from the chosen
.rkffile. Themoleculeattribute of the corresponding job is ignored.Note that
ChemicalSystemis only available within AMS python. If unavailable, the call will raise an error. Coordinates and lattice vectors in the returned system are in angstrom.
- get_system_version(main, step)[source]¶
Return the chemical-system section number used at a history step.
- get_time_step(history_section='MDHistory')[source]¶
Return the time between adjacent saved MD frames in femtoseconds.
This is the MD integration time step multiplied by the trajectory sampling frequency.
- get_vcd_rotational_strength(engine=None)[source]¶
Return the vibrational rotational strengths in
10^-44 esu^2 cm^2.- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result file- Returns:
array of shape
(n_normal_modes,)in10^-44 esu^2 cm^2- Return type:
ndarray
- get_vcd_spectrum(engine=None, broadening_type='gaussian', broadening_width=40, min_x=0, max_x=4000, x_spacing=0.5, post_process=None)[source]¶
Return a broadened VCD rotational-strength spectrum.
Frequencies are in
cm^-1. Height-normalized profiles produce intensities in10^-44 esu^2 cm^2; area-normalized profiles produce intensities in(10^-44 esu^2 cm^2)/(cm^-1). Withall_intensities_to_1, the physical intensities are replaced by unit weights, giving a dimensionless height profile or an area profile in(cm^-1)^-1. Withmax_to_1, the spectrum is dimensionless.- Parameters:
engine (str | None) – engine RKF identifier, or
Noneto select the unique engine result filebroadening_type (Literal['gaussian', 'lorentzian']) – line shape and whether line intensities define peak heights or integrated areas
broadening_width (int) – broadening width in
cm^-1min_x (int) – lower frequency-grid bound in
cm^-1max_x (int) – upper frequency-grid bound in
cm^-1x_spacing (float) – frequency-grid spacing in
cm^-1post_process (Literal['all_intensities_to_1', 'max_to_1'] | None) – replace line intensities with one, normalize the spectrum maximum, or
None
- Returns:
frequency grid in
cm^-1and broadened intensities in the convention described above- Return type:
Tuple[ndarray, ndarray]
- get_velocity_acf(start_fs=0, end_fs=None, every_fs=None, max_dt_fs=None, atom_indices=None, x=True, y=True, z=True, normalize=False)[source]¶
Calculate the velocity autocorrelation function for a fixed-composition trajectory.
- Parameters:
start_fs (float) – start time in femtoseconds
end_fs (float | None) – end time in femtoseconds, or
Nonefor the end of the trajectoryevery_fs (float | None) – sampling interval in femtoseconds, or
Nonefor every framemax_dt_fs (float | None) – maximum correlation time in femtoseconds
atom_indices (Sequence[int] | None) – one-based atom indices, or
Nonefor all atomsx (bool) – include the x velocity component
y (bool) – include the y velocity component
z (bool) – include the z velocity component
normalize (bool) – normalize the autocorrelation function to one at time zero
- Returns:
correlation times in femtoseconds and the autocorrelation function. The latter is dimensionless when normalized and otherwise in
angstrom^2/fs^2.- Return type:
Tuple[ndarray, ndarray]
- get_work_function_results(energy_unit='hartree', dist_unit='bohr')[source]¶
Return the results of a work-function calculation.
The two vacuum potentials and work functions correspond to the left and right sides of the slab, respectively. For Quantum ESPRESSO calculations using a dipole correction, the potential is evaluated immediately before the correction position.
- Parameters:
- Returns:
coordinate in
dist_unit; planar-average and macroscopic-average potentials, Fermi energy, and bulk potential inenergy_unit; left and right vacuum potentials inenergy_unit; and left and right work functions inenergy_unit- Return type:
Tuple[ndarray, ndarray, ndarray, float, float, Tuple[float, float], Tuple[float, float]]
- get_youngmodulus(unit='au', engine=None)[source]¶
Return Young’s modulus from
AMSResults%YoungModulus.
- get_zero_point_energy(unit='hartree', engine=None)[source]¶
Return the vibrational zero-point energy from
Vibrations%ZeroPointEnergy.
- is_valid_stepnumber(main, step)[source]¶
Check whether a one-based step number is present in an RKF history.
- ok()[source]¶
Check if the execution of the associated
jobwas successful or not. SeeJob.okfor more information.- Returns:
whether the associated job completed successfully
- Return type:
- read_hybrid_term_rkf(section, variable, term, file='engine')[source]¶
Read a variable from a Hybrid term’s subengine RKF file.
- Parameters:
- Returns:
value stored in the selected variable, without unit conversion; its type, shape, and unit depend on the variable
- Return type:
TRead
- read_rkf_section(section, file='ams')[source]¶
Return all variables from an RKF section.
Section and variable names are case-sensitive. A missing section produces an empty dictionary.
- Parameters:
- Returns:
mapping from variable names to stored values, without unit conversion; each value’s type, shape, and unit depend on the variable
- Return type:
- readrkf(section, variable, file='ams')[source]¶
Read a variable from a section of an RKF file.
- Parameters:
section (str) – name of the RKF section; section names are case-sensitive
variable (str) – name of the RKF variable; variable names are case-sensitive
file (str) – RKF file identifier, defaults to
ams. For example, usesomethingto readsomething.rkf. If the job has a unique engine results file, useengineto select it.
- Returns:
value stored in the RKF variable, without unit conversion; its type, shape, and unit depend on the variable
- Raises:
KeyError – if the section or variable is not present in the selected RKF file
- Return type:
TRead
- recreate_molecule()[source]¶
Recreate the input molecule(s) for the corresponding job based on files present in the job folder.
This method is used by
load_external(). Ifams.rkfis present in the job folder, extract data from theInputMoleculeandInputMolecule(*)sections.
- recreate_settings()[source]¶
Recreate the input
Settingsinstance for the corresponding job based on files present in the job folder. This method is used byload_external().If
ams.rkfis present in the job folder, extract user input and parse it back to aSettingsinstance usingscm.basemodule. Remove thesystembranch from that instance.- Returns:
reconstructed settings, or
Noneif they cannot be reconstructed- Return type:
Settings | None