Setting infrastructure is the first step

This week, I have repeatedly discussed the same topic with many peers: What is the first step in starting a new project? Like … a PhD project. For me, it’s about lowering the barriers that prevent beginning the research in the first place. It is all about setting up the right environment, which I call “infrastructure.”

Sometimes, my infrastructure gets disrupted, which slows me down. For example, my new laptop was a major annoyance for some months already. The fan was running at 100% RPM constantly after a software update. It made me worry instead of focusing on the work. Finally, this Saturday morning, I managed to fix it. I am not sure which solution worked – perhaps it was “fan control” – but now I can calmly work in silence.

Additionally, while troubleshooting, I learned more about my CPU and GPU setup. Interestingly, my laptop has two types of CPUs (performance and efficient), totalling 10 cores and 12 threads. I added commands for GPAW Python to run my DFT calculations on 4 and 8 threads accordingly. Yes, I enjoy running tests on my laptop before syncing them via Git and running them on an HPC. Also, I have finally set up the second build-in SSD to store large amounts of data. Hurray!

alias gw8="taskset -c 4-11 mpirun --use-hwthread-cpus -np 8 --bind-to core python"
alias gw4="taskset -c 0-3 mpirun --use-hwthread-cpus -np 4 --bind-to core python"

Calculations run twice faster in 4 performance threads than in 8 efficiency ones!

Feels so good when an infrastructure works for you (and not the other way around).

Optimizers in ASE

Optimising even simple intermediate on metal surfaces might be tricky. They tend change the adsorption site. OOH also very flexible in changing geometry. Thus, some optimizers get stuck (like BFGSLineSearch) while others just crush (like GPMin).

Here is my test with OCPCalculator and EquiformerV2-31M-S2EF-OC20-All+MD (on 1 CPU in Google Colab). Optimisation of OH on Pt(111) is simple.

Here SciPyFminBFGS failed and other optimizers ended up with the same structure, shown below.

Optimisation of OOH on Pt(111) is challenging. GoodOldQuasiNewton, FIRE, FIRE2, MDMin, and BFGSLineSearch (QuasiNewton) do not converge in 95 cycles (which I set as a maximum number of cycles). GPMin, SciPyFminBFGS, SciPyFminCG, and LBFGSLineSearch failed.

Geometry obtained with FIRE2 (similar to BFGS and FIRE)
Geometry obtained with LBFGS. It is clearly far from the optimum.

ResearchCOMP – the European Competence Framework for Researchers

The new Framework for Researchers is a cool tool for planning your career. However, it is so hard to understand and remember. That is why I suggest using the following tree analogy.

ResearchCOMP is an essence like a tree. Roots of critical thinking (1) with trunk of self-management (2) and branches of collaboration (3) hold leaves as research (4) and fruits as impact (5). Water = management 6) and sun = tools (7) nourish the research tree.
The following illustration has been prepared by my son:

Art created by Naran Pavanello, 9 years old

ResearchCOMP, Like a Tree

Roots of critical thinking, deep and strong,
The trunk of self-management keeps you moving along.
Branches of collaboration, reaching far,
Leaves of research, showing who you are.

Fruits of impact, growing bright,
Water of management keeps it right.
Sunlight from tools makes it thrive,
Nourishing the research, keeping it alive.

“Content created with assistance from ChatGPT, an AI language model by OpenAI.”

With this analogy it is now easy to explain what a PhD. student should focus on.

Cognitive Abilities (Roots):
As a Ph.D. student, you first build your thinking skills like problem-solving and creativity. These skills are like roots that hold you on the ground.

Self-Management (Trunk):
You need to manage your time and stress, set goals, and balance your workload. This helps you stay focused and handle challenges, like a trunk.

Working with Others (Branches):
Collaboration is key. Branch with supervisors and teams, seek feedback, and build connections to grow your research.

Managing Research (Water):
You manage your PhD project. This includes organizing resources, meeting deadlines, and planning your work. It is like a flow.

Managing Research Tools (Sun):
Learn to use research tools like data management and software. These help keep your work organized. It is like external source of energy = sunlight.

Doing Research (Leaves):
This is your core work – running experiments, analyzing data, and writing papers to build expertise in your field. Leaves are as dynamic as your research.

Making an Impact (Fruits):
Your research creates impact. Publish, attend conferences, and share your findings as fruits to the society.

And now you can compare a young tree to a mature one. The difference is that the young one is expected to “bloom”, whether the mature one is expected to give “fruits”, as illustrated below.

Choosing the right style for academic writing

Whoooh, once some big stuff got done, I can return to polishing some drafts. I need to change the style of a whole paper. I am going to do that in three steps using AI. First, I refresh my memory about writing styles. Here is a table listing them.

Writing StyleDescriptionExample with “I”Example with “We”
Active – PersonalUse first-person pronouns to highlight the author’s direct involvement.I have made calculations that show ideal catalysts can exist.We have made calculations that show ideal catalysts can exist.
Active – ImpersonalUses neutral subject (e.g., ‘this plot’, ‘this article’) to describe actions.The calculations show that ideal catalysts can exist.
Passive – EmphasisingFocus on the action rather than the actor, but maintain importance.Calculations have been made, showing that ideal catalysts can exist.
Passive – DiminishingDownplay the action and the results using the past simple tense.Calculations were made, and ideal catalysts could exist.
Perfect Tense – HighlightingUse present perfect to emphasise ongoing relevance or result of an action.I have made calculations, which show ideal catalysts can exist.We have made calculations, which show ideal catalysts can exist.
Past Tense – DiminishingUse simple past to minimise the impact or make the statement more tentative.I made calculations, and they suggest ideal catalysts could exist.We made calculations, and they suggest ideal catalysts could exist.
Conditional or DoubtfulUse conditional mood to express uncertainty or possibility.Calculations may suggest that ideal catalysts can exist.
Future CertaintyExpress actions or findings as a certain outcome in the future.Future calculations will confirm that ideal catalysts can exist.

Second, I analyse a dozen of articles from the targeted journal to identify its commonly used style. Third, I will play a bit with AI to see how my text can be rewritten. As I already have Zotero references in my text, I won’t copy-paste anything from the AI. Yet, I expect the AI assistance will save me some hours.


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

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