# Building A Simple ctrl File

### Purpose

The default ctrl.* files provided in the repo and used by the test cases can be quite complicated - needlessly complicated for simple tasks. To overcome this, one can use the –express tag to use default values and greatly reduce the size of the ctrl.* file. This tutorial will explain the steps needed to create a simple ctrl.* for the material GaAs, for use with the lmf program, however it should be mostly applicable to any material.

### Preliminaries

This tutorial assumes you have cloned and built the lm repository (located here). For the purpose of demonstration, ~/lm will refer to the location of the cloned repository (source directory). In practice, this directory can be named differently.

All instances of commands assume the starting position is your build directory (this can be checked with the pwd command). In this tutorial it will be called ~/build/.

$cd ~/build/  with ~/build being the directory the lm repository was built in to. Note: the build directory should be different from the source directory. ### Tutorial First, make sure there are no prior files for GaAs in your build directory (or where ever you are going to be working in). These come in the form of gas.* or *.gas, such as ctrl.gas (note: gas is not a typo of gaas). We start with copying the more complicated ctrl.gas already provided in the repo: $ cp ../lm/fp/test/ctrl.gas .


Now we run the lmchk tool, which will generate site data (atom locations) from the ctrl.gas file:

$lmchk gas --wsitex=site  This generates a site file for gas; site.gas. lmf does not need empty spheres like lm does, so we enter the file site.gas and remove the lines starting with EA1 and EC1 and also rename the lines C1 and A1 to Ga and As respectively. We then copy site.gas to sitein.gas: $ cp site.gas sitein.gas


We can now run the blm tool:

$blm --nk=5 --rdsite --wsitex --express gas  Which will create a actrl.gas file for us. Copy this to ctrl.gas $ cp actrl.gas ctrl.gas


Technically this is the express ctrl.gas file created, however the file contents are not complete. Specifically, GMAX is not set as blm cannot determine it on its own. To find it, we can use the lmfa tool:

$lmfa gas  At the end of this output you will see a output such as FREEAT: estimate HAM_GMAX from RSMH: GMAX=4.9  Specifically we care about the GMAX=* part. Although we are not done yet: copy the file lmfa generated, basp0.gas to basp.gas and run lmfa again: $ cp basp0.gas basp.gas
\$ lmfa gas


Finally, you will see another lmfa output looking like

FREEAT:  estimate HAM_GMAX from RSMH:  GMAX=4.9 (valence)  8.1 (local orbitals)


Now we have the value we want, namely the local orbital value (in this example: 8.1). We go back in to our ctrl.gas file and find the gmax= flag, which we should set to 8.1. The ctrl.gas is now complete!