Skip to content

Commit

Permalink
Merge pull request #117 from siesta-project/Rel1.3.0
Browse files Browse the repository at this point in the history
Rel1.3.0
  • Loading branch information
bosonie authored Mar 8, 2022
2 parents cfbdd13 + 8c083d1 commit 932192d
Show file tree
Hide file tree
Showing 78 changed files with 55,243 additions and 1,661 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## v1.3.0

Version compatible with aiida-core>=1.3.0,<2.0.0.

### Improvements
- Introduce dedicated support for optical calculations. In particular,
dedicated inputs are created for the `SiestaCalulation` and `SiestaBaseWorkChain`.
Moreover a `EpsilonWorkChain` workchain is created to automatically
obtain the electronic contribution to the static dielectric constant.
- Introduce `SiestaBaseNEBWorkChain`, the core building block for the creation of workflows that enable
the search of the Minimum Energy Pathway (MEP) connecting two local minima of the potential energy surface
through the Nudge Elastic Band (NEB) method.

### Bug fixes
- Clarify units of stress.
- The `SiestaBaseWorkChain` now correcty handle LUA inputs.

## v1.2.0

Version compatible with aiida-core>=1.3.0,<2.0.0.
Expand Down
5 changes: 2 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ include CHANGELOG.md
include PyPI-README.rst
include LICENSE.txt
graft aiida_siesta/examples/fixtures
recursive-include aiida_siesta/examples/ *.txt *.psf *.psml *.cif 00_README
recursive-include aiida_siesta/examples/ 00_README
include aiida_siesta/utils/protocols_system/*.yaml
include aiida_siesta/utils/*.yaml
prune tests
prune aiida_siesta/docs/tutorials/first_workchain
prune aiida_siesta/docs/tutorials/data_icn2_2020
prune aiida_siesta/docs
2 changes: 1 addition & 1 deletion PyPI-README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AiiDA Siesta plugins and workflows
==================================

A plugin to interface the `Siesta DFT code <https://icmab.es/siesta/>`_
A plugin to interface the `Siesta DFT code <https://siesta-project.org/siesta/>`_
to the `AiiDA system <http://www.aiida.net/>`_.

Documentation can be found in:
Expand Down
16 changes: 9 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AiiDA Siesta plugins and workflows
==================================

A plugin to interface the `Siesta DFT code <https://icmab.es/siesta/>`_
A plugin to interface the `Siesta DFT code <https://siesta-project.org/siesta/>`_
to the `AiiDA system <http://www.aiida.net/>`_.

Documentation can be found in:
Expand All @@ -14,19 +14,17 @@ this distribution).
Acknowledgements
----------------

This work is supported by the [MARVEL National Centre for Competency
in Research](<http://nccr-marvel.ch>) funded by the `Swiss National
Science Foundation <http://www.snf.ch/en>`_, as well as by the `MaX
This work is supported by the `MaX
European Centre of Excellence <http://www.max-centre.eu/>`_ funded by
the Horizon 2020 INFRAEDI-2018-1 program, Grant No. 824143, by the
`INTERSECT <https://intersect-project.eu/>`_ (Interoperable material-to-device simulation box for
disruptive electronics) project, funded by Horizon 2020 under grant
agreement No 814487, and by the Spanish MINECO (projects
FIS2012-37549-C05-05 and FIS2015-64886-C5-4-P)
We thank the AiiDA team, who are also supported by the
`MARVEL National Centre for Competency in Research <http://nccr-marvel.ch>`_
funded by the `Swiss National Science Foundation <http://www.snf.ch/en>`_

.. figure:: aiida_siesta/docs/miscellaneous/logos/MARVEL.png
:alt: MARVEL
:target: http://nccr-marvel.ch

.. figure:: aiida_siesta/docs/miscellaneous/logos/MaX.png
:alt: MaX
Expand All @@ -39,3 +37,7 @@ FIS2012-37549-C05-05 and FIS2015-64886-C5-4-P)
.. figure:: aiida_siesta/docs/miscellaneous/logos/MINECO-AEI.png
:alt: MINECO-AEI
:target: http://www.mineco.gob.es/

.. figure:: aiida_siesta/docs/miscellaneous/logos/MARVEL.png
:alt: MARVEL
:target: http://nccr-marvel.ch
2 changes: 1 addition & 1 deletion aiida_siesta/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""The official AiiDA plugin for Siesta."""
__version__ = '1.2.0'
__version__ = '1.3.0'
99 changes: 80 additions & 19 deletions aiida_siesta/calculations/siesta.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ def internal_structure(structure, basis_dict=None):
return tweaked


def validate_optical(value, _):
"""
Validate the optical input.
"""
if value:
input_params = FDFDict(value.get_dict())
if "opticalpolarizationtype" in input_params:
if input_params["opticalpolarizationtype"] in ["polarized", "unpolarized"]:
if "%block opticalvector" not in input_params:
return "An optical vector must be specified for `polarized` and `unpolarized` polarization types"
if "%block opticalmesh" not in input_params:
return "An optical-mesh block must always be defined. For molecules set to [1 1 1]"


def validate_pseudos(value, _):
"""
Only used to throw deprecation warnings. Can be deleted in v2.0.0
Expand Down Expand Up @@ -107,7 +121,15 @@ def validate_parameters(value, _):
input_params = FDFDict(value.get_dict())
for key in input_params:
if "pao" in key:
return "you can't have PAO options in the parameters input port, they belong to the basis input port."
return "you can't have PAO options in the parameters input port, they belong to the `basis` input port."
#This will return error in v2.0. Now only warning for back compatibility.
if "optical" in key:
import warnings
message = (
"you shouldn't have optical options in the parameters input port, " +
"they belong to the `optical` input port."
)
warnings.warn(message) #return message
if key in SiestaCalculation._aiida_blocked_keywords:
message = (
f"you can't specify explicitly the '{input_params.get_last_untranslated_key(key)}' flag " +
Expand Down Expand Up @@ -191,23 +213,23 @@ def validate_inputs(value, _):
return "No pseudopotentials nor ions specified in input"
quantity = 'pseudos'

if 'basis' in value:
structure = internal_structure(value["structure"], value["basis"].get_dict())
if structure is None:
return "Not possibe to specify `floating_sites` (ghosts) with the same name of a structure kind."
else:
structure = value["structure"]

#Check each kind in the structure (including freshly added ghosts) have a corresponding pseudo or ion
kinds = [kind.name for kind in structure.kinds]
if set(kinds) != set(value[quantity].keys()):
ps_io = ', '.join(list(value[quantity].keys()))
kin = ', '.join(list(kinds))
string_out = (
'mismatch between defined pseudos/ions and the list of kinds of the structure\n' +
f' pseudos/ions: {ps_io} \n kinds(including ghosts): {kin}'
)
return string_out
if 'structure' in value: #Some subclasses might make structure optional
if 'basis' in value:
structure = internal_structure(value["structure"], value["basis"].get_dict())
if structure is None:
return "Not possibe to specify `floating_sites` (ghosts) with the same name of a structure kind."
else:
structure = value["structure"]
#Check each kind in the structure (including freshly added ghosts) have a corresponding pseudo or ion
kinds = [kind.name for kind in structure.kinds]
if set(kinds) != set(value[quantity].keys()):
ps_io = ', '.join(list(value[quantity].keys()))
kin = ', '.join(list(kinds))
string_out = (
'mismatch between defined pseudos/ions and the list of kinds of the structure\n' +
f' pseudos/ions: {ps_io} \n kinds(including ghosts): {kin}'
)
return string_out


class SiestaCalculation(CalcJob):
Expand Down Expand Up @@ -255,6 +277,13 @@ def define(cls, spec):

# Input nodes
spec.input('code', valid_type=orm.Code, help='Input code')
spec.input(
'optical',
valid_type=orm.Dict,
help='Specifications for optical properties',
required=False,
validator=validate_optical
)
spec.input('structure', valid_type=orm.StructureData, help='Input structure', validator=validate_structure)
spec.input(
'kpoints', valid_type=orm.KpointsData, help='Input kpoints', required=False, validator=validate_kpoints
Expand Down Expand Up @@ -284,7 +313,7 @@ def define(cls, spec):
# Parameters are in a separate dictionary to enable a reduced set of 'universal' scripts for particular uses.
# Input files (e.g., image files for NEB) should be packaged in a FolderData object.
# Files to be retrieved should be specified in a list o# path specifications.
spec.input_namespace('lua', help='Script and files for the Lua engine')
spec.input_namespace('lua', help='Script and files for the Lua engine', required=False)
spec.input('lua.script', valid_type=orm.SinglefileData, required=False)
spec.input('lua.parameters', valid_type=orm.Dict, required=False)
spec.input('lua.input_files', valid_type=orm.FolderData, required=False)
Expand All @@ -306,6 +335,7 @@ def define(cls, spec):
spec.output('output_structure', valid_type=StructureData, required=False, help='Optional relaxed structure')
spec.output('bands', valid_type=BandsData, required=False, help='Optional band structure')
spec.output('forces_and_stress', valid_type=ArrayData, required=False, help='Optional forces and stress')
spec.output('optical_eps2', valid_type=ArrayData, required=False, help='Optional eps2 optical data')
spec.output_namespace('ion_files', valid_type=IonData, dynamic=True, required=False)

# Option that allows access through node.res should be existing output node and a Dict
Expand All @@ -314,6 +344,7 @@ def define(cls, spec):
# Exit codes for specific errors. Useful for error handeling in workchains
spec.exit_code(453, 'BANDS_PARSE_FAIL', message='Failure while parsing the bands file')
spec.exit_code(452, 'BANDS_FILE_NOT_PRODUCED', message='Bands analysis was requested, but file is not present')
spec.exit_code(454, 'EPS2_FILE_NOT_PRODUCED', message='Optical calculation requested, but file is not present')
spec.exit_code(450, 'SCF_NOT_CONV', message='Calculation did not reach scf convergence!')
spec.exit_code(451, 'GEOM_NOT_CONV', message='Calculation did not reach geometry convergence!')
spec.exit_code(350, 'UNEXPECTED_TERMINATION', message='Statement "Job completed" not detected, unknown error')
Expand Down Expand Up @@ -387,6 +418,11 @@ def prepare_for_submission(self, folder): # noqa: MC0001 - is mccabe too compl
else:
bandskpoints = None

if 'optical' in self.inputs:
optical = self.inputs.optical
else:
optical = None

if 'parent_calc_folder' in self.inputs:
parent_calc_folder = self.inputs.parent_calc_folder
else:
Expand Down Expand Up @@ -565,6 +601,20 @@ def prepare_for_submission(self, folder): # noqa: MC0001 - is mccabe too compl
fbkpoints_card += "%endblock BandLines\n"
del bandskpoints_card_list

# ------------------------------------ OPTICAL-KEYS ----------------------------------
# Optical properties info. Again, this is just given in a standard dictionary,
# but we make sure that the option is turned on.
if optical is not None:
optical_dict = FDFDict(optical.get_dict())
optical_dict.update({'opticalcalculation': True})
#if '%block opticalmesh' not in optical_dict:
# if kpoints is not None:
# mesh, offset = kpoints.get_kpoints_mesh()
# optical_dic["%block optical-mesh"] =
# "{0:6} {1:6} {2:6}\n %endblock optical-mesh".format(mesh[0], mesh[1], mesh[2]))
# else:
# optical_dic["%block optical-mesh"] = "1 1 1\n %endblock optical-mesh"

# ================================= Operations for restart =================================
# The presence of a 'parent_calc_folder' input node signals that we want to
# get something from there, as indicated in the self._restart_copy_from attribute.
Expand Down Expand Up @@ -597,6 +647,11 @@ def prepare_for_submission(self, folder): # noqa: MC0001 - is mccabe too compl
infile.write("#\n# -- Basis Set Info follows\n#\n")
for k, v in basis_dict.items():
infile.write("%s %s\n" % (k, v))
# Optical properties info.
if optical is not None:
infile.write("#\n# -- Optical properties Info follows\n#\n")
for k, v in optical_dict.items():
infile.write("%s %s\n" % (k, v))
# Write previously generated cards now
infile.write("#\n# -- Structural Info follows\n#\n")
infile.write(atomic_species_card)
Expand Down Expand Up @@ -648,9 +703,12 @@ def prepare_for_submission(self, folder): # noqa: MC0001 - is mccabe too compl
calcinfo.codes_info = [codeinfo]
# Retrieve by default: the output file, the xml file, the messages file, and the json timing file.
# If bandskpoints, also the bands file is added to the retrieve list.
# If getting optical props, also the .EPSIMG file is added.
calcinfo.retrieve_list = []
xml_file = str(metadataoption.prefix) + ".xml"
bands_file = str(metadataoption.prefix) + ".bands"
eps2_file = str(metadataoption.prefix) + ".EPSIMG"

calcinfo.retrieve_list.append(metadataoption.output_filename)
calcinfo.retrieve_list.append(xml_file)
calcinfo.retrieve_list.append(self._JSON_FILE)
Expand All @@ -661,6 +719,9 @@ def prepare_for_submission(self, folder): # noqa: MC0001 - is mccabe too compl
if bandskpoints is not None:
calcinfo.retrieve_list.append(bands_file)

if optical is not None:
calcinfo.retrieve_list.append(eps2_file)

if lua_retrieve_list is not None:
calcinfo.retrieve_list += lua_retrieve_list.get_list()

Expand Down
4 changes: 2 additions & 2 deletions aiida_siesta/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
# built documents.
#
# The short X.Y version.
version = u'1.2.0'
version = u'1.3.0'
# The full version, including alpha/beta/rc tags.
release = u'1.2.0'
release = u'1.3.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
23 changes: 16 additions & 7 deletions aiida_siesta/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Welcome to the AiiDA-Siesta documentation!
..
The aiida-siesta python package interfaces the SIESTA DFT code
(http://icmab.es/siesta) with the AiiDA framework
(https://siesta-project.org/siesta/) with the AiiDA framework
(http://www.aiida.net). The package contains: plugins for SIESTA
itself and for other utility programs, new data structures, and basic
workflows. It is distributed under the MIT license and available from
Expand Down Expand Up @@ -39,20 +39,29 @@ under the supervision of Alberto Garcia.
Pol Febrer contributed the SiestaIterator and SiestaConverger workflows, including the underline
abstract classes system.

We acknowledge partial support from the Spanish Research Agency (projects
FIS2012-37549-C05-05, FIS2015-64886-C5-4-P and PGC2018-096955-B-C44) and by the `MaX
European Centre of Excellence <http://www.max-centre.eu/>`_ funded by the Horizon 2020
INFRAEDI-2018-1 program, Grant No. 824143.
This work is supported by the `MaX
European Centre of Excellence <http://www.max-centre.eu/>`_ funded by
the Horizon 2020 INFRAEDI-2018-1 program, Grant No. 824143, and by the
`INTERSECT <https://intersect-project.eu/>`_ (Interoperable material-to-device simulation box for
disruptive electronics) project, funded by Horizon 2020 under grant
agreement No 814487, as well as by the Spanish MINECO (projects
FIS2012-37549-C05-05 and FIS2015-64886-C5-4-P)

We thank the AiiDA team, who are also supported by the `MARVEL National Centre for Competency in Research <http://nccr-marvel.ch>`_
funded by the `Swiss National Science Foundation <http://www.snf.ch/en>`_

.. figure:: miscellaneous/logos/MINECO-AEI.png
:alt: MINECO-AEI
.. figure:: miscellaneous/logos/MaX.png
:alt: MaX
:target: http://www.max-centre.eu/
.. figure:: miscellaneous/logos/INTERSECT.png
:alt: INTERSECT
:target: http://intersect-project.eu/
.. figure:: miscellaneous/logos/MINECO-AEI.png
:alt: MINECO-AEI
:target: http://www.mineco.gob.es/
.. figure:: miscellaneous/logos/MARVEL.png
:alt: MARVEL
:target: http://nccr-marvel.ch

Contents:
---------
Expand Down
8 changes: 6 additions & 2 deletions aiida_siesta/docs/installation.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Installation
++++++++++++
Installation and dependences
++++++++++++++++++++++++++++

It would be a good idea to create and switch to a new python virtual
environment before the installation.
Expand Down Expand Up @@ -29,6 +29,10 @@ in order to configure aiida.
verdi daemon restart


Since version 1.2.0, ``aiida-siesta`` also depends on ``sisl`` (https://github.com/zerothi/sisl). For the moment
``sisl`` is used only to facilitate the management of basis orbitals, but a closer integration among the
two packages is foreseen in the future.

For developers
--------------

Expand Down
Loading

0 comments on commit 932192d

Please sign in to comment.