In this tutorial, you will learn how to insert point defects such as vacancies, substitutional and interstitial atoms.
For the sake of the exercise, let us create a supercell of rocksalt NaCl:
atomsk --create rocksalt 5.64 Na Cl -duplicate 10 10 10 NaCl_supercell.xsf
The case of vacancies was already discussed in a previous tutorial. The option "-select" allows to select atoms according to various criteria. Then, the selected atoms can be removed thanks to the option "-remove-atoms".
For example, one can select the atom of a given index, to create a vacancy:
atomsk NaCl_supercell.xsf -select 417 -remove-atom select final.cfg
That will remove atom number 417, creating a vacancy.
It is also possible to ask Atomsk to select atoms randomly, and then delete them. For instance, to remove 30 atoms of sodium (Na) at random from the system:
atomsk NaCl_supercell.xsf -select random 30 Na -remove-atoms select final.cfg
Alternatively, you may provide a percentage with the symbol "%". For instance, to select 1% of the Na atoms:
atomsk NaCl_supercell.xsf -select random 1% Na -remove-atoms select final.cfg
Note that the option "-select random" is meant to select atoms randomly, so that the selected atoms are different every time.
The option "-select" is very powerful, and allows to select atoms according to various criteria. Then, removing the selected atoms leads to the formation of vacancies.
Instead of removing atoms, it is possible to substitute them with another species, thanks to the option "-substitute".
As a first example, let us replace sodium (Na) atoms with silver (Ag) atoms:
atomsk NaCl_supercell.xsf -substitute Na Ag final.cfg
In this case, all Na atoms were replaced by Ag atoms. Often, one prefers to substitute only few atoms, e.g. to dope a material. Like earlier, it is possible to apply the option "-substitute" only to a few atoms, with the option "-select". For instance, let us select only the atom number 417, and replace it with Ag:
atomsk NaCl_supercell.xsf -select 417 -substitute Na Ag final.cfg
In this case, only atom 417 is selected, therefore only this atom is replaced by an Ag atom; the other Na atoms remain intact. As you can see, the possibilities offered by the option "-select" are not limited to removing atoms, they can also be used to substitute them -and even to other options as well.
Naturally, it is also possible to substitute atoms randomly in the system. To achieve that, select atoms at random like before, and then substitute them. For instance, let us replace 30 atoms of Na atoms by Ag atoms at random:
atomsk NaCl_supercell.xsf -select random 30 Na -substitute Na Ag final.cfg
Like before, it is also possible to select a given percentage of atoms, by using the symbol "%". For instance, to substitute 1% of the Na atoms with Ag atoms:
atomsk NaCl_supercell.xsf -select random 1% Na -substitute Na Ag final.cfg
In practice, 1% of the Na atoms will be replaced with Ag atoms, as shown in the image below (Ag atoms are the largest):
In summary, the combination of the options "-select" and "-substitute" allow to generate alloys pretty easily, either by replacing atoms of your choice, or asking Atomsk to replace atoms randomly.
The option "-add-atom" allows to insert new atoms to a system.
The most simple use of this option is to insert one atom at a given position (x,y,z). For instance, if you wish to introduce a new atom of silicon (Si) into the system, exactly at the position (23,34,45), you can use:
atomsk NaCl_supercell.xsf -add-atom Si at 23 34 45 final.cfg
Note that in the option "-add-atom", one must specify the chemical symbol of the new atom "here Si), then the keyword "at", and then the position of the new atom.
Alternatively, you may ask Atomsk to place a new atom close to an existing atom, in such a way that the new atom does not overlap with existing atoms. For instance, let us try to introduce a new Si atom near the atom number 417:
atomsk NaCl_supercell.xsf -add-atom Si near 417 final.cfg
In this case, Atomsk performs a neighbor search, and places the new Si atom in a tetrahedral cage near the atom 417. Note that the new atom is still placed at the very end of the list, so that all pre-existing atoms keep their indexes (in this case, the new atom does not become atom 418 for instance).
Finally, it is possible to insert N new atoms into the system at random positions:
atomsk NaCl_supercell.xsf -add-atom Si random 21 final.cfg
In this example, 21 new atoms of Si are introduced at random positions, as shown in the following image (Si atoms appear as large yellow spheres):
Like in the previous example, a neighbor search is performed, and each new atom is inserted in a tetrahedral cage, so as not to overlap with pre-existing atoms.
Atomsk has various capabilities to insert point defects, whether they are vacancies, subtitutional, or interstitial atoms.