Skip to content

Commit

Permalink
Using Diamond structure for Lanthanides and remove magnitization in c…
Browse files Browse the repository at this point in the history
…alculation
  • Loading branch information
unkcpz committed Mar 27, 2024
1 parent 6bf69c1 commit cd125ab
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 79 deletions.
21 changes: 16 additions & 5 deletions aiida_sssp_workflow/cli/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,21 +260,31 @@ def analyze(group, output, ylimit):
for configuration in ACWF_CONFIGURATIONS:
res = node.outputs.measure.precision[configuration]["output_parameters"]

nu = res["rel_errors_vec_length"]
y_nu.append(nu)
try:
nu = res["rel_errors_vec_length"]
except KeyError:
y_nu.append(None)
else:
y_nu.append(nu)

xs = np.arange(len(ACWF_CONFIGURATIONS))

# Find index where y_nu is None
none_index = [i for i, x in enumerate(y_nu) if x is None]

x = np.arange(len(ACWF_CONFIGURATIONS))
# Remove None from y_nu and xs
y_nu = np.array([x for x in y_nu if x is not None])
xs = np.array([x for i, x in enumerate(xs) if i not in none_index])

ax.bar(
x + width * i,
xs + width * i,
y_nu,
width,
color=cmap(pseudo_info),
edgecolor="black",
linewidth=1,
label=pseudo_info["representive_label"],
)
ax.set_title(f"X={element}")

d = 0.01 # offset for the text

Expand All @@ -285,6 +295,7 @@ def analyze(group, output, ylimit):
ax.legend(loc="upper right", prop={"size": 10})
ax.set_ylabel("ν -factor")
ax.set_ylim([0, ylimit])
ax.set_title(f"X={element}")

