8. DFT on a windows PC phosphorus doping in silicon tutorial
8.1. Introduction
In this tutorial, I explain how to perform Density Functional Theory (DFT) calculations on a personal computer (windows PC) to analyze the electronic properties of phosphorus-doped silicon. Traditionally, DFT calculations require high-performance computing clusters due to their computational cost, but this tutorial demonstrates that a standard desktop PC can handle large-scale simulations effectively.
PC hardware configuration
This study was performed on a PC with the following specifications:
Processor: Intel Core i7-5500U (2 cores, 4 threads, 2.40 GHz)
RAM: 12 GB DDR3
Storage: 447 GB SSD (SPCC Solid State Disk)
Operating System: Windows 10 Home (Version 10.0.19045, Build 19045)
Overview of the study
Using the RESCU code, we will compare the band structures of two systems:
Pure silicon with 512 atoms.
Phosphorus-doped silicon with 511 Si + 1 P atom.
By analyzing the band structure, we will observe:
How phosphorus doping introduces additional electronic states.
The shift in the Fermi level, confirming n-type doping.
The possible reduction of the bandgap.
Theoretical background
The electronic structure of semiconductors is determined by the energy bands, which describe allowed and forbidden energy levels for electrons. The bandgap is the energy difference between the valence band maximum (VBM) and the conduction band minimum (CBM).
In DFT-GGA calculations, silicon’s bandgap is typically ~0.6 eV, which is underestimated compared to the experimental value (~1.1 eV) due to the limitations of standard exchange-correlation functionals. Despite this, DFT provides qualitative insights into band structure modifications due to doping.
When phosphorus is introduced as a dopant, it donates extra electrons, shifting the Fermi level closer to the conduction band and modifying the electronic properties.
To efficiently describe the electronic structure, we use the linear combination of atomic orbitals (LCAO) method. In this approach, the wavefunction of an electron in the solid is approximated as a sum of atomic orbitals centered on each atom:
where \(\Psi_n(k)\) is the Bloch wavefunction for band n at wavevector k, \(\phi_i(r)\) are the atomic orbitals of the individual atoms, and \(C_{ni}\) are the expansion coefficients that determine the contribution of each atomic orbital. This method allows us to obtain band structures with reasonable computational efficiency while still capturing the essential physics of the system.
Computational approach
To analyze these effects, we will compute the band structure and compare the pure and doped systems. The band energy \(E_n(k)\) as a function of momentum \(k\) is obtained from the Kohn-Sham eigenvalues computed using DFT.
After performing the calculations, we will compare the band structures to see how phosphorus affects silicon’s electronic properties.
Calculation workflow
Assuming we have already verified the accuracy of the calculation parameters for both pure silicon (Si) and phosphorus-doped silicon (Si:P), we now proceed with the following steps:
Calculation of the ground state energy for pure Si.
Calculation of the band structure for pure Si.
Calculation of the ground state energy for doped Si:P.
Calculation of the band structure for doped Si:P.
Comparison of band structures.
8.2. Calculation of the ground state energy for pure Si
First, we calculate the ground state energy of pure silicon.
We will use a 512-atom supercell with a cubic lattice structure.
You can find the structure file si_cubic_512_atoms.xyz here
(si_cubic_512_atoms.xyz
).
The LDA functional is used for the exchange-correlation energy.
The input files for the RESCU calculation are:
% Enable LCAO method
LCAO.status = true;
% Define calculation type and output settings
info.calculationType = 'self-consistent';
info.savepath = './results/scf';
info.outfile = 'scf.out';
% Define atomic structure
atom.element = ones(512,1);
element(1).species = 'Si';
element(1).path = './Si_LDA_TM_SZP.mat';
atom.xyz = 'si_cubic_512_atoms.xyz';
% Define simulation domain and resolution
domain.latvec = 1 * [[21.72 0.0 0.0]; [0.0 21.72 0.0]; [0.0 0.0 21.72]];
domain.lowres = 0.3;
% Define exchange-correlation functionals
functional.list = {'XC_LDA_X', 'XC_LDA_C_PW'};
% Define k-point sampling and mixing settings
kpoint.sampling = 'gauss';
kpoint.sigma = 0.1;
mixing.tol = [1e-8 1e-8];
mixing.type = 'density';
% Set force calculation status
force.status = false;
% Set simulation memory allocation
smi.lwork = 2^20;
% Define units
units.length = 'ang';
units.energy = 'ev';
The self-consistent field (SCF) calculation converged in 15 iterations, demonstrating efficient numerical stability. The SCF runtime was approximately 53 minutes (2862.4 seconds). These results confirm that a standard PC (Intel i7-5500U, 12 GB RAM) can successfully perform a 512-atom SCF calculation within a reasonable time frame, making large-scale DFT simulations accessible without requiring high-performance computing resources. After running the calculation, we obtain the ground state energy of pure silicon.
8.3. Calculation of the band structure for pure Si
Next, we calculate the band structure of pure silicon. The input files for the RESCU calculation are:
% Define calculation type, output settings and the path of a file containing the initial density
info.calculationType = 'band-structure';
info.savepath = './results/bs';
info.outfile = 'fbs.out';
rho.in = './results/scf';
The band structure calculation of pure Si converged in approximately 43 minutes (2583.5 seconds). Until now, we have calculated the ground state energy and band structure of pure silicon.
8.4. Calculation of the ground state energy for doped Si:P
Now, we calculate the ground state energy of phosphorus-doped silicon.
We will use a 511-atom supercell with 511 silicon atoms and 1 phosphorus atom.
You can find the structure file si_p_doped_511_atoms.xyz here
(si_p_doped_511_atoms.xyz
).
The input files for the RESCU calculation are similar to the previous case, with the only difference being the atomic structure:
atom.element = [ones(122, 1); 2; ones(389, 1)];
element(1).species = 'Si';
element(1).path = './Si_LDA_TM_SZP.mat';
element(2).species = 'P';
element(2).path = './P_LDA_TM_DZP.mat';
atom.xyz = 'si_p_doped_511_atoms.xyz';
The SCF calculation for the doped system converged in 23 iterations, demonstrating stable numerical behavior. The SCF runtime was approximately 68 minutes (4071.8 seconds). Compared to the pure silicon system, the doped system required more iterations and a longer runtime due to the introduction of an additional phosphorus atom, which alters the charge distribution and requires extra computational steps to reach self-consistency. These results further support the feasibility of running large-scale DFT calculations on a standard PC, even for slightly more complex doped systems.
After running the calculation, we obtain the ground state energy of phosphorus-doped silicon.
8.5. Calculation of the band structure for doped Si:P
Finally, we calculate the band structure of phosphorus-doped silicon. The input files for the RESCU calculation are the same as for the pure silicon band structure calculation, suppose we have run the two system calculations in its own directories.
The band structure calculation of doped Si:P converged in approximately 28 minutes (1688.6 seconds).
8.6. Comparison of band structures
After calculating the band structures of pure silicon and phosphorus-doped silicon, we can compare the results to analyze the effects of phosphorus doping on silicon’s electronic properties.
The band structures comparison of pure silicon and phosphorus-doped silicon is shown below:

