Hi @bastonero
I am working on Raman of magnetic semiconductor. It is complaining about magnetization in input but I have put in overrides.yaml file (please see below).
I got this error:
(aiidaENV) rkarkee@ch-fe2:/lustre/scratch5/rkarkee> verdi process report 2378
2024-03-20 11:30:21 [1191 | REPORT]: [2378|IRamanSpectraWorkChain|run_spectra]: submitting `HarmonicWorkChain` <PK=2380>
2024-03-20 11:30:23 [1192 | REPORT]: [2380|HarmonicWorkChain|run_phonon]: submitting `PhononWorkChain` <PK=2383>
2024-03-20 11:30:24 [1193 | REPORT]: [2380|HarmonicWorkChain|run_dielectric]: submitting `DielectricWorkChain` <PK=2384>
2024-03-20 11:30:24 [1194 | REPORT]: [2384|DielectricWorkChain|setup]: system is treated to be magnetic because `nspin != 1` in `scf.pw.parameters` input.
2024-03-20 11:30:24 [1195 | REPORT]: [2384|DielectricWorkChain|on_except]: Traceback (most recent call last):
File "/users/rkarkee/conda/envs/aiidaENV/lib/python3.11/site-packages/plumpy/process_states.py", line 228, in execute
result = self.run_fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/rkarkee/conda/envs/aiidaENV/lib/python3.11/site-packages/aiida/engine/processes/workchains/workchain.py", line 296, in run
return self._do_step()
^^^^^^^^^^^^^^^
File "/users/rkarkee/conda/envs/aiidaENV/lib/python3.11/site-packages/aiida/engine/processes/workchains/workchain.py", line 313, in _do_step
finished, stepper_result = self._stepper.step()
^^^^^^^^^^^^^^^^^^^^
File "/users/rkarkee/conda/envs/aiidaENV/lib/python3.11/site-packages/plumpy/workchains.py", line 295, in step
finished, result = self._child_stepper.step()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/rkarkee/conda/envs/aiidaENV/lib/python3.11/site-packages/plumpy/workchains.py", line 246, in step
return True, self._fn(self._workchain)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/rkarkee/conda/envs/aiidaENV/lib/python3.11/site-packages/aiida_vibroscopy/workflows/dielectric/base.py", line 377, in setup
raise NameError('Missing `*_magnetization` input in `scf.pw.parameters` while `nspin == 2`.')
NameError: Missing `*_magnetization` input in `scf.pw.parameters` while `nspin == 2`.
My inputs are:
overrides.yaml as:
clean_workdir: true # whether to clean the working directiories
dielectric:
clean_workdir: true
kpoints_parallel_distance: 0.2 # kpoints distance in Angstrom^-1 to sample the BZ parallel to the electric field. If used, it should help in converging faster the final results
property: raman
# central_difference: # if you know what you are doing, custom numerical derivatives with respect to electric field
# accuracy: 2
# electric_field_step: 0.0005
scf:
pseudo_family: CrSBr
kpoints_distance: 0.4 # kpoints distance in Angstrom^-1 to sample the BZ
kpoints_force_parity: false
max_iterations: 20
pw:
metadata:
options:
max_wallclock_seconds: 57600
resources:
num_machines: 1
num_mpiprocs_per_machine: 256
#queue_name: standard # for SLURM
# account: account_name # for SLURM, also for project etc
withmpi: true
settings:
cmdline: ['-pd', '.true.']
parameters:
ELECTRONS:
conv_thr: 2.0e-12
electron_maxstep: 100
mixing_beta: 0.3
SYSTEM:
ecutrho: 600.0
ecutwfc: 100.0
vdw_corr: Grimme-D2
occupations: smearing
degauss: 0.0002
nspin: 2
starting_magnetization(1): 2
settings:
sleep_submission_time: 1.0
phonon:
clean_workdir: true
displacement_generator:
distance: 0.005 # atomic displacements for phonon calculation, in Angstrom
scf:
pseudo_family: CrSBr
kpoints_distance: 0.15 # kpoints distance in Angstrom^-1 to sample the BZ
kpoints_force_parity: false
max_iterations: 20
pw:
metadata:
options:
max_wallclock_seconds: 57600
resources:
num_machines: 1
num_mpiprocs_per_machine: 256
# queue_name: partition_name # for SLURM
# account: account_name # for SLURM, also for project etc
withmpi: true
settings:
cmdline: ['-pd', '.true.']
# gamma_only: True # to use only if KpointsData has only a mesh 1 1 1 0 0 0 (i.e. Gamma not shifted)
parameters:
ELECTRONS:
conv_thr: 2.0e-12
electron_maxstep: 80
mixing_beta: 0.3
SYSTEM:
ecutwfc: 100.0
ecutrho: 600
vdw_corr: Grimme-D2
occupations: smearing
degauss: 0.0002
nspin: 2
starting_magnetization(1): 2
settings:
sleep_submission_time: 1.0 # waiting time in seconds between different submission of SCF calculation. Recommended to be at least 1 second, to not overload.
settings:
run_parallel: true
use_primitive_cell: false
symmetry:
distinguish_kinds: false
is_symmetry: true
symprec: 1.0e-05
and submitted through:
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long,wildcard-import,pointless-string-statement,unused-wildcard-import
"""Submit an IRamanSpectraWorkChain via the get_builder_from_protocol using the overrides."""
from pathlib import Path
from aiida import load_profile
from aiida.engine import submit
from aiida.orm import *
from aiida_quantumespresso.common.types import ElectronicType
from aiida_vibroscopy.workflows.spectra.iraman import IRamanSpectraWorkChain
load_profile()
# =============================== INPUTS =============================== #
# Please, change the following inputs.
mesh = [[10, 8, 5], [0.5, 0.5, 0.5]]
pseudo_family_name='CrSBr'
pw_code_label = 'qe-7.3@newhpc'
structure_id = 1681 # PK or UUID of your AiiDA StructureData
protocol = 'fast' # also 'moderate' and 'precise'; 'moderate' should be good enough in general
overrides_filepath = './overrides_crsbr.yaml' # should be a path, e.g. /path/to/overrides.yaml. Format is YAML
# Consult the documentation for HOW-TO for how to use properly the overrides.
# !!!!! FOR FULL INPUT NESTED STRUCTURE: https://aiida-vibroscopy.readthedocs.io/en/latest/topics/workflows/spectra/iraman.html
# You can follow the input structure provided on the website to fill further the overrides.
# ====================================================================== #
# If you don't have a StructureData, but you have a CIF or XYZ, or similar, file
# you can import your structure uncommenting the following:
# from ase.io import read
# atoms = read('/path/to/file.cif')
# structure = StructureData(ase=atoms)
# structure.store()
# structure_id = structure.pk
# print(f"Your structure has been stored in the database with PK={structure_id}")
def main():
"""Submit an IRamanSpectraWorkChain calculation."""
code = load_code(pw_code_label)
structure = load_node(structure_id)
kwargs = {'electronic_type': ElectronicType.INSULATOR}
kpoints = KpointsData()
kpoints.set_kpoints_mesh(mesh[0], mesh[1])
#pseudo_family = load_group(pseudo_family_name)
#pseudos = pseudo_family.get_pseudos(structure=structure)
builder = IRamanSpectraWorkChain.get_builder_from_protocol(
code=code,
structure=structure,
protocol=protocol,
overrides=Path(overrides_filepath),
**kwargs,
)
builder.dielectric.scf.kpoints = kpoints
builder.dielectric.pop('kpoints_parallel_distance', None)
builder.dielectric.scf.pop('kpoints_distance', None)
builder.phonon.scf.kpoints = kpoints
#builder.dielectric.scf.pw.pseudos = pseudos
#builder.phonon.scf.pw.pseudos = pseudos
calc=submit(builder)
print(f'Submitted IRamanSpectraWorkChain with PK={calc.pk} and UUID={calc.uuid}')
print('Register *at least* the PK number, e.g. in you submit script.')
print('You can monitor the status of your calculation with the following commands:')
print(' * verdi process status PK')
print(' * verdi process list -L IRamanSpectraWorkChain # list all running IRamanSpectraWorkChain')
print(
' * verdi process list -ap1 -L IRamanSpectraWorkChain # list all IRamanSpectraWorkChain submitted in the previous 1 day'
)
print('If the WorkChain finishes with exit code 0, then you can inspect the outputs and post-process the data.')
print('Use the command')
print(' * verdi process show PK')
print('To show further information about your WorkChain. When finished, you should see some outputs.')
print('The main output can be accessed via `load_node(PK).outputs.vibrational_data.numerical_accuracy_*`.')
print('You have to complete the remaning `*`, which depends upond the accuracy of the calculation.')
print('See also the documentation and the reference paper for further details.')
if __name__ == '__main__':
"""Run script."""
main()