Quantumchemistry, NWI-MOL406, Computer exercises, week 4
We can use two software packages:
-
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 in the Jupyterhub (completely in the web browser) and via an ssh to lilo6.
-
The gmolden package as a graphical interface for structure viewing, molecule building, etc. This requires connecting to lilo, see "Server access" below. For structure viewing one can also use Jmol. It requires a similar graphical setup as gmolden, but could also be installed locally on your own laptop/PC, see below.
Jupyterhub
The NWChem calculations can be done in Jupyterhub. Most people have access to this (already). If you cannot log in, please contact teacher.
Jupyterhub
To access jupyterhub, go to:
https://jupyterhub.science.ru.nl/
Login with your science account. Next,
press "Spawn". This will send a request to the compute server to open a job for you.
It may take a while if it the compute server is busy. Don't press a second time.
You will see a directory list of your home directory. We will refer to this as the "Dir Tab".
Open a terminal by clicking the "New" box in the right upper corner and choose "terminal" from the menu.
This will open a new tab on your browser with a command line on the clusternode where you are running your Jupyter session. This new tab will be refered to as "Term Tab". The prompt is the name of the cluster node.
Here you can type UNIX/Linux commands.
Moving about your folders
Create a new directory for this course by typing mkdir QuantumChemistry
in the "Term Tab"
and check in the "Dir tab" that you can find it there.
Click on it. It should be empty. In the "Term Tab" you can also go to this
directory by cd QuantumChemistry
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 ..
Try typing this in the "Term Tab" to move back from "QuantumChemistry" to your home file system.
Do the same from the "Dir Tab" where you can click on the folder ".."
Now in the "Term Tab" 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.
In the "Term Tab" 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).
Editing files
You will need to modify files, make new input files, read output files, etc.
There are two simple options:
- Edit from the "Dir Tab". You can select a file with the checkboxes in the left margin
of the page. That will open a list of possible "actions", one of which is the box "Edit".
To make a file from scratch: first copy an existing file and work on that.
- Use the "nano" editor in the "Term Tab". 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 withrm DIRECTORYNAME
These commands are dangerous. Once removed, a file or directory cannot be retrieved.
To practise: Go in the "Term Tab" and go to directory "QuantumChemistry". Make a subdirectory
"Test1", go into this subdirctory 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
Ending your juputerhub session
To exit jupyterhub you need to (always):
-
stop running the notebook and let it save your work. Click "Running" in "Dir Tab" and stop whatever
process is running.
-
let the compute server know that you are done and that someone else can take up your space. Click on "Control Panel" in the top-right corner of one of the tabs. Press "Stop My Server".
A list with useful
UNIX commands.
Server access
The gmolden software is available from the machine lilo6.science.ru.nl
On windows (your local PC) you can download MobaXterm,
which will allow you
to setup a secure shell connection to lilo6 (a Ubuntu 18.04 machine).
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@lilo6.science.ru.nl
supply your password
gmolden
Note: If gmolden doesn't respond, the path is not (yet) set. You need to carry out the first part of hte next exercise "NWChem exercise" to set the appropriate path for NWChem. Once that is done, also gmolden will work.
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 lilo6 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.
To learn more about Z-matrices, follow the
zmat link.
For quick molecule visualisation one can also use Jmol, e.g., using the input xyz-format.
It is also available on lilo6 (type "jmol") and requires a similar set-up as for gmolden.
It should also be possible to download Jmol and install this on your local 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 lilo6> 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
- Back to [ Quantum Chemistry ]
Last updated: 24-Nov-2020.