Skip to content

Commit

Permalink
Report exception in bands and wrong highest band for magnezation element
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Aug 10, 2023
1 parent af02ffc commit eb54f2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 5 additions & 5 deletions aiida_sssp_workflow/protocol/control.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ precheck:
description: run on 150 v.s 200 v.s 300 Ry wavefunction cutoff with fix dual to give sense whether 200 Ry enough

# max_wfc: 0 # Not used if run precision measurement veri with this protocol, just raise exception.
wfc_scan: [150, 200, 300] # at fix rho
wfc_scan: [150, 200, 300] # at fix dual
nc_dual_scan: [] # set empty so rho test not run
nonnc_dual_scan: []
nonnc_high_dual_scan: []
Expand All @@ -12,7 +12,7 @@ standard:
description: high wavefunction cutoff set and cutoffs dense interval therefore time consuming

max_wfc: 200 # The max wfc cut for precision measurement
wfc_scan: [30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 90, 100, 120, 150, 200] # at fix rho
wfc_scan: [30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 90, 100, 120, 150, 200] # at fix dual
nc_dual_scan: [2.0, 2.5, 3.0, 3.5, 4.0] # at fix wfc
nonnc_dual_scan: [6.0, 6.5, 7.0, 7.5, 8.0]
nonnc_high_dual_scan: [8.0, 9.0, 10.0, 12.0, 16.0, 18.0]
Expand All @@ -21,7 +21,7 @@ quick:
description: low wavefunction cutoff set and cutoffs sparse interval therefore can run on local

max_wfc: 200 # The max wfc cut for precision measurement
wfc_scan: [30, 40, 50, 60, 75, 100, 150, 200] # at fix rho
wfc_scan: [30, 40, 50, 60, 75, 100, 150, 200] # at fix dual
nc_dual_scan: [3.0, 3.5, 4.0] # at fix wfc
nonnc_dual_scan: [6.0, 7.0, 8.0]
nonnc_high_dual_scan: [8.0, 10.0, 12.0, 18.0]
Expand All @@ -30,7 +30,7 @@ test:
description: test only

max_wfc: 35 # The max wfc cut for precision measurement
wfc_scan: [30, 35] # at fix rho
wfc_scan: [30, 35] # at fix dual
nc_dual_scan: [] # at fix wfc
nonnc_dual_scan: [] # at fix rho
nonnc_high_dual_scan: [8.0, 12.0]
Expand All @@ -39,7 +39,7 @@ opsp:
description: To running opsp verification, make the calculations finished fast.

max_wfc: 40 # The max wfc cut for precision measurement
wfc_scan: [30, 35] # at fix rho
wfc_scan: [30, 35] # at fix dual
nc_dual_scan: [2.0, 4.0] # at fix wfc
nonnc_dual_scan: [6.0, 8.0]
nonnc_high_dual_scan: [8.0, 12.0]
8 changes: 6 additions & 2 deletions aiida_sssp_workflow/workflows/evaluate/_bands.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,17 @@ def inspect_bands(self):
# -1 colume for the highest eigenvalue of every kpoints
# which might not be belong to one band if there are degeneracy
# not enough until eigenvalues of all kpoints are greater than shift value.
highest_band = bands[:, -1]
if bands.ndim == 2:
highest_band = bands[:, -1]
elif bands.ndim == 3:
# for magnetization structure, the bands are 3d array.
highest_band = bands[:, :, -1]

if np.all(highest_band > fermi_energy + self.inputs.fermi_shift.value):
self.ctx.should_run_bands = False
else:
self.report(
f"highest band eigenvalue above fermi is {min(highest_band) - fermi_energy}, not enough, you want {self.inputs.fermi_shift.value}."
f"highest band eigenvalue above fermi is {highest_band.min() - fermi_energy}, not enough, you want {self.inputs.fermi_shift.value}."
)

self.ctx.ecutwfc = workchain.inputs.scf.pw.parameters["SYSTEM"]["ecutwfc"]
Expand Down

0 comments on commit eb54f2b

Please sign in to comment.