Skip to content

Commit

Permalink
scf+nscf for DFPT WannierizeWorkflow example
Browse files Browse the repository at this point in the history
  • Loading branch information
mikibonacci committed Apr 15, 2024
1 parent fbeb98b commit 08333e9
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 4 deletions.
17 changes: 17 additions & 0 deletions examples/silicon_dfpt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
run the example via "koopmans si.json".
delete the 'mode' input in the file to run the standard ASE Koopmans.

To run this via script/notebook:

```python
from koopmans.io import read
from koopmans.workflows import KoopmansDFPTWorkflow

from koopmans.workflows import DFTPWWorkflow, WannierizeWorkflow

wf = read('aiida-koopmans/example/silicon_dfpt/si.json')
workflow = KoopmansDFPTWorkflow.fromparent(wf)

new_wfl = workflow._run()
```

70 changes: 70 additions & 0 deletions examples/silicon_dfpt/si.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"workflow": {
"task": "singlepoint",
"functional": "ki",
"base_functional": "pbe",
"method": "dfpt",
"mp_correction": false,
"init_orbitals": "mlwfs",
"calculate_alpha": true,
"pseudo_library": "pseudo_dojo_standard",
"from_scratch": true,
"mode": {
"pw_code": "pw-7.2-ok@localhost",
"kcw_code": "kcw-7.2-ok@localhost",
"metadata": {
"options": {
"max_wallclock_seconds": 3600,
"resources": {
"num_machines": 1,
"num_mpiprocs_per_machine": 8,
"num_cores_per_mpiproc": 1
},
"custom_scheduler_commands": "export OMP_NUM_THREADS=1"
}
}
}
},
"atoms": {
"cell_parameters": {
"periodic": true,
"ibrav": 2,
"celldms": {"1": 10.2622}
},
"atomic_positions": {
"units": "crystal",
"positions": [["Si", 0.00, 0.00, 0.00],
["Si", 0.25, 0.25, 0.25]]
}
},
"kpoints": {
"grid": [2,2,2],
"offset": [0, 0, 0],
"path": "GXKG"
},
"calculator_parameters": {
"ecutwfc": 60.0,
"pw": {
"system": {
"nbnd": 20
}
},
"w90": {
"bands_plot": true,
"projections": [[{"fsite": [ 0.00, 0.00, 0.00 ], "ang_mtm": "sp3"}],
[{"fsite": [ 0.25, 0.25, 0.25 ], "ang_mtm": "sp3"}]],
"dis_froz_max": 10.6,
"dis_win_max": 16.9

},
"ui": {
"smooth_int_factor": 4
}
},
"plotting": {
"Emin": -15,
"Emax": 10,
"degauss": 0.2
}
}

12 changes: 9 additions & 3 deletions starting_docs/docs/conversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Then, the `DFTPWWorkflow` runs the PWCalculator via the `run_calculator` method
**Here** I implemented the logic to generate a PwBaseWorkChain instance via the method `get_builder_from_ase()` and then run it. **We just run and not
submit because I want to run without services, for now**. But this can change.

We then store the completed PwBaseWorkChain instance in the `scf_wchain` attribute of the calculator, as well as the same attribute but for the whole DFPTWorkflow.
We then store the completed PwBaseWorkChain instance in the `dft_wchain` dictionary (under the key "scf" or f"{calc.parameters.calculation}"), attribute of the calculator, as well as the same attribute but for the whole DFPTWorkflow.

## (3) Analysing results

Expand All @@ -102,5 +102,11 @@ We then store the calcjob as attribute of the DFPTWorkflow (`workflow.wann2kc_ca

### (4.1) The scf parent folder

We have to provide the scf parent folder. This can be accessed via the `workflow.scf_wkchain.outputs.remote_folder`, and should be stored as `KcwCalculation.inputs.parent_folder`.
We do this in an hardcoded way at line ~ 688 of `src/koopmans/workflows/_workflow.py`.
We have to provide the scf parent folder. This can be accessed via the `workflow.dft_wchain["scf"].outputs.remote_folder`, and should be stored as `KcwCalculation.inputs.parent_folder`.
We do this in an hardcoded way at line ~ 688 of `src/koopmans/workflows/_workflow.py`.

# From ASE calculators to AiiDA WorkChains in the DFPT Koopmans workflow - Solids (Wannierization)

The SCF part is the same, and then we connect with the NSCF part by means of additional logic in `src/koopmans/workflows/_workflow.py`, line ~ 689. in principle we check if the workflow has the `dft_wchains` dictionary and in particular if there is the "scf" one, to them takes its parent folder.
Now the idea is to create the wannierization WannierBandsWorkChain for each block by using the https://github.com/aiidateam/aiida-wannier90-workflows/blob/main/examples/example_04.py, which starts from a PwBaseWorkChain.

2 changes: 1 addition & 1 deletion starting_docs/docs/kcw_DFPT_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Some pseudos are shipped with the package.
This is a 5 step calculation, where we divided the occupied manifold in 4 parts, following the pdos results (done before) and 1 empty state manifold.
We use the `exclude_bands` parameters to select our bands.
How to automate this? wise analyisis of pDOS.
How to automate this? wise analysis of pDOS.
Questions:
- can you exclude bands really? or you can only use the parameter to split?
Expand Down

0 comments on commit 08333e9

Please sign in to comment.