The band structures reveal several key differences between the two systems:
The phosphorus-doped silicon system shows additional electronic states near the conduction band minimum (CBM), indicating the introduction of extra electrons due to phosphorus doping.
The Fermi level of the doped system is shifted closer to the CBM, confirming n-type doping behavior.
The bandgap of the doped system (0.3728 eV) is slightly lower than that of pure silicon (0.3813 eV), indicating the impact of phosphorus doping on the electronic properties. Since we are using a small basis set, the predicted bandgap is slightly underestimated. However, considering the computational limitations of a PC and the reasonable runtime, the error remains within an acceptable range.
These results demonstrate the impact of phosphorus doping on silicon’s electronic structure and highlight the importance of understanding dopant effects in semiconductor materials.
8.7. Computation times on a Windows PC
To demonstrate the feasibility of running large-scale DFT on a standard Windows PC, we measured the total runtime for both the SCF and BS calculations for pristine Si and doped Si:P. The bar chart below shows the individual and total times.

8.8. Performance Evaluation of on a Linux Laptop
To further evaluate the performance of the RESCU code, we performed additional calculations on pure silicon systems using a single-processor Linux laptop equipped with an Intel Core™ i7-1185G7 vPro® (4.80 GHz) CPU and 16 GB of RAM. The figure below presents the SCF and BS calculation times for different system sizes.

To better understand the computational efficiency and scaling behavior of the RESCU code on a laptop, we analyzed the scaling factor in the form of logarithmic plots. The figure below illustrates the relationship between the natural logarithm of computation time and the number of atoms, demonstrating the scaling behavior for both SCF and BS calculations. The extracted slopes (P values) correspond to the scaling exponents in a power-law relationship, providing an estimate of the computational complexity.
