Quantumchemistry, NWI-MOL406, Computer exercises, week 4
-
We will use the NWChem quantum chemistry package to do quantum chemical calculations.
We use the command-line driven version, i.e. without a graphical interface.
This can be done directly on the terminal room PCs,
via an ssh to lilo8 (and, as fall back option, on the Jupyterhub (completely in the web browser))
-
Further we will use several programs/packages to help us.
For example, the gmolden package can be used as a graphical interface for structure viewing, molecule building, etc. This requires connecting to lilo7, see below. For structure viewing one can also use Jmol and, also for structure building avogadro and the MOPAC 2016 tool. Most require a similar graphical setup as gmolden, but could also be installed locally on your own laptop/PC, see below.
Connecting from the destktop PC
First boot the PC with ubuntu.
Open a terminal window and type
ssh -X lilo8.science.ru.nl
You can omit (the slighty dangerous) "-X" if you don't need graphical capabilities.
For access from home you can, e.g., use MobaXterm, see "Server access" below.
In the first week, lilo8 is sufficient. For the assignments in the final two weeks, more means will be available. More info will be added later.
To exit from lilo8, just type
exit
Moving about your folders
Create a new directory for this course by typing
mkdir QuantumChemistry
You can go into this directory (folder) by
cd QuantumChemistry
Type
ls
to find that the directory is empty.
In directory "QuantumChemistry" you can (later) make (sub)directories to organize your work. You move
up the directory tree by typing
cd DIRECTORYNAME
You move back down the directory tree by typing
cd ..
Now type just cd
That brings you back to the same location always:
/home/YOUR_LOGIN
You can see where you are in the directory tree by typing pwd
Do this
to check your location.
You can see the contect of the current (sub)directory by typing ls
If you type "ls -l" you get one line per file/directory. It the line starts
with "d" you are dealing with the a directory, not a file.
An illustration:
535 cn60> pwd
/home/dewijs
536 cn60> mkdir quantumChemistry
537 cn60> cd quantumChemistry
538 cn60> mkdir subdir1
539 cn60> cd subdir1/
540 cn60> mkdir branch
541 cn60> ls -l
total 4
drwxrwxr-x 2 dewijs dewijs 4096 Nov 24 11:22 branch/
542 cn60> cd branch
543 cn60> mkdir leave
544 cn60> cd leave
545 cn60> pwd
/home/dewijs/quantumChemistry/subdir1/branch/leave
546 cn60> cd ..
547 cn60> rmdir leave
548 cn60> mkdir leaf
549 cn60> cd leaf
550 cn60> pwd
/home/dewijs/quantumChemistry/subdir1/branch/leaf
551 cn60> cd
552 cn60> pwd
/home/dewijs
553 cn60>
You climb "up the tree", from the root "/" (left) to one of the leaves "leaf" (right).
It is also possible to organize and move through your directories/folders
in a "windows"-like fashion. Use the menu bar on the left of the Ubuntu screen.
Editing files
You will need to modify files, make new input files, read output files, etc.
A simple options is
the "nano" editor.
Type
nano FILENAME
where "FILENAME" is the name of the (possibly new) file. The file is opened in the window. You can just
type and modify. At the bottom is an overview of commands. "^O" means press and "CTRL" and "o" together.
Save your work before leaving the editor.
Of course, you can also use other editors from the command line, e.g. "vi". Using "emacs"
should be possible but appears non-trivial.
Copying stuff
Coping files is done with:
cp OLDFILENAME NEWFILENAME
If "NEWFILENAME" already exists, it will be overwritten (the old content will get lost).
You can also copy a file into a directory:
cp FILENAME DIRECTORYNAME
Removing stuff
Removing files is done withrm FILENAME
Removing directories (folders) is done withrmdir DIRECTORYNAME
These commands are dangerous. Once removed, a file or directory cannot be retrieved.
To practise: Go to directory "QuantumChemistry". Make a subdirectory
"Test1", go into this subdirectory and make a file "Testfile" with an editor of choice. Put
in some nonsense. Then try removing "Testfile" and "Test1". Check what you are doing by
typing "ls -l" and "pwd" as often as possible.
You disk space on /home
To see your file quotum and how much you current use on the home
file system type:
quota -s
Apart from the NWChem programme used in this course there are other useful resourses. These are listed below.
The gmolden program
The gmolden software is available from the machine lilo7.science.ru.nl (that is an Ubuntu 20 machine, it is neither available on lilo8 nor on the jupytherhub nodes, which are all Ubuntu 22). We can use gmolden for visualisation of molecules, orbitals and eigenmodes (al using the file "ecce.out" as input) but also for building molecules in from a Z-matrix.
From the PC in the terminal room, just:
ssh -X lilo7
gmolden
You probably do not need to specify a passwd.
On windows (e.g., your local PC/laptop) you can download MobaXterm,
which will allow you
to setup a secure shell connection to lilo7.
For MobaXterm see URL: https://mobaxterm.mobatek.net/
Start mobaxterm form your local PC. In the terminal window setup a secure
connection:
ssh -X your_logon_name@lilo7.science.ru.nl
supply your password
gmolden
For Mac you need to have X11. To get that, you can install XQuartz (https://www.xquartz.org).
You can just start the "ssh" command from a terminal window. With X11 "molden" will work, but not "gmolden".
For "gmolden" you also need openGL.
To let the lilo7 machine contact your OpenGL server (the GLX extension of the
Quartz X11 server), follow the following link:
Enable glx between mac client and linux server.
If gmolden doesn't respond, the path is not (yet) set. The best solution is to set the path explicitely with an alias in $HOME/.profile.
In your login directory edit .profile (that may not yet exist) and add the following lines (e.g., using the editor "nano"):
alias gmolden=/vol/cursus/QuantumChemistry/bin/gmolden
To learn more about Z-matrices, follow the
zmat link.
The Jmol program
For quick molecule visualisation one can also use Jmol, e.g., using the input xyz-format.
It is also available on lilo7 and lilo8 (type "jmol" after going there with "ssh -X" as above) and requires a similar set-up as for gmolden. It is also available on the PCs in the terminal room directly (only need to type "jmol").
It should also be possible to download Jmol and install this on own PC/laptop.
The xyx-format is very simple. The filename requires the extension ".xyz".
The first line gives the number of atoms. The second line is a text comment. The other lines list the identity of the atoms and their xyz coordinates in Angstroms. An example:
579 lilo7> more jmolgly.xyz
10
this is not glycine
C 0.1557882444 -0.1450082474 -0.6210553349
C 0.6900659252 1.0761828156 0.1440547545
H 1.0219176287 -0.7018847843 -1.0093921435
H -0.3850939973 0.2423234443 -1.4971362800
H -1.6097527091 -1.1911105963 -0.2430694416
H -0.2958878010 -1.8235203766 0.5263281994
H -0.4938380996 0.4376344310 1.4263997864
O 1.5224126494 1.8355983509 -0.3140927995
N 0.1301165284 1.2227576949 1.3627233320
N -0.7357283691 -0.9529727321 0.2252399273
The Avogadro program
This is a molecule visualisation and and editing tool. It can, e.g., build (most of) your NWChem input files. The web page: https://avogadro.cc/. It is available on lilo8 (access as explained above) and on the terminal room PCs.
The MOPAC2016 tool
This is a local tool, used in the course applied quantum chemistry and can be found in: https://quantum.science.ru.nl/. It is useful to build molecular input geomtries and part of the NWChem input file. You use it via the web browser.
- Back to [ Quantum Chemistry ]
Last updated: 28-Nov-2023.