In previous years, we used Wien 2k rather than OpenMX to do the class DFT project. This old page is available because some of the FAQ are relevant, and there is some info about XCrysDen and unix that may be useful. ====== 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 [[http://www.wien2k.at/features/3Quick_Start.html|quick-start guide]] * a 200+-page [[http://www.wien2k.at/reg_user/textbooks/usersguide.pdf|user's guide]] as well as much other information under the "reg users" link. * Also see {{:tutorial_fixed.pdf|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. ===== 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 run ''w2web''. However, if you want to run XCrySDen (see page: [[:xcrysden|XCrySDen]]), which needs the X-Window environment, you need the ''-X''. **Notice that it is a uppercase letter ''X'', which is a different flag from a lowercase ''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 [[:xcrysden|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 = **S**elf **C**onsistent **F**ield. 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 => set ''Number 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 on ''Files'' in the left margin and click on the ''show 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 run ''lapw1'' from the ''Execution/single prog'' menu. ===== Bandstructure ===== (Also known as 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 called ''case.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|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#XCrySDen via the Wien2k interface]]. - To use XCrySDen to generate a ''case.klist_band'' file: If you have an X-terminal open, XCrySDen should open up if you select ''Generate 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 as ''xcrysden.klist''. Go back into Wien2k and under Task >> Bandstructure, and choose ''from 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 as ''xcrysden.klist''. Go back into Wien2k and under Task >> Bandstructure, and choose ''from 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 the ''single 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 ''<<< Xwin Server. This should open up a "X-Terminal" program. 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'' | **p**rint **w**orking **d**irectory (tells where you currently are) | | ''ls'' | **l**i**s**t files in the working (current) directory | | ''ls -l'' | **l**i**s**t **l**ong form of files in the working directory | |''cd TiC''| **c**hange **d**irectory to the one named "TiC"| |''cd ..''| **c**hange **d**irectory to a level up from the current one| |''rm myfile''|**r**e**m**ove the file named "myfile" from the the working directory. Remember there is no recycling bin, so be careful| |''cp myfile /home/ph575_nn/TiC'' | **c**o**p**y ''myfile'' in the current directory to a directory called ''/home/ph575_nn/TiC''. | |''mkdir Docs'' | **m**a**k**e a **dir**ectory called ''Docs'' | |''ps -u janet'' | list all **p**roces**s**es being run by **u**ser **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 -u ph575_nn'' <-- your account name here and something like below will appear ''27186 ? 00:00:02 w2web'' to kill the job identified by the job number 27186 in the first column, enter the following into the terminal ''kill 27186'' ====== Ask The Doctor! ====== See the [[:wienfaq|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)