Tools for QMMS Course (Venables/Heggie)

Tools for QMMS Course (Venables/Heggie)

Notes by John A. Venables, with Irene Suarez Martinez. Latest version 20th September 2005.

1. Introduction

This course intends to give students an introduction to Quantum Mechanical Models of Solids within a context of starting life as a graduate student in Physics or Chemistry at Sussex. Thus it is not (just) about sitting in lectures and taking notes; we aim to explore what skills you need in respect of Computing, Unix and bfg, Library access and searching, and any other features of getting things done which may occur to anyone associated with the course. We know your time is severely limited, so demands in respect of problem solving, etc. can be tailored to your own needs. On the other hand, we believe one only learns this material via exposure to practical methods, so several problems have been set to follow each lecture, and some of these can be developed into more open-ended projects, which may lead to the production of web-pages as output, for the benefit of other, and future, students.

2. Computing

Computing is a key skill which you must all have to some degree in order to survive either as an experimentalist or a theorist. Typically this knowledge is just picked up, in a rather haphazard manner, and this applies to faculty-staff just as much as to new students; so be prepared to do quite a lot of reading of manuals, whether on-line or in book form, and to have lots of conversations, fruitful and otherwise, on this topic. Be aware that confidently given advice is often completely incorrect, and don't be blinded by science, while still being sensitive to the high probability that the person you are talking to might well have something else to do. Indeed, this topic is so important that we each have to take on the need to know individually. A statement or complaint that no-one taught/ told me will get one precisely nowhere, and this is a reflection of the fact that the field changes so fast. That being said, there are courses available via the Computing Centre if you need them.

Computers and languages are many and various, but in this course we are assuming:

The following section develops some tips relevant to Unix and bfg, and will be updated as and when anything of general interest arises.

3. Computing tips for Unix and bfg

3.1 Unix shell and Login

You should login in a University computer. Follow the path: Start > Networked Services > Exceed 8 > Exceed
This will open a Exceed window. Then, follow: Start > Networked Services > Exceed 8 > Xstart
This will open a window like this:

To login onto bfg, you should get the IP number ( of the computer you are logged on. You can get the IP number by following the path: Start > Run > cmd > ipconfig
Complete the Xstart window as follow and click 'Run':

Create a 'qmms' directory by typing: mkdir qmms. You can change to this directory using the cd command: cd qmms. Then type ls -al which gives you a list of the files and folders in your qmms directory.

3.2 Text Editors

Next bring up a text editor, so you can see and edit your files. It seems that the best now is Xemacs, which looks like Windows; it will run in background mode, so that you can edit code, and then switch to the Unix shell prompt for commands. Others use 'vi', or older versions of emacs, such as 'emacs&'. The advantages of each are disputed. One thing that seems clear is that long-time Unix users are able to live with more unfriendly user interfaces than those brought up on Windows or Macs, so any comments on what you find useful will be appreciated.

3.3 Manuals and help available

Unix has a built-in documentation system called man (for manual pages). If there is a command you want to learn about, simply type man command , and you will get a description and usage explanation. We suggest you start by typing man man , and see what happens. To find out more about Fortran 90, type man f90 .

I will hand out a single sheet of Unix commands which could help. But beware that Unix installations vary slightly, and that we haven't tested all of these commands. There is a set of notes by Malcolm Heggie and Bernd Eggen on Startup Skills, which contains some Fortran 90 and Unix-related tips.

3.4 Graph Plotters

If you have results to portray you will need a graph plotter, and we use one called xmgr to show us the results of Edward Hernández' box/generalised_eigenvalue problem. Try to find more about this package using the web, for example using a Google search. Another possibility is to find another plotter, and teach me about it!

3.5 Copying and ftp

Copying programs and files from other accounts, e.g. from my qmms directory, is done using the cp command:
From a distant computer you might use ftp, but that would need me to give you my password, or enter it for you. These commands would copy everything in my qmms directory to your local directory; so for specific file, you need to put the filename instead of the *. A useful specification for a set of files is to use the wildcard * within the name, e.g. box*.* would copy all files starting with 'box'. Note that there is NO SECURITY on such transfers, so a) you should not abuse this facility, and b) realise that others can equally well do it to you. If you want to change the security on files or directories, you should understand, and then change, the priviledges which are qiven at the beginning of each line when you type ls -al

