This is an old revision of the document!
Table of Contents
WIEN 2k Basic Instructions for PH575 students
Wien 2k is a commercial program that calculates dispersion relations, density of states, partial density of states, and other properties of crystalline solids. The program is named Wien 2k (pronounced “VEEN-2-kay”) because it was developed by physicists in Vienna, Austria (“Vienna” is the English version of the German “Wien”), and the most recent modification of the program was in the year 2000. More information about the program is at the developers' website http://www.wien2k.at.
There is online documentation at this site, most notably
- a 200+-page user's guide
as well as much other information under the “reg users” link.
- Also see Andrew Stickel's tutorial, which covers more details on setting up Wien on windows machines. He is a former student who really got into the program and many of the sub programs.
Prof. Guenter Schneider and I are also working to implement a more user-friendly interface using flair, the DFT code Dr. Schneider has written, and gem, a Python-based graphical interface. If you wish to be a guinea-pig for the flair/gem option, let me know Flair/gem option not in 2014.
Computer Accounts
Wien 2k runs on a server in the physics department; you will have access via your web browser. We refer to the server as the “Physics server”, the “Wien server”, and sometimes the “Jansen server”. All these terms are synonymous. To access the Wien2k program via the web, you must have an account on the Physics server (onid, cosine, physics accounts do not work). Accounts have been set up for you; the account names (also your userid) are ph575_nn where nn = 01 to 35. The account names and passwords can be found on blackboard under the “my grades” section. Before you can access Wien via the web you must set up your account correctly (see Initalization below). Your account can also be accessed via a UNIX terminal, which can be useful to manipulate your account and files independently of the web browser. Please note the lowercase 'p' in the account name. The account names originally assigned had uppercase 'P', which is incorrect.
Computer support
- Janet Tate is reasonably adept at Wien, but not all aspects of it. She speaks a little UNIX, but is not fluent. She is just learning Flair and Python.
- Jeff Schulte (schuljef at onid.orst.edu) is the computer TA. He does some of our departmental computer support, and is the go-to-guy for matters computational. He will help with computer support & UNIX issues (accessing accounts etc). He's good with Wien and Flair.
- Daniel Gruss is the course TA. He can help with Wien issues, both scientific and computational.
- Prof. Guenter Schneider is an expert on all matters to do with computing and band structure. He has graciously agreed to be a consultant when we have problems. But please ask me first, because I don't want to overload him. At the end of this page, you'll find a section called “Ask the Doctor!”, in which there are answers to previously asked questions. Some of them are designated (GS), which means that Prof. Schneider answered them. Look there first!
Access Wien 2k via the web
After initialization (see below), point your browser to:
http://wien-server.physics.oregonstate.edu:100nn and nn
is the number in your your account/userid (e.g. for ph575_15, nn=15, so use 10015 and for ph575_01, nn=01, use 10001). You'll get a box that asks for your user_name/user_id and password (find these on Blackboard under grades). A screen comes up where you can create a new session or return to old one.
Initialization
Your account must be properly initialized before the above procedure will work. Initialization is required again if there is a power outage in Weniger Hall (frequent), or if there is a system crash (rare). To initialize, follow these instructions to access your account to run a program called w2web
.
- Open a UNIX terminal on your computer (see below: Managing your account on the Physics Server):
- enter
ssh -X ph575_nn@wien-server.physics.oregonstate.edu
- enter your password at the prompt
- You should get an input prompt. Type:
w2web
- You'll get some text ending with:
w2web server started, now point your web browser to http://wien-server.physics.oregonstate.edu:100nn
- If you get a prompt asking for a username and password, then is likely your configuration got lost somewhere. Enter the same ph575_nn for user and same password as shell (for convenience). If it asks for a port number, enter the 100nn number. Hostname should be wien-server.physics.oregonstate.edu. Hit y for master node if it asks about it.
- You may omit the
-X
in the ssh command above if you simply want to manage files or runw2web
. However, if you want to run XCrySDen (see below: XCrySDen), which needs the X-Window environment, you need the-X
.
Create (or reopen) a session
Once you're into the program, you'll be asked to create a new “session” (right box) or to open a previously-created session (left box). For your first example, create a session called TiC or TiCyourname or something similar. We'll work through Wien's example, which is TiC.
Create a directory
Within a session, create a directory that lives in your home directory to do the calculation. You can call this TiC (same as the session name) if you like, or something different. You must then select that directory.
Set up the structure files
Run the structgen
program, from the left margin, under Execution
. Tell the program how many distinct atoms in the unit cell (2 for TiC). Choose the correct spacegroup from the list in the scroll-down window (F for TiC). Enter the lattice parameter and the positions of the atoms (these are found in a CIF file, which is located elsewhere). Z = atomic number. You can enter Z, but program is smart enough to know it if you label the atom correctly. RMT = radius of the Muffin Tin. Program sets it automatically, and best to leave it at the default value at first. You can change it, but be sure that sum of RMT of 2 adjacent atoms is smaller than interatomic spacing. Use the more familiar eV and Å units - check that these are selected. Once the data are all entered, click on the button that enters the data and follow screen instructions.
View Structure
You can view the structure you've created with the view structure
command, but ONLY if you have an X-terminal open to your wien-server account to allow you to run the graphics on the wien-server (see below under XCrysDen).
Initialize
Run “initialize” from left margin. This is tedious, and you're basically clicking, saving (don't forget to “save”) and continuing. For some of the commands, you may get the following message
Invalid null command.
or
hup: Command not found.
These errors come from using certain distributions of Linux. The distribution we use does not recognize the “hup” command. However, this error has no effect on Wien2k and you should just ignore it.
The only place you MUST do something is at the x kgen
command, where you tell the program the number of points in k-space at which to generate the E(k) value. For basic density of states information, a few 10s to 100s is usually OK for semiconductors; 100s – 1000s for metals. Optimum number depends greatly on type of material, information you want, etc.
There is a button check case.in_st
that will open the file case.in_st. The bottom line of this file is something like
K-VECTORS FROM UNIT:4 -7.0 1.5 emin/emax window
You can change the energy min and max here if you later find that you do not have DoS info in the appropriate range.
Wien's strength and weakness is its extreme modularization. You can control different aspects of the program very easily, but mostly the defaults work, so this leads to lots of apparently mindless clicking and saving that at first you don't understand. This can be frustrating, but don't worry, once you become familiar with the program, it won't be so frustrating, and you may even appreciate the flexibility.
SCF program
SCF = Self Consistent Field. Run from left margin. Here is where the program generates the eigenvalues and eigenfunctions. It can take anywhere from several minutes to several days depending on complexity of system. You will see the word “running” on the upper right of window while a program is running; “idle” when it is finished. Click on the Dayfile
under Utilities
– this will tell you how many cycles have been run and where you are in the current cycle. The reload in reverse order
command is useful.
Calculate Density of States
Under Tasks
.
- Click on
Density of states
option and follow instructions (also see manual). - You can choose which partial densities of states to calculate (up to 21 of them). When running the density of states program, there will be a
edit case.int
button. Here you can set the min and max energies for the DoS plot, the number of partial DoS you want (e.g. you want Total DoS, Ti_total pdos, Ti_s pdos, Ti_p pdos, C_total pdos, C_s pdos, C_p pdos ⇒ setNumber of DoS cases
to 7; then set the atom number and the column appropriately). The manual is helpful here. - Wien has a plotting option to show results, but you can also pull files across to your own computer and make your own plots. The files containing the DoS info are called
case.dos1eV
,case.dos2eV
,case.dos3eV
(case = TiC or whatever you've named the directory). It depends on how much data you generate whether all files are full. Click onFiles
in the left margin and click on theshow all files
option that appears. You'll see ALL the files (in alpha order). - If you run the
Bandstructure
program (see below), then decide to run the DoS program again, you may get an error (the reason is that the bandstructure & DoS programs use a different type of k-mesh or k-grid, and they overwrite each other). The fix is to runlapw1
from theExecution/single prog
menu.
Bandstructure (or dispersion relation or spaghetti diagram)
Under Tasks
.
Follow instructions; they are quite straightforward.
- “Bandstructure” requires a different set of k-values than was used to generate the density of states. For DoS, Wien uses a k-mesh stored in
case.klist
. For the bandstructure program, Wien generates a different k-mesh stored in a file calledcase.klist_band
. Wien has prestored k-paths for fcc, bcc, hcp and cubic lattices, but if you want different paths, or have a lattice of different symmetry, you may need to use the program “XCrySDen” to generate the k-points for this part. - If you get a message from Wien2k that ' 'X-windows is needed to run X-CrySDen' ' and it seems XCrySDen is not going to run, you must reset the ' 'w2web' ' as described in XCrySDen via the Wien2k interface below.
- To use XCrySDen to generate a
case.klist_band
file: If you have an X-terminal open, XCrySDen should open up if you selectGenerate k-mesh using XCrySDen
on the Bandstructure menu. You should see the Brillouin zone, with high-symmetry points labeled as dots on the boundary. You can rotate the structure with the mouse. Click on the special points (they appear on the right when you select them and some will be labeled). Click 'OK' when you have the path you want. Then enter total number of k-points along the path. 50 is a good number to start with. Now save the file asxcrysden.klist
. Go back into Wien2k and under Task » Bandstructure, and choosefrom xcrysden
from the menu. When prompted to overwrite the case.klist_band file, click “yes”. - If clicking
Generate k-mesh using XCrySDen
does not bring up XCrySDen, log in to the Wien2k server with an X-terminal (see “Access Wien 2k via the web” above). Go into the directory in which you are running your simulation. For example, if you are doing silicon in the WIEN2k/Si/ directory, enter 'cd WIEN2k/Si/'. Next, enter 'xcrysden' in the terminal. Once xcrysden opens, go to File → Open Wien2k … → Select k-path. It will ask you to choose the case directory. It should be the default one you went into in the beginning. You should see the Brillouin zone, with high-symmetry points labeled as dots on the boundary. You can rotate the structure with the mouse. Click on the special points (they appear on the right when you select them and some will be labeled). Click 'OK' when you have the path you want. Then enter total number of k-points along the path. 50 is a good number to start with. Now save the file asxcrysden.klist
. Go back into Wien2k and under Task » Bandstructure, and choosefrom xcrysden
from the menu. When prompted to overwrite the case.klist_band file, click “yes”. Now you can continue as normal. - After you have run the spaghetti program, Wien may no longer rerun the DoS program because it now has the wrong k-mesh. You should to rerun
lapw1
in thesingle prog
menu. This should fix the problem. (Seems not to be a problem in the current version of Wien). - You must enter the correct Fermi energy for the spaghetti plot to be generated. There is a step where you must edit the
case.insp
file. The Fermi energy is listed in the file header, and you need to enter this number in the file itself where you see the “xxxx”. e.g. You see in header the line
/home/janet/TiC/TiC.scf: EF (TETRAH.M.)= 0.71285
and in the file itself
2 xxxx # Fermi switch, Fermi-level (in Ry units)
Copy and paste the 0.71285 to the xxxx. Save and continue. When you get the plot, the Fermi level will be labeled “0”, and this will indicate where 0.71285 Ry was in the calculation (though your plot will be in eV if you selected the eV energy option). Note there are other plotting parameters you can change, too.
List your files (and kill unwanted processes)
In the left margin there is a Files»»
link. »»
means “more options”. When you click on it, it will change to ««Files
indicating that you can collapse it. You'll see several different links including show all files
; clicking on this lists all files, including processes that are running.
A process that is running has a “bomb” icon next to it that you can click to kill
a process. Please kill processes that should not be running - it is easy to fall into an infinite loop, and many people don't know that they're using up large amounts of CPU time and memory! There are lots of us, and we all need to use the system efficiently. If you're have trouble with slow access, email the computer TA - he can tell what's running and can kill processes.
Cleaning up and reducing file size
After a calculation, there will be large files that take up space. The computer TA has set up limits on the amount of hard drive space each user can use. The soft limit is 15 GB and hard limit is 17 GB. If you use up 15 GB, it will give you warnings. Once you reach 17 GB, you can no longer write any more information onto the disk. In particular, the case.vector
files are large and not needed after results are calculated. Use the clean lapw
command (under the Utilities
menu) to reduce unwanted files. If you ever want to do a modification, just do a new iteration (run the lapw command, and it will do only 1 iteration and recreate all the missing files). For example, if you want to rerun optical
you must have the original k-mesh and the case.vector
file.
Managing your account on the Physics Server
This is a set of not-too-organized instructions that should help you manage your account. You may know your way around unix more than you intended by the end of this.
Talking to the UNIX server
UNIX or Linux Users: You don't need this section!
Mac Users: Newer Macs have Unix as part of their operating system. Run the Terminal
program, which is in Applications/Utilities folder. If you want to run any program that needs the X-Window environment (e.g. XCrySDen below), you must run X11, found in Applications/Utilities or you can download it for free from Apple.
PC Users: Windows users can use either Cygwin-X or Putty. Cygwin-X can be downloaded at http://www.cygwin.com/install.html and putty.exe can be downloaded at http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html. Cygwin-X and putty work with all versions of Windows. If you want to run XCrySDen with Wien2K, you have to use Cygwin-X. Cygwin-X installation is given below in “How to get XCrySDen running on the Jansen server with Windows (via Cygwin-X)” section. Be sure to load the package that has the ssh command. In the program menu, go to Cygwin-X → Xwin Server. This should open up a “X-Terminal” program. Now look above to see how to run w2web or below to run XCrySDen.
If you are just running “w2web” it is recommended that you use Putty. It is simple and quick. If you are in Wngr 304, you will have to install Putty on your own account. It cannot be installed for all users at once. The file putty.exe takes only a few seconds to download. Next run putty.exe and a window labeled “PuTTY Configuration” should appear. In the bar that says “Host Name (or IP address)”, enter “ph575_nn@wien-server.physics.oregonstate.edu” Below this bar is an option SSH that is already checked and that is why you do not have to enter it.
All users:
- Once you have a terminal open, type
ssh ph575_nn@wien-server.physics.oregonstate.edu
nn
is a number from 01 to 31, which you were assigned in class, and which is listed on BB.
- You will be prompted for your password. Enter it, and you should get something of the sort
Last login: Thu Mar 19 ……………….
Have a lot of fun
ph575_nn@wien-server: >
- At this command prompt enter
ph575_nn@wien-server: > w2web
The system will direct you to point your browser to the appropriate web url.
Simple UNIX commands
You can see most of the files pertinent to Wien via the Wien 2k web portal (look under the Files
menu, and expand the Files
menu for more options) but sometimes you need to see a bit more. From a terminal, log on to the server and look at your files that way. Here are some commonly used commands. (There are lots of UNIX tutorials on the web. Here are simple ones from Rubin Landau of OSU Physics http://www.physics.oregonstate.edu/~rubin/nacphy/UNIX/ and from the University of Surrey: http://www.ee.surrey.ac.uk/Teaching/Unix/).
.
pwd | print working directory (tells where you currently are) |
ls | list files in the working (current) directory |
ls -l | list long form of files in the working directory |
cd TiC | change directory to the one named “TiC” |
cd .. | change directory to a level up from the current one |
rm myfile | remove the file named “myfile” from the the working directory. Remember there is no recycling bin, so be careful |
cp myfile /home/ph575_nn/TiC | copy ' 'myfile' ' in the current directory to a directory called /home/ph575_nn/TiC . |
mkdir Docs | make a directory called Docs |
ps -u janet | list all processes being run by user janet (displays a number XXXX with each) |
kill XXXX | kill the process identified by the number XXXX (see below) |
If you need to kill a Wien2K job from the terminal environment (remember you can also “kill the process” using the bomb icon that you see from the Web portal), first enter the following in a terminal
ps -ef | grep w2web | grep ph575_nn
←- your account name here
and something like below will appear
ph575_01 4202 1 0 Mar26 ? 00:00:00 /usr/bin/perl /home/henri/WIEN2K/SRC_w2web/bin/w2web
ph575_01 10365 10334 0 11:50 pts/4 00:00:00 grep w2web
to kill the job identified by the job number 4202 in the second column, enter the following into the terminal
kill 4202
Note that you do not have to kill job number 10365, since this is searching for a job called w2web
and it has nothing to do with w2web.
XCrySDen
“XCrySDen is a crystalline and molecular structure visualisation program, which aims at display of isosurfaces and contours, which can be superimposed on crystalline structures and interactively rotated and manipulated. It can run on most UNIX platforms, without any special hardware requirements.” - www.xcrysden.org
XCrySDen (http://www.xcrysden.org/) is a very useful program that runs in the X-windows environment and generates Crystal Structures and electron Densities . It allows you to view a crystal structure in real space and in reciprocal space. Within the context of Wien2K and W2Web, XCrySDen is a program which may be used to select k-paths for band structure dispersion plots. It may also be used interactively with Wien2K to generate Fermi surface images. It should be possible to get XCrySDen to interface completely within W2Web, but you have to be logged in with a X-terminal with the '-X' option at the same time. Without the Xterminal login, only selecting the k-path for bandstructure diagrams will work. Otherwise, it is necessary to manipulate some files manually and this is a bit tricky the first time. (See below). The XCrySDen website is very useful for quick instructions and for the Wien interface.
XCrySDen via the Wien2k interface
Wien2k interfaces with XCrySDen to graph crystal structures, generate k-paths, plot electron density and so on. For XCrySDen to run, you must be logged in to the wien-server via the xterm and xwinshell (Windows) or via X11 (Mac) while you are running Wien in the Browser. If, despite your being connected to the server via an xterm, Wien fails to call XCrysDen as you expect and gives a message ' 'X-Windows need to run XCrySDen' ', you must reset the the w2web interface. (Sometimes, the interaction between the two programs quits without warning.)
- Open a terminal to the physics server (should be an X-terminal)
- List the processes running under your userid using ' 'ps' '
- Kill and process called ' 'w2web' '
- List the processes again to be certain they're dead, and check that you are unable to access Wien2k via your browser.
- Run ' 'w2web' '
You should be able to access Wien2k via the browser (log in again) and XCrySDen and Wien should be talking again provided the X-terminal is still open.
XCrySDen on the Physics Server
You can run XCrySDen on the Physics server by using the X Window System protocol.
- In a Linux environment, simply type
xcrysden
- From Windows, use a Unix emulator to access your account (see below for instructions on emulator installation). Once an Xterminal is open type:
ssh -X ph575_nn@wien-server.physics.oregonstate.edu xcrysden
- From a Mac, use X11 to access your account (Applications/Utilities/X11). At the prompt, type
ssh ph575_nn@wien-server.physics.oregonstate.edu -X xcrysden
Spring 2014 – An update to Mountain Lion or Mavericks seems to cause xcrysden to break on MacOS systems. As of now there is no known way to make this work. (If you are able to get it working then please share!)
How to get XCrySDen running on the Physics server with Windows (via Cygwin)
Cygwin is a UNIX emulation engine. Aside from the main engine, additional ‘packages’ must be downloaded and installed. Each package adds additional functionality to the emulation engine, all can be viewed and marked for download via the main Cygwin setup program.
Go to http://cygwin.com/install.html and get the setup.exe file (download link in the beginning text of the webpage).
Once you run the setup.exe file hit next> and then choose install from internet, next>. Select install for all users and choose a root directory for Cygwin (i.e. where you want it installed).
Next choose a download location for storing temporary files related to the setup (just go with default folder if you have no other preference). Select next>.
Choose Direct Connection next>.
Choose a website to download more needed files (specifically outlined below) from. The ftp ones seemed to be quicker than the http. Select next> and it should connect to the site and a select packages screen will appear.
All the packages which may ever be needed are listed alphabetically below. It is possible that the first package, cygwin, and the last one, xinit, are the only two needed for opening an X Windows terminal and running XCrySDen on the Jansen server, however the others are needed when running XCrySDen on your own machine. Since the file size of each package is pretty small it doesn't hurt to download them all in case they may be called upon by the program in some way.
- cygwin
- bash
- bc
- coreutils
- gawk
- grep
- gzip
- ImageMagick
- less
- mesa
- more
- opengl
- openssh
- tcltk
- X-start-menu-icons
- xterm
- xinit
Use the search box in the corner to locate these. The easiest thing is to have the select package screen in category view mode (button upper right to change view). Type in the search word for each package in the list above (e.g. cygwin). After the word All at the top of the file structure tree click on the word Default so that it changes to Install. This may download some unnecessary stuff but it is OK. For the bc package using the search bar brings up a bunch of stuff since those letters appear next to each other in a lot of the available Cygwin packages. The only thing needed is bc: The GNU numeric…. under the utils heading. Select next> and let it download and install any dependent files if needed (it will warn you if so).
You should be able to grab all the packages in one go, but if not continue to rerun the Cygwin setup.exe file with all the same initial root directory and download folder options until each has been installed.
After completing the above steps, you should have two new program folders available within the program start menu, these are Cygwin and Cygwin-X. The first contains one program Cygwin Bash Shell. This is a UNIX command line interface, which is needed if you want to get XCrySDen running on your own PC (see below). The second, Cygwin-X, contains a few programs. The two we are concerned with are XWin Server and xterm. Combined these programs allow a graphical user interface for a program running on the Jansen server (XCrySDen) to run on your PC.
To get the Physics server XCrySDen GUI running on your PC:
- Start the program XWin Server. - A window for xterm may appear automatically upon starting the server program, but if not then manually click on the program xterm (Start>Programs>Cygwin-X>xterm) to start one.
Once within the xterm shell we are ready to ssh over to the Physics server. If just the command:
ssh -X ph575_nn@wien-server.physics.oregonstate.edu
is sent then you should be able to go back to the w2web interface in your web browser and the buttons under ElectronDensity and BandStructure will automatically send the commands to the Physics server to start XCrySDen. Alternatively you could start XCrySDen right away by typing
ssh -X ph575_nn@wien-server.physics.oregonstate.edu xcrysden
as stated above in the section ‘XCrySDen on the Physics server’ for Windows use
A note about speed: XCrySDen's speed depends on the speed of your internet connection. From campus, XCrySDen seems to stream very smoothly, but from off campus locations the interface can lag significantly.
Using XCrySDen
- To look at your structure in real space, go to the
File
menu,Open WIEN2k Struct file
. You'll get a list of your directories in Wien, and you select the one you're interested in, sayTiC
, then clickOK
. You'll get a list of the files in theTiC
directory. Select the one calledTiC.struct
. Click OK. You'll be able to rotate the structure expand it and so on using the graphical interface. - You can also look at the reciprocal space image from the
Tools
menu, by selectingSelect k-path
. This looks similar to what is described described in the “Bandstrucure” section above, but it allows you to save the k-path only in a .kpf format, which Wien does not recognize. - To generate Fermi surfaces go to the
File
menu, selectOpen Wien2K
, selectFermi Surface
. This process runs a ‘W2Web’ type interface to walk through the necessary programs and generate the appropriate files.
XCrySDen on your own machine
You can download XCrySDen from http://www.xcrysden.org/. Some configuration of the software will be necessary.
Ask The Doctor!
See the frequently asked questions page for answers to questions that might not be covered here.
TA guide
Jeff will write this section with explanation of how to set up accounts on the server.
JT's to-do list
- Lots of issues with Optic program - make some better documentation (AS, RW, MC)
- Point students to volume optimization program and implement that in he Si homework example
- Deal with band gap underestimation earlier, particularly including scissors option to widen band gap
- Try simple (AB)X substitutions - most people want to do these. (see KB paper)
- Talk to GS about metals.
- sort out bandstructure/dos order (see RW paper)
- Talk to AS about tutorial
- Look at Ge - gap v small? (MC)