Skip to content

Commit

Permalink
Merge pull request #120 from Exabyte-io/feat/SOF-7297
Browse files Browse the repository at this point in the history
SOF-7297: add magnetic flavors to DFT+U calculation
  • Loading branch information
pranabdas authored Mar 29, 2024
2 parents b10e69b + 97a0ff1 commit 22e97b9
Show file tree
Hide file tree
Showing 8 changed files with 352 additions and 2 deletions.
52 changes: 52 additions & 0 deletions assets/espresso/pw_scf_dft_j_magn.j2.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{% if subworkflowContext.MATERIAL_INDEX %}
{%- set input = input.perMaterial[subworkflowContext.MATERIAL_INDEX] -%}
{% endif -%}
&CONTROL
calculation = 'scf'
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
{%- for item in starting_magnetization %}
starting_magnetization({{ item.index }}) = {{ item.value }}
{%- endfor %}
/
&ELECTRONS
diagonalization = 'david'
diago_david_ndim = 4
diago_full_acc = .true.
mixing_beta = 0.3
startingwfc = 'atomic+random'
/
&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 -%}
54 changes: 54 additions & 0 deletions assets/espresso/pw_scf_dft_u_legacy_magn.j2.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{% if subworkflowContext.MATERIAL_INDEX %}
{%- set input = input.perMaterial[subworkflowContext.MATERIAL_INDEX] -%}
{% endif -%}
&CONTROL
calculation = 'scf'
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 %}
{%- for item in starting_magnetization %}
starting_magnetization({{ item.index }}) = {{ item.value }}
{%- endfor %}
/
&ELECTRONS
diagonalization = 'david'
diago_david_ndim = 4
diago_full_acc = .true.
mixing_beta = 0.3
startingwfc = 'atomic+random'
/
&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 %}
52 changes: 52 additions & 0 deletions assets/espresso/pw_scf_dft_u_magn.j2.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{% if subworkflowContext.MATERIAL_INDEX %}
{%- set input = input.perMaterial[subworkflowContext.MATERIAL_INDEX] -%}
{% endif -%}
&CONTROL
calculation = 'scf'
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
{%- for item in starting_magnetization %}
starting_magnetization({{ item.index }}) = {{ item.value }}
{%- endfor %}
/
&ELECTRONS
diagonalization = 'david'
diago_david_ndim = 4
diago_full_acc = .true.
mixing_beta = 0.3
startingwfc = 'atomic+random'
/
&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 -%}
55 changes: 55 additions & 0 deletions assets/espresso/pw_scf_dft_v_magn.j2.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{% if subworkflowContext.MATERIAL_INDEX %}
{%- set input = input.perMaterial[subworkflowContext.MATERIAL_INDEX] -%}
{% endif -%}
&CONTROL
calculation = 'scf'
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
{%- for item in starting_magnetization %}
starting_magnetization({{ item.index }}) = {{ item.value }}
{%- endfor %}
/
&ELECTRONS
diagonalization = 'david'
diago_david_ndim = 4
diago_full_acc = .true.
mixing_beta = 0.3
startingwfc = 'atomic+random'
/
&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 -%}
{% for row in hubbard_v -%}
V {{ row.atomicSpecies }}-{{ row.atomicOrbital }} {{ row.atomicSpecies2 }}-{{ row.atomicOrbital2 }} {{ row.siteIndex }} {{ row.siteIndex2 }} {{ row.hubbardVValue }}
{% endfor -%}
92 changes: 92 additions & 0 deletions executables/espresso/pw.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,98 @@ flavors:
applicationName: espresso
executableName: pw.x

pw_scf_dft_u_magn:
input:
- name: pw_scf_dft_u_magn.in
results:
- atomic_forces
- band_gaps
- fermi_energy
- pressure
- stress_tensor
- total_energy
- total_energy_contributions
- total_force
monitors:
- standard_output
- convergence_electronic
applicationName: espresso
executableName: pw.x
supportedApplicationVersions:
- '7.2'
- '7.3'

pw_scf_dft_u+v_magn:
input:
- name: pw_scf_dft_v_magn.in
results:
- atomic_forces
- band_gaps
- fermi_energy
- pressure
- stress_tensor
- total_energy
- total_energy_contributions
- total_force
monitors:
- standard_output
- convergence_electronic
applicationName: espresso
executableName: pw.x
supportedApplicationVersions:
- '7.2'
- '7.3'

pw_scf_dft_u+j_magn:
input:
- name: pw_scf_dft_j_magn.in
results:
- atomic_forces
- band_gaps
- fermi_energy
- pressure
- stress_tensor
- total_energy
- total_energy_contributions
- total_force
monitors:
- standard_output
- convergence_electronic
applicationName: espresso
executableName: pw.x
supportedApplicationVersions:
- '7.2'
- '7.3'

pw_scf_dft_u_legacy_magn:
input:
- name: pw_scf_dft_u_legacy_magn.in
results:
- atomic_forces
- band_gaps
- fermi_energy
- pressure
- stress_tensor
- total_energy
- total_energy_contributions
- total_force
monitors:
- standard_output
- convergence_electronic
applicationName: espresso
executableName: pw.x
supportedApplicationVersions:
- '5.2.1'
- '5.4.0'
- '6.0.0'
- '6.3'
- '6.4.1'
- '6.5.0'
- '6.6.0'
- '6.7.0'
- '6.8.0'
- '7.0'

pw_esm:
input:
- name: pw_esm.in
Expand Down
2 changes: 1 addition & 1 deletion src/js/data/templates.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/data/tree.js

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions templates/espresso/pw.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,51 @@
applicationName: espresso
executableName: pw.x

- content: !readFile 'assets/espresso/pw_scf_dft_u_magn.j2.in'
name: pw_scf_dft_u_magn.in
contextProviders:
- name: KGridFormDataManager
- name: QEPWXInputDataManager
- name: PlanewaveCutoffDataManager
- name: HubbardUContextManager
- name: CollinearMagnetizationDataManager
applicationName: espresso
executableName: pw.x

- content: !readFile 'assets/espresso/pw_scf_dft_v_magn.j2.in'
name: pw_scf_dft_v_magn.in
contextProviders:
- name: KGridFormDataManager
- name: QEPWXInputDataManager
- name: PlanewaveCutoffDataManager
- name: HubbardUContextManager
- name: HubbardVContextManager
- name: CollinearMagnetizationDataManager
applicationName: espresso
executableName: pw.x

- content: !readFile 'assets/espresso/pw_scf_dft_j_magn.j2.in'
name: pw_scf_dft_j_magn.in
contextProviders:
- name: KGridFormDataManager
- name: QEPWXInputDataManager
- name: PlanewaveCutoffDataManager
- name: HubbardJContextManager
- name: CollinearMagnetizationDataManager
applicationName: espresso
executableName: pw.x

- content: !readFile 'assets/espresso/pw_scf_dft_u_legacy_magn.j2.in'
name: pw_scf_dft_u_legacy_magn.in
contextProviders:
- name: KGridFormDataManager
- name: QEPWXInputDataManager
- name: PlanewaveCutoffDataManager
- name: HubbardContextManagerLegacy
- name: CollinearMagnetizationDataManager
applicationName: espresso
executableName: pw.x

- content: !readFile 'assets/espresso/pw_md.j2.in'
name: pw_md.in
contextProviders:
Expand Down

0 comments on commit 22e97b9

Please sign in to comment.