Some tests with GFN2-xTB

GFN2-xTB [10.1021/acs.jctc.8b01176] is a strange model. I have been testing GFN1 and GFN2 on OOH adsorption on Pt(111). GFN1 from TBLITE with ASE works well. It converges and optimizes to meaningful structures. GFN2 however behaves odd in terms of convergence and optimization. For instance, O–H bond becomes broken. I have tested GFN2 also with xtb, for which the input is quite complicated in comparison to ASE inputs. Anyway, it worked only when I specified the periodic conditions in both xtb.inp and Pt-OOH.coord files. Then I executed xtb like this:

xtb Pt-OOH.coord --gfn2 --tblite --opt --periodic --input xtb.inp
Optimization of Pt(111)–OOH with GFN2-xTB (xtb) resulting in O–H bond dissociation.

P.S. You can see that Pt(111) surface corrugates in case of my 2×2 model. For wider models, the surface remains flat.

A simple recipe for making an apptainer with conda, ASE, and GPAW

At the Tartu HPC cluster I have a limit for number of files, which prevents me from having too many conda environments. So, after I have ruined my base environment, I decided to finally switch to Singularity/Apptainer. Here is a simple recipe for creating an apptainer which is equivalent to standard conda installation. It is just an example. Note that AMD/Intel optimized apptainers will run 10–20% faster than the conda one.

P.S. I have ruined my base environment while trying to install XMGRACE, which is so much easier to use than writing a python code just to check calculations results.

Bootstrap: docker
From: continuumio/miniconda3

%post
    # Install necessary packages including InfiniBand support using apt
    apt-get update && \
    apt-get install -y infiniband-diags perftest ibverbs-providers libibumad3 libibverbs1 libnl-3-200 libnl-route-3-200 librdmacm1 lldpad libdapl2 libdapl-dev rdmacm-utils ibverbs-utils && \
    apt-get install -y grace povray && \
    rm -rf /var/lib/apt/lists/*

    # Configure conda
    conda install --solver=classic conda-forge::conda-libmamba-solver conda-forge::libmamba conda-forge::libmambapy conda-forge::libarchive
    conda install -y python=3.11

    # Install openmpi and ucx from conda
    conda install -y -c conda-forge openmpi=4.1.6=*hc5af2df* ucx

    # Install gpaw from conda
    conda install -y -c conda-forge gpaw=24*=*openmpi*

    # Install other packages
    conda install -y -c conda-forge dftd4 dftd4-python

    # Optionally, clean up Conda to reduce the image size
    conda clean --all -f -y

%environment
    # Activate the base environment
    source /opt/conda/etc/profile.d/conda.sh
    conda activate base

Set of useful soft for a PhD student

Today we installed some software on a laptop of our first year student:

  • Avogadro for quick drawing of chemical structures.
  • PovRay for rending high-quality figures.
  • Gimp for editing raster graphics.
  • Inkscape for editing vector graphics.
  • PDFGear for working with pdfs.
  • Zotero for bibliography management.

In case GPAW is ahead of ASE

When next time (like in 2024), GPAW refers to a beta-version of ASE to that

conda install -c conda-forge gpaw
conda remove --force ase
pip install --upgrade git+https://gitlab.com/ase/ase.git@master

Present of year 2023

I wish everyone a Merry Christmas and a Happy New Year!

As I present, let me share the discovery of this year.

Ferdium is a program that combines all messengers in a single window! I tried to distinguish between work and life using different messengers for years. For work, I used fleep.io. Unfortunately, they decided to close all freemium accounts and raise the prices this year. So, I switched to other messengers and eventually mixed them up. Luckily, I found Ferdium! Just see my print screen – all messengers in one app:

Go to ferdium.org to get it.

By the way, Opera provides a similar functionality, but it does not have so many app in it. For example, it does not have Element.

Simulating colour blindness in GIMP

A simple check whether your colours are suitable for illustrations is implemented in GIMP.

view > display filters > color deficient vision

Also

image > mode > grayscale

For details see: https://docs.gimp.org/2.10/en/gimp-display-filter-dialog.html#gimp-deficient-vision

Type hinting in python

[a note for myself]

var: str='text'
from typing import Optional
def function(variable: str|float, number: int|float, variable: bool=False, a_kwarg: Optional[int]=None):
    pass
from typing import Tuple
def function() -> Tuble[str,str]:
    return 'Hello', 'World!'

Zotero + chatGPT via pdfGEAR

Some time ago (in 2023), I linked Zotero with chatGPT by creating an environment with paper-qa and pyzotero like this:
conda create -n Zotero
conda activate Zotero
conda install pip
pip install paper-qa
pip install pyzotero
pip install bs4

That worked but felt way too complicated … like I am not going to use it on a daily basis. It also reminded me the very first experience with the Meta AI in late 2022 (which everyone already forgot).

Here is a much simpler recipe:

  1. Install Zotero add-on from github.com/retorquere/zotero-open-pdf to enable opening with external pdf viewers.
  2. Install pdfGEAR as your default pdf viewer (external to Zotero).

See how it works on my YouTube channel: youtu.be/4JSy2RsBLDE?si=Hbj7oq7gaOiq6END

Fonts for grant proposals

The reference font for the body text of European proposals is Times New Roman (Windows platforms), Times/Times New Roman (Apple platforms) or Nimbus Roman No. 9 L (Linux distributions). The Roman family is from a pre-digital age and has well-recognizable features.

Is it the best font in terms of readability? On the one hand, there is a tendency to move from Times-type fonts to plainer fonts, like Calibri. On the other hand, many studies (with controversial results) account for aspects like Dyslexia, typeface anatomy, and Display vs. Print. The effect of font choice on readability and compression on big numbers seems small or insignificant. However, my point is that a proposal must be clear to a few reviewers, who might have difficulties understanding the proposal due to age, Dyslexia, and colour vision deficiency. These few people will have some feelings about how the text is formatted. For that reason and also because of my artistic education in caligraphy, I have been looking for and playing with font combinations for a long time. Here is what I have tried and liked.

1. STIX two and Source Sans form a pair of Serif and Sans fonts. STIX two resulted from a collaborative effort from the most prominent academic publishing companies. Its predecessor (STIX one) has exactly the same metrics as Times New Roman. STIX two is somewhat bigger, which is not prohibited by the EU funding agencies. The main benefit of using STIX fonts is that these are mathematical fonts and, thus, can be natively used in MS Equation Editor (instead of Cambria) and LaTeX (as XITS or STIX2).

2. An excellent substitution for Times New Roman is Zilla Slab – a unique font by the Mozilla foundation – which has the same metrics as Times New Roman, is a Sans font, yet looks like a monospace one, does have features of a Dyslexia-friendly typeface, and looks great in print and on screen. It is freely available from Google fonts. It can be used with Times New Roman (or similar) as a pair of Serif and Sans fonts.

3. Libertinus Serif + Gill Sans is my favourite Serif and Sans pair. You can see Linux Libertine in the Wikipedia logo. Gill Sans Nova is commonly fond in the University of Tartu (Estonia) press. Although Libertinus Serif has an original Sans counterpart, its combination with Gill Sans looks most natural. I love Libertinus because of its amazingly looking ligatures, and it is also compatible with MS Equation Editor and LaTeX.

PS One can play with fonts in the EU projects to make their proposal more appealing. Like Estonian grants, I prefer calls, where applicants fill out online forms without changing the text appearance. Of course, the text looks ugly due to nasty line breaks, horrible chemical formulas and mathematical equations, and poor typography. Still, the competition is more fair because everyone is in the same conditions.