diff --git a/pyproject.toml b/pyproject.toml index a72995c2..529761e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ requires-python = ">=3.9" dependencies = [ "aiida-core>=2.0,<3", "aiida-pseudo>=0.6", - "aiida-quantumespresso>=4.4", + "aiida-quantumespresso>=4.12", "aiida-wannier90>=2.2", "click>=8.0", "colorama" diff --git a/src/aiida_wannier90_workflows/workflows/wannier90.py b/src/aiida_wannier90_workflows/workflows/wannier90.py index 7568af6a..12cf62cf 100644 --- a/src/aiida_wannier90_workflows/workflows/wannier90.py +++ b/src/aiida_wannier90_workflows/workflows/wannier90.py @@ -478,29 +478,15 @@ def get_builder_from_protocol( # pylint: disable=unused-argument ]["pseudo_family"] ) - # As PwBaseWorkChain.get_builder_from_protocol() does not support SOC, we have to pass the - # desired parameters through the overrides. In this case we need to set the `pw.x` - # spin_type to SpinType.NONE, otherwise the builder will raise an error. - # This block should be removed once SOC is supported in PwBaseWorkChain. + # PwBaseWorkChain.get_builder_from_protocol handles SOC/non-collinear natively + # (sets noncolin/nspin/lspinorb and seeds starting_magnetization), so pass + # spin_type straight through. SOC is magnetically initialized by default. spin_orbit_coupling = spin_type == SpinType.SPIN_ORBIT spin_non_collinear = ( spin_type == SpinType.NON_COLLINEAR ) or spin_orbit_coupling - if spin_type == SpinType.NON_COLLINEAR: - overrides = recursive_merge( - protocol_overrides["spin_noncollinear"], overrides - ) - if spin_type == SpinType.SPIN_ORBIT: - overrides = recursive_merge(protocol_overrides["spin_orbit"], overrides) - if (initial_magnetic_moments is not None) or any( - "magmom" in kind for kind in structure.base.attributes.all["kinds"] - ): - pw_spin_type = SpinType.NON_COLLINEAR - else: - pw_spin_type = SpinType.NONE - else: - pw_spin_type = spin_type + pw_spin_type = spin_type inputs = cls.get_protocol_inputs(protocol=protocol, overrides=overrides) diff --git a/tests/workflows/protocols/test_bands/test_spin_orbit_BaTiO3_.yml b/tests/workflows/protocols/test_bands/test_spin_orbit_BaTiO3_.yml index 13551d0d..3a717a6d 100644 --- a/tests/workflows/protocols/test_bands/test_spin_orbit_BaTiO3_.yml +++ b/tests/workflows/protocols/test_bands/test_spin_orbit_BaTiO3_.yml @@ -27,6 +27,14 @@ nscf: mixing_beta: 0.4 startingpot: file SYSTEM: + angle1: + Ba: 0.0 + O: 0.0 + Ti: 0.0 + angle2: + Ba: 0.0 + O: 0.0 + Ti: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 @@ -35,8 +43,13 @@ nscf: noinv: true noncolin: true nosym: true + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + Ba: 0.1 + O: 0.1 + Ti: 0.4166666666666667 pseudos: Ba: Ba.upf O: O.upf @@ -91,14 +104,27 @@ scf: electron_maxstep: 80 mixing_beta: 0.4 SYSTEM: + angle1: + Ba: 0.0 + O: 0.0 + Ti: 0.0 + angle2: + Ba: 0.0 + O: 0.0 + Ti: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 lspinorb: true noncolin: true nosym: false + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + Ba: 0.1 + O: 0.1 + Ti: 0.4166666666666667 pseudos: Ba: Ba.upf O: O.upf diff --git a/tests/workflows/protocols/test_bands/test_spin_orbit_GaAs_.yml b/tests/workflows/protocols/test_bands/test_spin_orbit_GaAs_.yml index dcf829ee..8f5ec775 100644 --- a/tests/workflows/protocols/test_bands/test_spin_orbit_GaAs_.yml +++ b/tests/workflows/protocols/test_bands/test_spin_orbit_GaAs_.yml @@ -27,6 +27,12 @@ nscf: mixing_beta: 0.4 startingpot: file SYSTEM: + angle1: + As: 0.0 + Ga: 0.0 + angle2: + As: 0.0 + Ga: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 @@ -35,8 +41,12 @@ nscf: noinv: true noncolin: true nosym: true + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + As: 0.1 + Ga: 0.1 pseudos: As: As.upf Ga: Ga.upf @@ -90,14 +100,24 @@ scf: electron_maxstep: 80 mixing_beta: 0.4 SYSTEM: + angle1: + As: 0.0 + Ga: 0.0 + angle2: + As: 0.0 + Ga: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 lspinorb: true noncolin: true nosym: false + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + As: 0.1 + Ga: 0.1 pseudos: As: As.upf Ga: Ga.upf diff --git a/tests/workflows/protocols/test_bands/test_spin_orbit_H2O_.yml b/tests/workflows/protocols/test_bands/test_spin_orbit_H2O_.yml index 734af64a..df8305c7 100644 --- a/tests/workflows/protocols/test_bands/test_spin_orbit_H2O_.yml +++ b/tests/workflows/protocols/test_bands/test_spin_orbit_H2O_.yml @@ -27,6 +27,12 @@ nscf: mixing_beta: 0.4 startingpot: file SYSTEM: + angle1: + H: 0.0 + O: 0.0 + angle2: + H: 0.0 + O: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 @@ -35,8 +41,12 @@ nscf: noinv: true noncolin: true nosym: true + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + H: 0.1 + O: 0.1 pseudos: H: H.upf O: O.upf @@ -90,14 +100,24 @@ scf: electron_maxstep: 80 mixing_beta: 0.4 SYSTEM: + angle1: + H: 0.0 + O: 0.0 + angle2: + H: 0.0 + O: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 lspinorb: true noncolin: true nosym: false + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + H: 0.1 + O: 0.1 pseudos: H: H.upf O: O.upf diff --git a/tests/workflows/protocols/test_bands/test_spin_orbit_Si_.yml b/tests/workflows/protocols/test_bands/test_spin_orbit_Si_.yml index 70ab2872..6fb16f9e 100644 --- a/tests/workflows/protocols/test_bands/test_spin_orbit_Si_.yml +++ b/tests/workflows/protocols/test_bands/test_spin_orbit_Si_.yml @@ -27,6 +27,10 @@ nscf: mixing_beta: 0.4 startingpot: file SYSTEM: + angle1: + Si: 0.0 + angle2: + Si: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 @@ -35,8 +39,11 @@ nscf: noinv: true noncolin: true nosym: true + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + Si: 0.1 pseudos: Si: Si.upf projwfc: @@ -89,14 +96,21 @@ scf: electron_maxstep: 80 mixing_beta: 0.4 SYSTEM: + angle1: + Si: 0.0 + angle2: + Si: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 lspinorb: true noncolin: true nosym: false + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + Si: 0.1 pseudos: Si: Si.upf structure: Si2 diff --git a/tests/workflows/protocols/test_optimize/test_spin_orbit_BaTiO3_.yml b/tests/workflows/protocols/test_optimize/test_spin_orbit_BaTiO3_.yml index 6e1bc109..0742e222 100644 --- a/tests/workflows/protocols/test_optimize/test_spin_orbit_BaTiO3_.yml +++ b/tests/workflows/protocols/test_optimize/test_spin_orbit_BaTiO3_.yml @@ -27,6 +27,14 @@ nscf: mixing_beta: 0.4 startingpot: file SYSTEM: + angle1: + Ba: 0.0 + O: 0.0 + Ti: 0.0 + angle2: + Ba: 0.0 + O: 0.0 + Ti: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 @@ -35,8 +43,13 @@ nscf: noinv: true noncolin: true nosym: true + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + Ba: 0.1 + O: 0.1 + Ti: 0.4166666666666667 pseudos: Ba: Ba.upf O: O.upf @@ -96,14 +109,27 @@ scf: electron_maxstep: 80 mixing_beta: 0.4 SYSTEM: + angle1: + Ba: 0.0 + O: 0.0 + Ti: 0.0 + angle2: + Ba: 0.0 + O: 0.0 + Ti: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 lspinorb: true noncolin: true nosym: false + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + Ba: 0.1 + O: 0.1 + Ti: 0.4166666666666667 pseudos: Ba: Ba.upf O: O.upf diff --git a/tests/workflows/protocols/test_optimize/test_spin_orbit_GaAs_.yml b/tests/workflows/protocols/test_optimize/test_spin_orbit_GaAs_.yml index c5507070..d6eca392 100644 --- a/tests/workflows/protocols/test_optimize/test_spin_orbit_GaAs_.yml +++ b/tests/workflows/protocols/test_optimize/test_spin_orbit_GaAs_.yml @@ -27,6 +27,12 @@ nscf: mixing_beta: 0.4 startingpot: file SYSTEM: + angle1: + As: 0.0 + Ga: 0.0 + angle2: + As: 0.0 + Ga: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 @@ -35,8 +41,12 @@ nscf: noinv: true noncolin: true nosym: true + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + As: 0.1 + Ga: 0.1 pseudos: As: As.upf Ga: Ga.upf @@ -99,14 +109,24 @@ scf: electron_maxstep: 80 mixing_beta: 0.4 SYSTEM: + angle1: + As: 0.0 + Ga: 0.0 + angle2: + As: 0.0 + Ga: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 lspinorb: true noncolin: true nosym: false + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + As: 0.1 + Ga: 0.1 pseudos: As: As.upf Ga: Ga.upf diff --git a/tests/workflows/protocols/test_optimize/test_spin_orbit_H2O_.yml b/tests/workflows/protocols/test_optimize/test_spin_orbit_H2O_.yml index 023b387a..2f60d879 100644 --- a/tests/workflows/protocols/test_optimize/test_spin_orbit_H2O_.yml +++ b/tests/workflows/protocols/test_optimize/test_spin_orbit_H2O_.yml @@ -27,6 +27,12 @@ nscf: mixing_beta: 0.4 startingpot: file SYSTEM: + angle1: + H: 0.0 + O: 0.0 + angle2: + H: 0.0 + O: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 @@ -35,8 +41,12 @@ nscf: noinv: true noncolin: true nosym: true + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + H: 0.1 + O: 0.1 pseudos: H: H.upf O: O.upf @@ -78,14 +88,24 @@ scf: electron_maxstep: 80 mixing_beta: 0.4 SYSTEM: + angle1: + H: 0.0 + O: 0.0 + angle2: + H: 0.0 + O: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 lspinorb: true noncolin: true nosym: false + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + H: 0.1 + O: 0.1 pseudos: H: H.upf O: O.upf diff --git a/tests/workflows/protocols/test_optimize/test_spin_orbit_Si_.yml b/tests/workflows/protocols/test_optimize/test_spin_orbit_Si_.yml index 132eaa1a..3fcda9d1 100644 --- a/tests/workflows/protocols/test_optimize/test_spin_orbit_Si_.yml +++ b/tests/workflows/protocols/test_optimize/test_spin_orbit_Si_.yml @@ -27,6 +27,10 @@ nscf: mixing_beta: 0.4 startingpot: file SYSTEM: + angle1: + Si: 0.0 + angle2: + Si: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 @@ -35,8 +39,11 @@ nscf: noinv: true noncolin: true nosym: true + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + Si: 0.1 pseudos: Si: Si.upf optimize_disproj: true @@ -77,14 +84,21 @@ scf: electron_maxstep: 80 mixing_beta: 0.4 SYSTEM: + angle1: + Si: 0.0 + angle2: + Si: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 lspinorb: true noncolin: true nosym: false + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + Si: 0.1 pseudos: Si: Si.upf structure: Si2 diff --git a/tests/workflows/protocols/test_wannier90/test_spin_orbit_BaTiO3_.yml b/tests/workflows/protocols/test_wannier90/test_spin_orbit_BaTiO3_.yml index 54a71745..95613f83 100644 --- a/tests/workflows/protocols/test_wannier90/test_spin_orbit_BaTiO3_.yml +++ b/tests/workflows/protocols/test_wannier90/test_spin_orbit_BaTiO3_.yml @@ -27,6 +27,14 @@ nscf: mixing_beta: 0.4 startingpot: file SYSTEM: + angle1: + Ba: 0.0 + O: 0.0 + Ti: 0.0 + angle2: + Ba: 0.0 + O: 0.0 + Ti: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 @@ -35,8 +43,13 @@ nscf: noinv: true noncolin: true nosym: true + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + Ba: 0.1 + O: 0.1 + Ti: 0.4166666666666667 pseudos: Ba: Ba.upf O: O.upf @@ -91,14 +104,27 @@ scf: electron_maxstep: 80 mixing_beta: 0.4 SYSTEM: + angle1: + Ba: 0.0 + O: 0.0 + Ti: 0.0 + angle2: + Ba: 0.0 + O: 0.0 + Ti: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 lspinorb: true noncolin: true nosym: false + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + Ba: 0.1 + O: 0.1 + Ti: 0.4166666666666667 pseudos: Ba: Ba.upf O: O.upf diff --git a/tests/workflows/protocols/test_wannier90/test_spin_orbit_GaAs_.yml b/tests/workflows/protocols/test_wannier90/test_spin_orbit_GaAs_.yml index 8b60367d..9b072c52 100644 --- a/tests/workflows/protocols/test_wannier90/test_spin_orbit_GaAs_.yml +++ b/tests/workflows/protocols/test_wannier90/test_spin_orbit_GaAs_.yml @@ -27,6 +27,12 @@ nscf: mixing_beta: 0.4 startingpot: file SYSTEM: + angle1: + As: 0.0 + Ga: 0.0 + angle2: + As: 0.0 + Ga: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 @@ -35,8 +41,12 @@ nscf: noinv: true noncolin: true nosym: true + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + As: 0.1 + Ga: 0.1 pseudos: As: As.upf Ga: Ga.upf @@ -90,14 +100,24 @@ scf: electron_maxstep: 80 mixing_beta: 0.4 SYSTEM: + angle1: + As: 0.0 + Ga: 0.0 + angle2: + As: 0.0 + Ga: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 lspinorb: true noncolin: true nosym: false + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + As: 0.1 + Ga: 0.1 pseudos: As: As.upf Ga: Ga.upf diff --git a/tests/workflows/protocols/test_wannier90/test_spin_orbit_H2O_.yml b/tests/workflows/protocols/test_wannier90/test_spin_orbit_H2O_.yml index 33555257..b701dad2 100644 --- a/tests/workflows/protocols/test_wannier90/test_spin_orbit_H2O_.yml +++ b/tests/workflows/protocols/test_wannier90/test_spin_orbit_H2O_.yml @@ -27,6 +27,12 @@ nscf: mixing_beta: 0.4 startingpot: file SYSTEM: + angle1: + H: 0.0 + O: 0.0 + angle2: + H: 0.0 + O: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 @@ -35,8 +41,12 @@ nscf: noinv: true noncolin: true nosym: true + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + H: 0.1 + O: 0.1 pseudos: H: H.upf O: O.upf @@ -90,14 +100,24 @@ scf: electron_maxstep: 80 mixing_beta: 0.4 SYSTEM: + angle1: + H: 0.0 + O: 0.0 + angle2: + H: 0.0 + O: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 lspinorb: true noncolin: true nosym: false + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + H: 0.1 + O: 0.1 pseudos: H: H.upf O: O.upf diff --git a/tests/workflows/protocols/test_wannier90/test_spin_orbit_Si_.yml b/tests/workflows/protocols/test_wannier90/test_spin_orbit_Si_.yml index 1c719e6a..2064676e 100644 --- a/tests/workflows/protocols/test_wannier90/test_spin_orbit_Si_.yml +++ b/tests/workflows/protocols/test_wannier90/test_spin_orbit_Si_.yml @@ -27,6 +27,10 @@ nscf: mixing_beta: 0.4 startingpot: file SYSTEM: + angle1: + Si: 0.0 + angle2: + Si: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 @@ -35,8 +39,11 @@ nscf: noinv: true noncolin: true nosym: true + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + Si: 0.1 pseudos: Si: Si.upf projwfc: @@ -89,14 +96,21 @@ scf: electron_maxstep: 80 mixing_beta: 0.4 SYSTEM: + angle1: + Si: 0.0 + angle2: + Si: 0.0 degauss: 0.02 ecutrho: 300.0 ecutwfc: 40.0 lspinorb: true noncolin: true nosym: false + nspin: 4 occupations: smearing smearing: cold + starting_magnetization: + Si: 0.1 pseudos: Si: Si.upf structure: Si2