Skip to content

Commit

Permalink
Merge pull request #122 from Exabyte-io/feat/SOF-7315
Browse files Browse the repository at this point in the history
SOF-7315: support constrained magnetization calculation in espresso
  • Loading branch information
pranabdas authored Apr 5, 2024
2 parents 22e97b9 + 4cfec90 commit 74a2847
Show file tree
Hide file tree
Showing 20 changed files with 720 additions and 29 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ jobs:
matrix:
node-version:
- 14.x
- 16.x
- 18.x
- 20.x

steps:
- name: Checkout this repository
Expand Down
57 changes: 57 additions & 0 deletions assets/espresso/pw_bands_dft_j_magn.j2.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{% if subworkflowContext.MATERIAL_INDEX %}
{%- set input = input.perMaterial[subworkflowContext.MATERIAL_INDEX] -%}
{% endif -%}
&CONTROL
calculation = 'bands'
title = ''
verbosity = 'low'
restart_mode = '{{input.RESTART_MODE}}'
wf_collect = .true.
tstress = .true.
tprnfor = .true.
outdir = {% raw %}'{{ JOB_WORK_DIR }}/outdir'{% endraw %}
wfcdir = {% raw %}'{{ JOB_WORK_DIR }}/outdir'{% endraw %}
prefix = '__prefix__'
pseudo_dir = {% raw %}'{{ JOB_WORK_DIR }}/pseudo'{% endraw %}
/
&SYSTEM
ibrav = {{ input.IBRAV }}
nat = {{ input.NAT }}
ntyp = {{ input.NTYP_WITH_LABELS }}
nspin = 2
ecutwfc = {{ cutoffs.wavefunction }}
ecutrho = {{ cutoffs.density }}
occupations = 'smearing'
degauss = 0.005
{%- if collinearMagnetization.isTotalMagnetization %}
tot_magnetization = {{ collinearMagnetization.totalMagnetization }}
{%- else %}
{%- for item in collinearMagnetization.startingMagnetization %}
starting_magnetization({{ item.index }}) = {{ item.value }} {% endfor -%}
{%- endif %}
/
&ELECTRONS
diagonalization = 'david'
diago_david_ndim = 4
diago_full_acc = .true.
mixing_beta = 0.3
/
&IONS
/
&CELL
/
ATOMIC_SPECIES
{{ input.ATOMIC_SPECIES_WITH_LABELS }}
ATOMIC_POSITIONS crystal
{{ input.ATOMIC_POSITIONS }}
CELL_PARAMETERS angstrom
{{ input.CELL_PARAMETERS }}
K_POINTS crystal_b
{{kpath.length}}
{% for point in kpath -%}
{% for d in point.coordinates %}{{d}} {% endfor -%}{{point.steps}}
{% endfor %}
HUBBARD {ortho-atomic}
{% for row in hubbard_j -%}
{{ row.paramType }} {{ row.atomicSpecies }}-{{ row.atomicOrbital }} {{ row.value }}
{% endfor -%}
57 changes: 57 additions & 0 deletions assets/espresso/pw_bands_dft_u_magn.j2.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{% if subworkflowContext.MATERIAL_INDEX %}
{%- set input = input.perMaterial[subworkflowContext.MATERIAL_INDEX] -%}
{% endif -%}
&CONTROL
calculation = 'bands'
title = ''
verbosity = 'low'
restart_mode = '{{input.RESTART_MODE}}'
wf_collect = .true.
tstress = .true.
tprnfor = .true.
outdir = {% raw %}'{{ JOB_WORK_DIR }}/outdir'{% endraw %}
wfcdir = {% raw %}'{{ JOB_WORK_DIR }}/outdir'{% endraw %}
prefix = '__prefix__'
pseudo_dir = {% raw %}'{{ JOB_WORK_DIR }}/pseudo'{% endraw %}
/
&SYSTEM
ibrav = {{ input.IBRAV }}
nat = {{ input.NAT }}
ntyp = {{ input.NTYP_WITH_LABELS }}
nspin = 2
ecutwfc = {{ cutoffs.wavefunction }}
ecutrho = {{ cutoffs.density }}
occupations = 'smearing'
degauss = 0.005
{%- if collinearMagnetization.isTotalMagnetization %}
tot_magnetization = {{ collinearMagnetization.totalMagnetization }}
{%- else %}
{%- for item in collinearMagnetization.startingMagnetization %}
starting_magnetization({{ item.index }}) = {{ item.value }} {% endfor -%}
{%- endif %}
/
&ELECTRONS
diagonalization = 'david'
diago_david_ndim = 4
diago_full_acc = .true.
mixing_beta = 0.3
/
&IONS
/
&CELL
/
ATOMIC_SPECIES
{{ input.ATOMIC_SPECIES_WITH_LABELS }}
ATOMIC_POSITIONS crystal
{{ input.ATOMIC_POSITIONS }}
CELL_PARAMETERS angstrom
{{ input.CELL_PARAMETERS }}
K_POINTS crystal_b
{{kpath.length}}
{% for point in kpath -%}
{% for d in point.coordinates %}{{d}} {% endfor -%}{{point.steps}}
{% endfor %}
HUBBARD {ortho-atomic}
{% for row in hubbard_u -%}
U {{ row.atomicSpecies }}-{{ row.atomicOrbital }} {{ row.hubbardUValue }}
{% endfor -%}
59 changes: 59 additions & 0 deletions assets/espresso/pw_bands_dft_u_magn_legacy.j2.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{% if subworkflowContext.MATERIAL_INDEX %}
{%- set input = input.perMaterial[subworkflowContext.MATERIAL_INDEX] -%}
{% endif -%}
&CONTROL
calculation = 'bands'
title = ''
verbosity = 'low'
restart_mode = '{{input.RESTART_MODE}}'
wf_collect = .true.
tstress = .true.
tprnfor = .true.
outdir = {% raw %}'{{ JOB_WORK_DIR }}/outdir'{% endraw %}
wfcdir = {% raw %}'{{ JOB_WORK_DIR }}/outdir'{% endraw %}
prefix = '__prefix__'
pseudo_dir = {% raw %}'{{ JOB_WORK_DIR }}/pseudo'{% endraw %}
/
&SYSTEM
ibrav = {{ input.IBRAV }}
nat = {{ input.NAT }}
ntyp = {{ input.NTYP_WITH_LABELS }}
nspin = 2
ecutwfc = {{ cutoffs.wavefunction }}
ecutrho = {{ cutoffs.density }}
occupations = 'smearing'
degauss = 0.005
lda_plus_u = .true.
lda_plus_u_kind = 0
U_projection_type = 'ortho-atomic'
{%- for row in hubbard_legacy %}
Hubbard_U({{ row.atomicSpeciesIndex }}) = {{ row.hubbardUValue }}
{%- endfor %}
{%- if collinearMagnetization.isTotalMagnetization %}
tot_magnetization = {{ collinearMagnetization.totalMagnetization }}
{%- else %}
{%- for item in collinearMagnetization.startingMagnetization %}
starting_magnetization({{ item.index }}) = {{ item.value }} {% endfor -%}
{%- endif %}
/
&ELECTRONS
diagonalization = 'david'
diago_david_ndim = 4
diago_full_acc = .true.
mixing_beta = 0.3
/
&IONS
/
&CELL
/
ATOMIC_SPECIES
{{ input.ATOMIC_SPECIES_WITH_LABELS }}
ATOMIC_POSITIONS crystal
{{ input.ATOMIC_POSITIONS }}
CELL_PARAMETERS angstrom
{{ input.CELL_PARAMETERS }}
K_POINTS crystal_b
{{kpath.length}}
{% for point in kpath -%}
{% for d in point.coordinates %}{{d}} {% endfor -%}{{point.steps}}
{% endfor %}
60 changes: 60 additions & 0 deletions assets/espresso/pw_bands_dft_v_magn.j2.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{% if subworkflowContext.MATERIAL_INDEX %}
{%- set input = input.perMaterial[subworkflowContext.MATERIAL_INDEX] -%}
{% endif -%}
&CONTROL
calculation = 'bands'
title = ''
verbosity = 'low'
restart_mode = '{{input.RESTART_MODE}}'
wf_collect = .true.
tstress = .true.
tprnfor = .true.
outdir = {% raw %}'{{ JOB_WORK_DIR }}/outdir'{% endraw %}
wfcdir = {% raw %}'{{ JOB_WORK_DIR }}/outdir'{% endraw %}
prefix = '__prefix__'
pseudo_dir = {% raw %}'{{ JOB_WORK_DIR }}/pseudo'{% endraw %}
/
&SYSTEM
ibrav = {{ input.IBRAV }}
nat = {{ input.NAT }}
ntyp = {{ input.NTYP_WITH_LABELS }}
nspin = 2
ecutwfc = {{ cutoffs.wavefunction }}
ecutrho = {{ cutoffs.density }}
occupations = 'smearing'
degauss = 0.005
{%- if collinearMagnetization.isTotalMagnetization %}
tot_magnetization = {{ collinearMagnetization.totalMagnetization }}
{%- else %}
{%- for item in collinearMagnetization.startingMagnetization %}
starting_magnetization({{ item.index }}) = {{ item.value }} {% endfor -%}
{%- endif %}
/
&ELECTRONS
diagonalization = 'david'
diago_david_ndim = 4
diago_full_acc = .true.
mixing_beta = 0.3
/
&IONS
/
&CELL
/
ATOMIC_SPECIES
{{ input.ATOMIC_SPECIES_WITH_LABELS }}
ATOMIC_POSITIONS crystal
{{ input.ATOMIC_POSITIONS }}
CELL_PARAMETERS angstrom
{{ input.CELL_PARAMETERS }}
K_POINTS crystal_b
{{kpath.length}}
{% for point in kpath -%}
{% for d in point.coordinates %}{{d}} {% endfor -%}{{point.steps}}
{% endfor %}
HUBBARD {ortho-atomic}
{% for row in hubbard_u -%}
U {{ row.atomicSpecies }}-{{ row.atomicOrbital }} {{ row.hubbardUValue }}
{% endfor -%}
{% for row in hubbard_v -%}
V {{ row.atomicSpecies }}-{{ row.atomicOrbital }} {{ row.atomicSpecies2 }}-{{ row.atomicOrbital2 }} {{ row.siteIndex }} {{ row.siteIndex2 }} {{ row.hubbardVValue }}
{% endfor -%}
9 changes: 6 additions & 3 deletions assets/espresso/pw_bands_magn.j2.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@
ecutrho = {{ cutoffs.density }}
occupations = 'smearing'
degauss = 0.005
{%- for item in starting_magnetization %}
starting_magnetization({{ item.index }}) = {{ item.value }}
{%- endfor %}
{%- if collinearMagnetization.isTotalMagnetization %}
tot_magnetization = {{ collinearMagnetization.totalMagnetization }}
{%- else %}
{%- for item in collinearMagnetization.startingMagnetization %}
starting_magnetization({{ item.index }}) = {{ item.value }} {% endfor -%}
{%- endif %}
/
&ELECTRONS
diagonalization = 'david'
Expand Down
55 changes: 55 additions & 0 deletions assets/espresso/pw_nscf_dft_j_magn.j2.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
&CONTROL
calculation = 'nscf'
title = ''
verbosity = 'low'
restart_mode = '{{input.RESTART_MODE}}'
wf_collect = .true.
tstress = .true.
tprnfor = .true.
outdir = {% raw %}'{{ JOB_WORK_DIR }}/outdir'{% endraw %}
wfcdir = {% raw %}'{{ JOB_WORK_DIR }}/outdir'{% endraw %}
prefix = '__prefix__'
pseudo_dir = {% raw %}'{{ JOB_WORK_DIR }}/pseudo'{% endraw %}
/
&SYSTEM
ibrav = {{ input.IBRAV }}
nat = {{ input.NAT }}
ntyp = {{ input.NTYP_WITH_LABELS }}
nspin = 2
ecutwfc = {{ cutoffs.wavefunction }}
ecutrho = {{ cutoffs.density }}
occupations = 'smearing'
degauss = 0.005
{%- if collinearMagnetization.isTotalMagnetization %}
tot_magnetization = {{ collinearMagnetization.totalMagnetization }}
{%- else %}
{%- for item in collinearMagnetization.startingMagnetization %}
starting_magnetization({{ item.index }}) = {{ item.value }} {% endfor -%}
{%- endif %}
{%- if subworkflowContext.NO_SYMMETRY_NO_INVERSION %}
nosym = .true.
noinv = .true.
{%- endif %}
/
&ELECTRONS
diagonalization = 'david'
diago_david_ndim = 4
diago_full_acc = .true.
mixing_beta = 0.3
/
&IONS
/
&CELL
/
ATOMIC_SPECIES
{{ input.ATOMIC_SPECIES_WITH_LABELS }}
ATOMIC_POSITIONS crystal
{{ input.ATOMIC_POSITIONS }}
CELL_PARAMETERS angstrom
{{ input.CELL_PARAMETERS }}
K_POINTS automatic
{% for d in kgrid.dimensions %}{{d}} {% endfor %}{% for s in kgrid.shifts %}{{s}} {% endfor %}
HUBBARD {ortho-atomic}
{% for row in hubbard_j -%}
{{ row.paramType }} {{ row.atomicSpecies }}-{{ row.atomicOrbital }} {{ row.value }}
{% endfor -%}
55 changes: 55 additions & 0 deletions assets/espresso/pw_nscf_dft_u_magn.j2.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
&CONTROL
calculation = 'nscf'
title = ''
verbosity = 'low'
restart_mode = '{{input.RESTART_MODE}}'
wf_collect = .true.
tstress = .true.
tprnfor = .true.
outdir = {% raw %}'{{ JOB_WORK_DIR }}/outdir'{% endraw %}
wfcdir = {% raw %}'{{ JOB_WORK_DIR }}/outdir'{% endraw %}
prefix = '__prefix__'
pseudo_dir = {% raw %}'{{ JOB_WORK_DIR }}/pseudo'{% endraw %}
/
&SYSTEM
ibrav = {{ input.IBRAV }}
nat = {{ input.NAT }}
ntyp = {{ input.NTYP_WITH_LABELS }}
nspin = 2
ecutwfc = {{ cutoffs.wavefunction }}
ecutrho = {{ cutoffs.density }}
occupations = 'smearing'
degauss = 0.005
{%- if collinearMagnetization.isTotalMagnetization %}
tot_magnetization = {{ collinearMagnetization.totalMagnetization }}
{%- else %}
{%- for item in collinearMagnetization.startingMagnetization %}
starting_magnetization({{ item.index }}) = {{ item.value }} {% endfor -%}
{%- endif %}
{%- if subworkflowContext.NO_SYMMETRY_NO_INVERSION %}
nosym = .true.
noinv = .true.
{%- endif %}
/
&ELECTRONS
diagonalization = 'david'
diago_david_ndim = 4
diago_full_acc = .true.
mixing_beta = 0.3
/
&IONS
/
&CELL
/
ATOMIC_SPECIES
{{ input.ATOMIC_SPECIES_WITH_LABELS }}
ATOMIC_POSITIONS crystal
{{ input.ATOMIC_POSITIONS }}
CELL_PARAMETERS angstrom
{{ input.CELL_PARAMETERS }}
K_POINTS automatic
{% for d in kgrid.dimensions %}{{d}} {% endfor %}{% for s in kgrid.shifts %}{{s}} {% endfor %}
HUBBARD {ortho-atomic}
{% for row in hubbard_u -%}
U {{ row.atomicSpecies }}-{{ row.atomicOrbital }} {{ row.hubbardUValue }}
{% endfor -%}
Loading

0 comments on commit 74a2847

Please sign in to comment.