xticks_shift = len(nodes_lst) * width / 2
xticks = [i + xticks_shift for i in range(len(ACWF_CONFIGURATIONS))]
Expand Down
9 changes: 1 addition & 8 deletions aiida_sssp_workflow/statics/generatemapping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
" if e in MAGNETIC_ELEMENTS:\n",
" d[e] = {\n",
" \"bands\": f\"GS\",\n",
" \"convergence\": f\"GS\",\n",
" \"convergence\": f\"Diamond\",\n",
" }\n",
" continue\n",
"\n",
Expand All @@ -228,13 +228,6 @@
"with open(\"./structures/mapping.json\", \"w\") as f:\n",
" json.dump(d, f, indent=4)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
12 changes: 6 additions & 6 deletions aiida_sssp_workflow/statics/structures/mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@
},
"Co": {
"bands": "GS",
"convergence": "GS"
"convergence": "Diamond"
},
"Cr": {
"bands": "GS",
"convergence": "GS"
"convergence": "Diamond"
},
"Cs": {
"bands": "GS",
Expand All @@ -94,7 +94,7 @@
},
"Fe": {
"bands": "GS",
"convergence": "GS"
"convergence": "Diamond"
},
"F": {
"bands": "GS",
Expand Down Expand Up @@ -170,7 +170,7 @@
},
"Mn": {
"bands": "GS",
"convergence": "GS"
"convergence": "Diamond"
},
"Mo": {
"bands": "GS",
Expand Down Expand Up @@ -198,11 +198,11 @@
},
"Ni": {
"bands": "GS",
"convergence": "GS"
"convergence": "Diamond"
},
"O": {
"bands": "GS",
"convergence": "GS"
"convergence": "Diamond"
},
"Os": {
"bands": "GS",
Expand Down
11 changes: 6 additions & 5 deletions aiida_sssp_workflow/workflows/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ def get_extra_parameters_for_lanthanides(element, nbnd) -> dict:
"""
extra_parameters = {
"SYSTEM": {
"nspin": 2,
"starting_magnetization": {
element: 0.5,
},
# update on 2024-03-27: remove the magnetization for RE
# "nspin": 2,
# "starting_magnetization": {
# element: 0.5,
# },
"nbnd": int(nbnd),
},
"ELECTRONS": {
# It usually takes more steps to converge the SCF for lanthanides and actinides
"diagonalization": "cg",
"mixing_beta": 0.5,
"electron_maxstep": 200,
},
}
Expand Down
4 changes: 1 addition & 3 deletions aiida_sssp_workflow/workflows/convergence/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,8 @@ def extra_setup_for_lanthanide_element(self):
Otherwise it is hard to get converged in scf calculation.
"""
nbnd_factor = self._NBANDS_FACTOR_FOR_REN
pseudo_N = get_pseudo_N()
self.ctx.pseudos["N"] = pseudo_N
pseudo_RE = self.inputs.pseudo
nbnd = nbnd_factor * (pseudo_N.z_valence + pseudo_RE.z_valence)
nbnd = nbnd_factor * pseudo_RE.z_valence
self.ctx.extra_pw_parameters = get_extra_parameters_for_lanthanides(
self.ctx.element, nbnd
)
Expand Down
4 changes: 2 additions & 2 deletions setup-yaml/computer-setup-daint-mem.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
label: "daint-mc-mrcloud-mem"
label: "daint-psi15-mem"
hostname: "daint.cscs.ch"
description: Piz Daint supercomputer at CSCS Lugano, Switzerland, multicore partition.
transport: "core.ssh"
Expand All @@ -13,7 +13,7 @@ prepend_text: |
#SBATCH --partition=normal
#SBATCH --constraint=mc
#SBATCH --cpus-per-task=1
#SBATCH --account="mrcloud"
#SBATCH --account="psi15"
#SBATCH --mem=120GB
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
source $MODULESHOME/init/bash
Expand Down
21 changes: 0 additions & 21 deletions setup-yaml/computer-setup-daint.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion setup-yaml/ph7.0-daint-mem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
label: "ph-7.0"
description: "PH compiled for daint-mc"
default_calc_job_plugin: "quantumespresso.ph"
computer: "daint-mc-mrcloud-mem"
computer: "daint-psi15-mem"
filepath_executable: "/apps/dom/UES/jenkins/7.0.UP03/21.09/dom-mc/software/QuantumESPRESSO/7.0-CrayIntel-21.09/bin/ph.x"
prepend_text: |
module load daint-mc
Expand Down
10 changes: 0 additions & 10 deletions setup-yaml/ph7.0-daint.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion setup-yaml/pw7.0-daint-mem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
label: "pw-7.0"
description: "PW compiled for daint-mc"
default_calc_job_plugin: "quantumespresso.pw"
computer: "daint-mc-mrcloud-mem"
computer: "daint-psi15-mem"
filepath_executable: "/apps/dom/UES/jenkins/7.0.UP03/21.09/dom-mc/software/QuantumESPRESSO/7.0-CrayIntel-21.09/bin/pw.x"
prepend_text: |
module load daint-mc
Expand Down
10 changes: 0 additions & 10 deletions setup-yaml/pw7.0-daint.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
#\n# For information on this file format, follow the CIF links at\n# http://www.iucr.org\n\
##########################################################################\n\ndata_0\n\
\nloop_\n _atom_site_label\n _atom_site_fract_x\n _atom_site_fract_y\n _atom_site_fract_z\n\
\ _atom_site_type_symbol\n Fe1 0.0 0.0 0.0 Fe \
\ \n Fe2 0.5 0.5 0.5 Fe \n_cell_angle_alpha\
\ 90.0\n_cell_angle_beta 90.0\n_cell_angle_gamma\
\ 90.0\n_cell_length_a 2.83351\n\
_cell_length_b 2.83351\n_cell_length_c \
\ 2.83351\nloop_\n _symmetry_equiv_pos_as_xyz\n 'x, y, z' \n_symmetry_int_tables_number\
\ 1\n_symmetry_space_group_name_H-M 'P 1'"
\ _atom_site_type_symbol\n Fe1 0.5 0.5 0.5 Fe \
\ \n Fe2 0.75 0.75 0.75 Fe \n_cell_angle_alpha\
\ 60.00000000000001\n_cell_angle_beta \
\ 60.00000000000001\n_cell_angle_gamma 60.00000000000001\n\
_cell_length_a 3.4460197248582936\n_cell_length_b \
\ 3.4460197248582936\n_cell_length_c \
\ 3.4460197248582936\nloop_\n _symmetry_equiv_pos_as_xyz\n 'x, y, z'\
\ \n_symmetry_int_tables_number 1\n_symmetry_space_group_name_H-M \
\ 'P 1'"

0 comments on commit cd125ab

Please sign in to comment.