Colors in ASE

Updated colors for atoms in ASE in 2024 look like this:

For POV rendering there are several options: ASE2, ASE3, Glass, Glass2, Intermediate, JMOL, Pale, Simple, VMD. I like intermediate because it does not have an reflection and glare.

List of banned tells for GPT

Just watched Andy Stapleton youtube-video about echo technique for working with chatGPT. After that I have made my list of banned tells for GPT. Here it is.

Vibrant, Bustling, Vital, Out of the box, Underscores, Dive into, Reverberate, Delve, Hustle and bustle, Foster, Labyrinthine, Moist, Remnant, Nestled, Game changer, Symphony, Gossamer, Enigma, A testament to, Indelible, Meticulous, Meticulously, Navigating, Complexities, Realm, Understanding, Shall, Tailored, Underpins, Everchanging, Ever-evolving, Not only, Embark, Designed to enhance, It is advisable, Daunting, When it comes to, In the realm of, Amongst, Unlock the secrets, Unveil the secrets, Diving, Unleash, Harness, Tapestry, In summary, Take a dive into, Analogies to being a conductor or to music, Metropolis, Unless, Arguably, Ultimately, To put it simply, Promptly, In today’s digital era, Subsequently, Leverage.

Previously I also used this prompt for working with LaTeX codes, but not I simply use texGPT in overleaf for quick drafting.

Start every sentence on a new line. Add line breaks after every 60 characters to make the text easier to read, but do not add these breaks within commented text. Preserve all original comments exactly as written, and do not delete anything unless explicitly instructed. Use British English and simple language, avoiding words that non-native speakers may not understand. Avoid typical ChatGPT phrases like “leveraging” or any overuse of sophisticated words, adjectives, or jargon. Do not use gerunds or adjectives excessively. Maintain the accuracy of content and avoid changes to technical terms.

Faculty interview

Recently I have been preparing for an interview for a faculty position. As usual I watched a lot of videos, read some tutorials, chatted with GPT, and talked to people (to whom I am very grateful).

The most insightful video turned out to be by Wenhao Sun UM. See below. It is about having a solid research vision!

Besides I would highly recommend a youtube channel “Life in academia” of a very positive prof. Matthias Rillig.

P.S. Despite preparation, I have not anticipated even a single question.

My first presentation generated with AI

I am working on a presentation and use AI for the first time to draft some texts.

There are already existing solutions. Like plug-ins for google slides and copilot that works with powerpoint. I am using chatGPT and work in google slides.

Here is how I add some slides through app scripts:

function addSlide() {
    const presentationName = "ScientificActivities";
    const presentations = DriveApp.getFilesByName(presentationName);
    if (!presentations.hasNext()) return;

    const presentation = SlidesApp.openById(presentations.next().getId());
    const layouts = presentation.getMasters()[0].getLayouts();
    const targetLayout = layouts.find(layout => layout.getLayoutName() === "OBJECT");
    if (!targetLayout) return;

    const titleText = "Bridging Modelling and Scalable Chemical Processes"; // Edit title here
    const bodyText = "Assoc. Prof. Vladislav Ivaništšev"; // Edit body content here

    const newSlide = presentation.appendSlide(targetLayout);
    newSlide.getPlaceholder(SlidesApp.PlaceholderType.TITLE).asShape().getText().setText(titleText);
    newSlide.getPlaceholder(SlidesApp.PlaceholderType.BODY).asShape().getText().setText(bodyText);
}

Title and body can be generated by … within a long conversation with my personal research assistants. I enjoy the process because these skills will save me a lot of time in the future, although right now it took me some hours to get this simple code working. I have also used AI to find and download a dozen on logos of universities that I have visited (shown below). And it saved me time to get facts from my CV right into the slides.

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.

Working with cubes

Working with cubes can be tedious. I need to show a change in electronic density of a MOF. For that I made two cubes for neutral and charged MOF. Then took their difference using cube_tools, like this.

import numpy as np
from cube_tools import cube

# Load the cube files using the cube class
cube1 = cube('mof_opt_0.0.cube')
cube2 = cube('mof_opt_2.0.cube')

# Subtract the data from cube1 from cube2
cube_diff = cube('mof_opt_2.0.cube')
cube_diff.data = cube2.data - cube1.data

# Get z-axis data and find indices where z > 13.3 (jellium density)
z_indices_above_threshold = np.where(cube_diff.Z > 13.3)[0]

# Remove densities above z = 13.3 by setting them to zero
for idx in z_indices_above_threshold:
    cube_diff.data[:, :, idx] = 0

# Save the modified cube data to a new file
cube_diff.write_cube('cdd.cube')

Once I have got the charge density difference and opened it in VMD, I realised that one part of my MOF is right at the border of a periodic cell, so that part of density was split. So, I used a terminal command to shift the cube like this “cube_tools -t -24 -36 0 cdd.cube”. I had to shift manually positions of the atoms by taking into account the voxels size. Next challenge was hiding half of my MOF to clear the view. So I used this tcl syntax in VMD:

vmd > mol clipplane normal 0 0 0 {1 0 0}
vmd > mol clipplane center 0 0 0 {3 0 0}
vmd > mol clipplane status 0 0 0 1
vmd > mol clipplane normal 0 1 0 {1 0 0}
vmd > mol clipplane center 0 1 0 {3 0 0} 
vmd > mol clipplane status 0 1 0 1
vmd > mol clipplane normal 0 2 0 {1 0 0}
vmd > mol clipplane center 0 2 0 {3 0 0}
vmd > mol clipplane status 0 2 0 1

Here is the result – density is almost homogeneously spread over my MOF upon charging.

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.


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.