Skip to content

Commit

Permalink
Updated tutorial 4 to use new markdown output
Browse files Browse the repository at this point in the history
  • Loading branch information
elinscott committed Oct 7, 2024
1 parent 87dd063 commit 090fe3b
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 139 deletions.
3 changes: 3 additions & 0 deletions docs/_static/tutorials/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ def extract(filename_in, filename_out, start=0, end=None, heading=None):
extract('../../../tutorials/tutorial_3/01-ki/zno.md', 'tutorial_3/md_excerpts/zno_ham.md', -3, -2)
copy('../../../tutorials/tutorial_3/01-ki/01-koopmans-dfpt/Koopmans_DFPT_bandstructure.png', 'tutorial_3/')

# Tutorial 4
extract('../../../tutorials/tutorial_4/h2o_conv.md', 'tutorial_4/md_excerpts/h2o_conv.md', 18, 36)

# Tutorial 5
extract('../../../tutorials/tutorial_5/01-train/h2o_train.md', 'tutorial_5/md_excerpts/train.md', 45, 92)
extract('../../../tutorials/tutorial_5/02-predict/h2o_predict.md',
Expand Down
18 changes: 18 additions & 0 deletions docs/_static/tutorials/tutorial_4/md_excerpts/h2o_conv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- **Singlepoint ecutwfc 20_0 celldm1 11_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 20_0 celldm1 12_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 20_0 celldm1 13_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 30_0 celldm1 11_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 30_0 celldm1 12_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 30_0 celldm1 13_3**
- **DFTCP**
-`01-dft` completed
17 changes: 10 additions & 7 deletions docs/tutorials/tutorial_4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ The output file
'''''''''''''''
When you run the calculation, you should see something like this after the header:

.. literalinclude:: ../../tutorials/tutorial_4/h2o_conv.log
:lines: 15-34
:language: text
----

.. include:: ../_static/tutorials/tutorial_4/md_excerpts/h2o_conv.md
:parser: myst_parser.sphinx_

----

Here, the code is attempting to use progressively larger energy cutoffs and cell sizes. It will ultimately arrive at a converged solution, with a ``ecutwfc`` of 50.0 Ha and a cell slightly larger than that provided in the ``.json`` input file.

Expand Down Expand Up @@ -58,9 +61,9 @@ Hopefully, the first thing you will see is that there are now some warnings abou

.. code-block:: text
UserWarning: Small box parameters "nrb" not provided in input: these will be automatically set to safe default values. These values can probably be decreased, but this would require convergence tests.
Estimated real mesh dimension (nr1, nr2, nr3) = ...
Small box mesh dimension (nr1b, nr2b, nr3b) = ...
🚨 Small box parameters `nrb` not provided in input: these will be automatically set to safe default values. These
values can probably be decreased, but this would require convergence tests. Estimated real mesh dimension `(nr1,
nr2, nr3) = 36 36 45`. Small box mesh dimension `(nr1b, nr2b, nr3b) = 20 18 20`.
These parameters are associated with the way ``Quantum ESPRESSO`` handles non-local core corrections in pseudopotentials, and corrections are present in the new set of pseudopotentials but absent in the SG15 pseudopotentials.

Expand All @@ -71,4 +74,4 @@ So, let's perform a convergence test! The ``nrb`` parameters are not directly im
Running this script will perform a convergence test with respect to ``nrb 1-3``.

.. warning::
This tutorial performs convergence tests in a slightly incorrect way, To see this, add the keyword ``length = 10`` to the ``ConvergenceVarialbe`` in the above script. How is the behaviour different? Which behaviour is correct? Why?
This tutorial performs convergence tests in a slightly incorrect way, To see this, add the keyword ``length = 10`` to the ``ConvergenceVariable`` in the above script. How is the behavior different? Which behavior is correct? Why?
4 changes: 1 addition & 3 deletions tutorials/tutorial_4/custom_convergence.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ def set_nrb(workflow, value):
get_value=get_nrb,
set_value=set_nrb)

# Create the convergence workflow using the convergence factory. Because koopmans knows how to
# converge with respect to ecutwfc, we don't need to implement a custom ConvergenceVariable for it
# and instead can just tell it the variable name
# Create the convergence workflow using the convergence factory
workflow = workflows.ConvergenceWorkflowFactory(subworkflow,
observable='total energy',
threshold=1e-3,
Expand Down
129 changes: 0 additions & 129 deletions tutorials/tutorial_4/h2o_conv.log

This file was deleted.

108 changes: 108 additions & 0 deletions tutorials/tutorial_4/h2o_conv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@

koopmans
========

*Koopmans spectral functional calculations with `Quantum ESPRESSO`*

📦 **Version:** 1.1.0
🧑 **Authors:** Edward Linscott, Nicola Colonna, Riccardo De Gennaro, Ngoc Linh Nguyen, Giovanni Borghi, Andrea
Ferretti, Ismaila Dabo, and Nicola Marzari
📚 **Documentation:** https://koopmans-functionals.org
**Support:** https://groups.google.com/g/koopmans-users
🐛 **Report a bug:** https://github.com/epfl-theos/koopmans/issues/new

> [!NOTE]
> Please cite the papers listed in `h2o_conv.bib` in work involving this calculation
h2o_conv
--------
- **Singlepoint ecutwfc 20_0 celldm1 11_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 20_0 celldm1 12_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 20_0 celldm1 13_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 30_0 celldm1 11_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 30_0 celldm1 12_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 30_0 celldm1 13_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 40_0 celldm1 11_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 40_0 celldm1 12_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 40_0 celldm1 13_3**
- **DFTCP**
-`01-dft` completed

Progress update
ecutwfc still appears unconverged, will reattempt using a finer value
celldm1 still appears unconverged, will reattempt using a finer value

- **Singlepoint ecutwfc 20_0 celldm1 14_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 30_0 celldm1 14_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 40_0 celldm1 14_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 50_0 celldm1 11_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 50_0 celldm1 12_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 50_0 celldm1 13_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 50_0 celldm1 14_3**
- **DFTCP**
-`01-dft` completed

Progress update
ecutwfc appears converged
celldm1 appears converged
... but the variables are not collectively converged. Cautiously incrementing all variables.

- **Singlepoint ecutwfc 20_0 celldm1 15_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 30_0 celldm1 15_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 40_0 celldm1 15_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 50_0 celldm1 15_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 60_0 celldm1 11_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 60_0 celldm1 12_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 60_0 celldm1 13_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 60_0 celldm1 14_3**
- **DFTCP**
-`01-dft` completed
- **Singlepoint ecutwfc 60_0 celldm1 15_3**
- **DFTCP**
-`01-dft` completed

Converged variables are ecutwfc = 50.0, celldm1 = 13.33835675502157

**Workflow complete** 🎉

0 comments on commit 090fe3b

Please sign in to comment.