3.6 Program Development

Development of (Fortran 90) programs should adopt a failsafe convention. First copy the program to a new name using:
cp oldname.f90 newname.f90
Then edit the new program with your text editor.

Then compile it in one of two modes. If the program does not require any library subroutines, then the following command is sufficient:
f90 -o execname name.f90
In the box example we have had, the executable file name is box, and the f90 file is box.f90

If the program requires access to general routines in the NAG library, as in the generalised eigenvalue example, initially we required the following mouthful, all on a continuous line:
f90 -o execname name.f90 -L/applic2/flsg618da -lnag
We now use a short script called f90nag, written by Simon Scarle, which is much neater. An intial example, written by Edward Hernández, was called Generalised_Eigenvalue, so I immediately chose a shorter name, e.g. geneig1.f90
With Simon's script I can now compile this program as f90nag -o geneig1 geneig1.f90
Note that Unix is case sensitive, so that one has to be very careful. Curse quietly, and keep the adrenalin level under control.

As a personal tip, I use a convention that the name must be 8 characters or less, originally to avoid problems in transferring to DOS machines, with the last character from 0-9. This means I can develop and save up to 10 programs before I have to use a new name. Any more and one loses the thread of what one is doing. I then start two help files, e.g. jvgehlp1 and 2, which describe the programs (1) and data files (2), and form a (retrospective) diary, so that one keeps track of what was done when. Needless to say, it is much easier to say that you will do this than actually to do it, but even short notes are useful. Talk with other students, and see what they find helpful.

If you have more than one type of job going on in parallel (as you do..) then the above procedure means both that you can remember between sessions and that you can split the work between more than one person. For example if you do any work in pairs, adopt the convention that the first two letters of the name (e.g. jv or mh), are your initials, the next three describe the program name and the final one the sequence number. For data files, numbers up to 99 or 999 are required, rather than 0-9. So then Malcolm and I could work together using commands such as
cp jvgen1.f90 mhgen1.f90
and/or (more likely) attaching the file mhgen1.f90 to an email.

I am currently developing some of the Fortran 90 programs as Matlab (5.3/6.5) programs, just to get a feel for the relative ease or programming and displaying the results. Once one has got into MatLab, the code is much shorter, and is more transparent than Fortran. As an interpreted language, MatLab is intrinsically slower, but for the size of prgram we will be illustrating, this is completely unimportant. If learning MatLab is of particular interest to you, let me know.

4. Tips on Library searching

We will get to know the Physics, Chemistry and University libraries, via following up the references for the electron gas in lecture 4. Sussex is online to the WebofKnowledge™ Citation database. You can get there via the Library webpages which includes this service at, which enables you to find out most papers that you want, at least post-1945. The database is being completed quite quickly, and the one in use in the USA now goes back even further. Bear in mind that books and conference proceedings are not in general indexed. Also the lists have errors in them: these are largely errors of omission, so that if an article is not indexed or cited, it doesn't necessarily mean that it wasn't... On the other hand, if the article is listed/ cited, then you are in good shape. For example, you can sometimes find that the article is not listed, or has no citations in the 'general' search, but that citations are available via the 'cited ref' search. This is due to glitches in the exact form of the reference which the WoK system is not smart enough to figure out (it's pretty smart though).

Google Scholar at is developing fast (currently beta-testing), and has some extra features over WoK. However, the last time I checked (June 2005), the data base was still much smaller than WoK, less than a third as large. On the other hand, it is finding books as well as journal articles, and even preprints on my own web-site. So it will be very interesting to see how this competition shapes up over the next few years. Meanwhile, although Sussex has lost many of the print journals over the last few years, we do have access to many electronic journals, and you should become familiar with how to access those you will need.

Return to Top of Page, timetable or to course home page.