Random Walk Simulation of p-n Junctions by Jennifer Wang Submitted to the Department of in partial fulfillment of the requirements for the degree of Bachelor of Arts in Physics at WELLESLEY COLLEGE May 2020 c Wellesley College 2020. All rights reserved.

Author...... Department of Physics May 6th, 2020

Certified by...... Yue Hu Professor of Physics Thesis Supervisor

Accepted by ...... Yue Hu Chair, Department of Physics Random Walk Simulation of p-n Junctions by Jennifer Wang

Submitted to the Department of Physics on May 6th, 2020, in partial fulfillment of the requirements for the degree of Bachelor of Arts in Physics

Abstract Random walks rely on stochastic instead of analytical calculations to simulate complex processes; thus, these methods are flexible and mathematically simple. In the semiconductor field, random walks are often utilized to model bulk transport of charge carriers. However, junction transport models generally rely on more complex numerical methods, which are computationally unwieldy and opaque to a general audience. To aim for greater accessibility, this thesis applies random walks to simulate carrier transport in p-n junctions. We first show that our random walk methods are consistent with finite-difference methods to model drift-diffusion processes. Next, we apply a basic random walk to model a p-n junction at equilibrium. This demonstrates successful proof-of-concept simulation of the depletion layer, as well as calculation of the the electric field and potential of a typical p-n junction. Additionally, because the basic random walk assumption cannot incorporate different mobility parameters for electrons and holes, we develop an improved compound p- n junction model. We demonstrate that the compound model is consistent with the basic model, and that it is adaptable to realistic material parameters for both electrons and holes.

Thesis Supervisor: Yue Hu Title: Professor of Physics

2 Acknowledgments

I wish to express my deepest gratitude to my thesis advisor, Professor Yue Hu, for her constant guidance throughout my undergraduate experience. She has been incredibly patient and supportive, helping me with crucial obstacles and offering invaluable life advice. This thesis draws heavily from her ideas and quite literally would not be possible without her. I am also profoundly grateful to Professor Robbie Berg, my major advisor, for setting me on the path to a research career; Professor Rebecca Belisle, for sparking my interest in ; and Professor Brian Tjaden, for providing a much- needed perspective. Thank you all for agreeing to serve as my thesis reviewers. Thanks also to Hope Anderson, my thesis mate, for thought-provoking discussions and moral support throughout our senior year. I would also like to thank my friends Jackie Ehrlich, Maddy Buxton and Maya Igarashi for their edits and camaraderie, as well as my parents for their love and care.

3 Contents

1 Introduction 6 1.1 Overview ...... 7 1.1.1 Semiconductor junction structure ...... 7 1.1.2 Random walk simulation process ...... 12 1.2 Research motivation ...... 14

2 Depletion approximation for p-n junctions 17 2.1 Setup and assumptions of depletion approximation ...... 17 2.2 Mathematical process ...... 20 2.2.1 Charge distribution, electric field and electrostatic potential di- agrams ...... 20 2.2.2 Depletion width calculation ...... 22

3 Random walks and the diffusion process 25 3.1 The drift-diffusion equation ...... 26 3.1.1 Derivation of drift-diffusion equation from random walk . . . . 27 3.1.2 Derivation of carrier ...... 29 3.2 The finite difference method ...... 32 3.3 Random walk simulation implementation ...... 33 3.3.1 Simulation mechanics ...... 33 3.3.2 Simulation cases ...... 34 3.4 Comparing random walk and finite difference methods ...... 34

4 4 Simulation method for p-n junctions 37 4.1 Simulation overview ...... 37 4.1.1 Finding discretized electric field ...... 39 4.1.2 Calculating carrier motion ...... 41 4.1.3 Running the simulation ...... 42 4.2 Material parameters for p-n simulations ...... 44 4.3 Scaling parameter derivations ...... 44 4.3.1 Fixed physical dimension (∆x) and time scale (∆t)...... 44 4.3.2 Doping concentration: fixed A and variable init ...... 46 4.3.3 Electric field: fixed scaling parameter and E-field unit . . . . . 47 4.4 Simulation strategy ...... 48 4.4.1 Basic p-n junction case ...... 48 4.4.2 Limitation of basic p-n junction case ...... 49 4.4.3 Compound p-n junction case ...... 50

5 Results 51 5.1 Basic p-n junction simulation ...... 52 5.2 Realistic diffusion coefficient issue ...... 58 5.3 Compound p-n junction simulation ...... 59

6 Conclusions and future work 62

A Simulation code for random walks 65 A.1 Basic random walk ...... 65 A.2 Biased random walk ...... 68 A.3 Compound random walk ...... 70

B Simulation code for p-n junctions 74 B.1 Basic p-n junction ...... 74 B.2 Compound p-n junction ...... 80

5 Chapter 1

Introduction

The p-n junction is an interface structure between semiconductor materials, which forms the basis for electronic devices such as diodes, transistors, and solar cells. This junction occurs at the boundary between a p-type material, with excess positive charge carriers, and a n-type material, with excess negative charge carriers. This allows electrical current to flow through the junction in only one direction. Depending on external controls, such as a directional voltage bias, it is possible to achieve precise control of the current flow, thus creating an ‘on’ and ‘off’ state and enabling the p-n junction to function as a diode. Due to their ubiquitous use in technology infrastructure, p-n junctions and semi- conductors in general are well-studied; many commercial software packages exist to model junction behavior. However, most of these models are highly complex, in- volving multiple coupled differential equations and inherent assumptions that remain opaque to a general audience. This thesis will lay out a simple method of simulating p-n junctions using the Monte Carlo random walk. Through this investigation, I will endeavor to demonstrate three points: firstly, the random walk method achieves a level of accuracy comparable to that of analytical methods, and results in a more realistic solution than a conventional approximation treatment. Secondly, investigat- ing junction structures using a random walks enables semiconductor simulations to achieve a high degree of flexibility when incorporating external conditions. Thirdly, the random walk method is easily understandable by a broader audience, which bodes

6 well for technology outreach in the computing and clean energy industries. In this first chapter, I will provide necessary background and elaborate on the mo- tivation for using random walks to simulate p-n junctions. Chapter 2 will delineate the theoretical analysis of p-n junctions through the depletion approximation. Chap- ter 3 will justify how random walks can be used to model drift-diffusion processes, as well as how to simulate random walks using Monte Carlo methods. Next, Chapter 4 will introduce the setup and parameter analysis for p-n junctions simulations. In Chapter 5, we present simulation results for several different p-n junction models, to evaluate the accuracy, flexibility and applicability of our methods to the p-n junction system. Finally, Chapter 6 will conclude the thesis with a discussion of limitations and potential future explorations.

1.1 Overview

1.1.1 Semiconductor junction structure

Electrical conductivity is a measure of how easily a material conducts electricity, often calculated as the ratio of current density to electric field within the material.[1] It is a fundamental material property and can be qualitatively understood with concepts from energy band theory. Every material has a distinctive band gap determined by internal structure. The size of the band gap is defined as the energy difference between the lowest energy of electrons in the conduction band, in which electrons are free to move around, and the highest energy of electrons in the valance band, in which electrons are bound close to the nuclei in the atoms. We can characterize material conductivity based on the size of this band gap. For example, as shown in Figure. 1-1, metals are conductors because the conduction band (blue) and valance band (red) overlap, which means electrons with that energy level are free to flow away from their original nuclei. Insulators, like rubber, have a large band gap, which indicates that electron flow in the material is not easy to achieve; in order to escape their bindings from the nuclei, electrons in the valance band have to absorb a large

7 amount of energy to reach the conduction band. Semiconductors like monocrystalline silicon have a small band gap, which means they have a conductivity between that of metals and insulators. We note that the Fermi energy (indicated with dashed line) is the highest energy of electrons if the material is kept at a temperature of 0 Kelvin; it provides a benchmark for the general energy region in which the conduction and valance band reside.

Figure 1-1: Metals are conductors, since they have overlapping conduction and valance bands (zero band gap). Insulators have large band gaps (commonly greater than 9 eV). Semiconductors have smaller, easily tunable band gaps, which indicates that they have a conductivity between that of metals and insulators.

Semiconductor band gaps are small enough (usually around 1.1 eV for silicon) that a tiny shift in energy level can have a large effect on electronic properties within the material.[2] Thus, the key advantage of using semiconductors to engineer devices is that their conductivity can be tuned by external factors, such as doping, which is the introduction of impurities into the material structure. In Figure. 1-2, we take a closer look at both the positive and negative doping of silicon, which lends the p-n junction its name. Figure. 1-2(a) shows the atomic structure of monocrystalline silicon, which has four bonds with the nearest neighboring silicon atoms. As these four bonds are all covalent, each pair of silicon atoms shares two electrons within the bond; thus,

8 (a) Atomic structure of monocrystalline silicon.

(b) Doping with arsenic lends one extra electron, so the material becomes nega- tively charged (n-type). Doping with boron leads to one missing electron, so the material becomes positively charged (p-type).[2]

Figure 1-2: Description of n-type and p-type regions in silicon, starting with an interpretation from the four covalent bonds found in silicon crystal structure.

9 in Figure. 1-2(b) we see silicon (Si) atoms normally have eight electrons covalently bonded to the nuclei. Doping of silicon can be achieved by replacing one silicon atom with arsenic (As), which has one extra electron. The the overall silicon material becomes negatively doped, which we denote n-type; we call the arsenic atom a donor. Similarly, replacing one silicon atom with boron (B), which has one less electron, makes the material positively doped, which we denote p-type, and the boron atom becomes an acceptor. Conventionally, this one missing electron is designated as a hole (empty circle in figure) and treated as a particle of positive charge, with particle mass equivalent to that of an electron. A p-n junction is the interface between a p-type region and a n-type region, with electrons and holes acting as charge carriers. Due to the concentration difference of different types of charge carriers between the p-type and n-type regions, electrons are generally inclined to diffuse from the n-type region to the p-type region without any external perturbation; holes are oppositely charged, and thus flow the other direction. This one-way diffusion indicates that within a circuit, a p-n junction can function as a diode, as shown in Figure. 1-3. However, there processes opposing diffusion at the interface, which are central to the complexity of the p-n junction.

Figure 1-3: One-way flow of electrons indicates that p-n junction can function as diode.[3]

In particular, we imagine a p-n junction at equilibrium, disconnected from external voltage biases. How far do charge carriers diffuse across the junction? The simplest model of diffusion, such as that of ideal gas particles in a box, would indicate that charge carriers spread themselves out evenly; however, due to the presence of the donors and acceptors ions, which cannot move freely within the p-n junction, there is an internal electric field that opposes the carrier diffusion. We consider Figure. 1-4,

10 which shows the equilibration process of a p-n junction.

Figure 1-4: Equilibration process of p-n junction. Drift forces oppose charge carrier diffusion and create a depletion region at the p-n junction interface.[4]

To aid our understanding, we assume that initially the p-type region (white circles indicate acceptors) and n-type region (black circles indicate donors) are physically separated. At time t = 0, we bring them into contact with each other, and charge carriers begin to diffuse: negatively charged electrons move towards the p-type region, and positively charged holes move towards the n-type region. As holes near the interface diffuse across and leave the p-type region, acceptor atoms become ionized and thus negatively charged (red circle). Similarly, as electrons near the interface leave the n-type region, donors become positively charged (blue circle). Since these acceptor and donor ions have a fixed location within the p-n junction, an internal electric field arises in the p-n direction (pointing left on the page). Since an electric field indicates the direction of force on a positive charge, holes that have not yet diffused across the interface are pushed backwards into the p-type region and electrons are kept in the n-type region. This effect results in a drift current that directly opposes the diffusion of charge carriers. Thus, within a small distance of the interface, there is an insulating region with only ionized donors and very few charge carriers. This region

11 is called the charge region or depletion layer, and the size of this region is denoted depletion width.

1.1.2 Random walk simulation process

In order to fully understand the benefits of modeling p-n junctions with Monte Carlo random walks, we now briefly explain the mechanics of the simulation. Monte Carlo simulations are widely used computational methods that rely on random sam- pling to numerically model complex processes. Instead of solving a deterministic problem and then using statistical sampling to estimate uncertainties, which is often mathematically unwieldy, Monte Carlo models incorporate probabilistic distributions during each step of the simulation. Thus, they are incredibly successful at modelling processes with multiple coupled degrees of freedom, from nuclear weapons detona- tions, to traffic jams, to oscillatory chemical reactions.[5] In particular, random walks in one dimension are the simplest form of Monte Carlo simulation. As the name suggests, 1D random walks utilize walkers, which are entities in the simulation that can usually take one of two actions: either to move left or to move right. The probability that the walker goes in either direction is statistically randomized, usually dependent on a random number generator and a previously assumed threshold. For instance, a walker may step to the left if the random probability generated is within the interval [0, 0.5) and step to the right if the probability is within [0.5, 1). A common visualization, depicted in Figure. 1-5(a), is to imagine taking steps along a number line. For an experimental visualization, we can easily imagine modeling particle diffusion with a random walk, as shown in Figure. 1-5(b). Supposing that all particles start off at position x = 0, we can depict them located along a straight line; then, as the simulation continues through each time step, they will gradually step away from the central position. Given enough time, their positions will end up in a , which is consistent with the process of diffusion in a homogeneous medium and shown in Figure. 1-5(c).

12 (a) Walker starting at position x = 0, taking five steps and ending up at position x = −1.

(b) Positions of 1000 walkers at time t = 0 time steps (left) and time t = 300 time steps (right).

(c) Histogram of the positions of 1000 walkers after 300 time steps. This distribution can be modeled with a Gaussian curve, shown here in the red line.

Figure 1-5: Visualization of the random walk simulation process.

13 1.2 Research motivation

As discussed in Section 1.1.2, random walks are effective at modelling the diffu- sion of particles. Using this method, we can imagine treating charge carriers as point particles that can move in directions constrained by a given probability. We now briefly discuss how random walk methods relate to current research. Monte Carlo electron transport models in semiconductors largely fall within two categories: bulk processes, referring to transport within bulk materials, and junction processes, refer- ring to transport across material interfaces. Random walks can be used to estimate electron transport within the bulk of a material, as demonstrated by the CASINO software package in Figure. 1-6. Recent literature has focused on determining the diffusion length of electrons impacting the surface of a TiO2 dye sensitized solar cell, which is a crucial constraint for efficient photon-current conversion.[6]

Figure 1-6: Artificial random walk simulating trajectories of an electron beam with energy 15 keV impacting a solid, Fe2SiO4 (fayalite), considering collisions events between electrons. [7]

As shown in Figure. 1-6, simple random walks with collision mechanics are effec- tive for bulk transport modelling, but often do not account for the local Coulomb interactions between moving charge carriers or stationary ions. However, these inter- actions are crucial for junction structures. In particular, we have emphasized that p-n junctions have a characteristic depletion layer that develops after mobile charge carriers diffuse away, dependent on a net electric field generated by stationary donor

14 and acceptor ions. Therefore, current Monte Carlo junction simulations are often developed from analytical equations; these simulations can include random walks, but are based on numerically solving coupled differential equations. For example, Kirkemo modeled p-n junctions in GaAs under voltage biases using carrier-carrier and coupled mode scattering, as well as energy band models.[8] Nanoscale device modelling involves Monte Carlo simulation methods that solve Boltzmann Transport Equations, in or- der to analyze higher order effects when diffusion-drift equations no longer apply.[9] These complex Monte Carlo methods, usually implemented with commercial soft- ware such as Silvaco Atlas (PISCEC), lack the simplicity and intuitiveness of random walks.[9] In addition, simulations solely relying on coupled differential equations are comparatively inflexible at integrating external conditions into the system, such as a p-n junction illuminated by an external light source. By contrast, junction simulations based on random walks offer a flexible and math- ematically simple setup, as well as comparable accuracy to analytical methods. One recent application of random walks to junction structures is the investigation by Glo- rieux et al., which simulates radiation-induced charge transport and collection across p-n junctions in silicon. [10] Simulating single-event effects caused by energetic par- ticles is often computationally complex, but random walk methods avoid numerically solving 3D Poisson equations, can effectively incorporate external radiation-induced effects, and provide results consistent with industry-standard circuit simulation tools such as TCAD.[10] This thesis aims to use random walks to model junction transport across equili- brated p-n junctions in silicon. Similar to Glorieux’s approach, our model dynamically adjusts the probabilities of motion, which are dependent on the instantaneous con- centration profile of charge carriers in the system. Unlike Glorieux, we account for the electrostatic interactions between charge carriers. This results in two improve- ments: firstly, we do not need to rely on analytical junction approximation models to obtain characteristic p-n junction behavior. Secondly, we can potentially handle a wider range of charge carrier conditions, including different species of carriers as well

15 as higher injection rates from intense radiation.[10] In the following chapters, we will elaborate on the theoretical basis of analytical p-n junction approximation models, which will serve as a reference for our random walk simulation results. We will then discuss and demonstrate how random walks are implemented to effectively model p-n junction mechanics.

16 Chapter 2

Depletion approximation for p-n junctions

2.1 Setup and assumptions of depletion approxi- mation

Here we consider the p-n junction setup described in Chapter 1, Section 1.1, in which the equilibrated p-n junction is reached by bringing p-type and n-type mate- rials into contact and allowing free carrier movement until a stable state is reached. The general process is delineated in Figure. 2-1, in which the two separated regions in Figure. 2-1(a), with different energy band energies as dictated by dopant concentra- tion, are brought into contact. We denote the dopant concentrations as follows: the p-type region has an acceptor doping concentration of Na, and the n-type region has a donor doping concentration of Nd. The initial electron and hole carrier concentrations are defined as n0 and p0. We first introduce an important relationship concerning the carrier concentration of electrons, n, and the carrier concentration of holes, p, in both p-type and n-type materials. A detailed exposition can be found in Hu,[2] but we define key concepts as follows. Since mobile electrons are abundant in the n-type region and holes are abundant in the p-type region, these carriers are called majority carriers. Due

17 to the intrinsic material properties of a semiconductor, there are also a very small number of holes in the n-type region and electrons in the p-type region. These are minority carriers. Crucially, the product of these two types of carriers, the np product, is constant. The np product is equal to the square of the intrinsic carrier concentration ni, defined as the amount of electrons and holes in a semiconductor even when dopants are not present; this is a constant material parameter. The np product relation accounts for the minority carrier expressions in Figure. 2-1 and is shown below.

2 np = ni (2.1)

In Chapter 1, we briefly discussed the processes of diffusion and drift, which are two counterbalancing processes that cause the charge carriers to move across the p- n interface. Figure. 2-1(b) shows our expected final carrier concentrations. Due to the localized nature of the diffusion and drift processes, the carrier profile remains relatively constant far from the p-n interface. However, near the interface, some holes have moved to the n-type region, and some electrons have moved to the p-type region. This results in the ‘depletion layer’ with only ionized donors, acceptors, and very few charge carriers. In order to characterize the physical state of this equilibrated p-n junction, we discuss the depletion approximation. This approximation assumes that the deple- tion layer is completely free of charge carriers. It also assumes that the quasi-neutral p-type and n-type regions far away from the interface have constant doping concentra- tions and are completely charge neutral. This results in a sharp transition between the depletion region and quasi-neutral regions, as shown in Figure. 2-2 below. Moreover, we note that for our characterization of the drift process under this approximation, the net electric field that the carriers are subject to is wholly confined to the depletion region.

18 (a)

(b)

Figure 2-1: Initial and final expectations for the carrier concentrations in p-type and n-type regions, before and after contact. The logarithmic scale is present for ease of visualizing minority carrier concentrations. Disparate concentrations in a) are brought together to connect at the interface, located at x = 0, resulting in the distribution shown in b), in which charge carriers near the interface are subject to counterbalanced drift and diffusion processes. This results in the depletion region at the interface, with very few charge carriers and only ionized donor or acceptor atoms that were originally in the p-type and n-type materials.[11]

19 Figure 2-2: Depletion approximation (dashed lines) assumes a sharp transition be- tween the quasi-neutral p and n-type regions, and the depletion layer which has no charge carriers. However, since the solutions to the drift-diffusion differential equations should be continuous, there should be a small amount of charge carriers remaining in the depletion layer. Thus, there is a difference between the depletion approximation (dashed lines) and actual carrier concentrations (solid line); however, this is a necessary assumption for our theoretical treatment. The depletion width, ω, is the distance between −xp0 and xn0. Note that we have used a linear scale, since minority carriers concentrations are small enough to not affect the depletion width definition.

2.2 Mathematical process

2.2.1 Charge distribution, electric field and electrostatic po- tential diagrams

Having set up our assumptions for the carrier concentrations of a p-n junction at equilibrium, we can now physically characterize the system by calculating depletion layer width, electric field across depletion layer, as well as the potential across the p-n junction. Initially, we start from the total charge profile of the system, as shown in Figure. 2-3(a). Since we assume that there are only ionized donors or acceptors left in the depletion layer and that the p-n junction is electrically neutral otherwise, we end up with a sharply delineated distribution of charge. There is zero total charge outside of the depletion layer. Within the depletion layer, total charge is the acceptor

20 or donor densities multiplied by the unit charge of electrons for the p-type and n-type sides of the depletion layer, respectively. We can describe this mathematically by a simple step function, graphed in Figure. 2-3(a) and shown below:

 ρ(x) = 0; x < −xp0    = −qNa; − xp0 < x < 0 (2.2)  = qN ; 0 < x < x  d n0    = 0; x > xn0

From this step function, it is possible to find the electric field distribution across the p-n junction by integrating Gauss’ law in differential form along the x-axis, as shown below: 1 Z x2 E (x2) − E (x1) = ρ(x)dx (2.3) εs x1 For each of the four regions in Eq. 2.2, we use Eq. 2.3 to obtain:

 E(x) = 0; x < −xp0   Z x  1 −qNa  = −qN dx0 = (x + x ); − x < x < 0  ε a ε p0 p0 s −xp0 s (2.4)  qNd  = (x − xn0) ; 0 < x < xn0  εs    = 0; x > xn0 which corresponds to the electric field profile graphed in Figure. 2-3(b). Then, we obtain the electrostatic potential of the system by taking a path inte- gral of the electric field found in Eq. 2.4. Since the electric field is zero outside the depletion layer, we infer that the potential must be constant in the neutral regions, and define them as φp and φn, respectively. We can obtain these constant values from a detailed analysis of density of states and the Fermi-Dirac distribution; for refer- ence, see Chapter 1 of Chenming Hu’s Modern Semiconductor Devices for Integrated Circuits.[2] For the purposes of this thesis, the relevant equations are reproduced below:

21 kT no kT po φn = · ln , φp = − · ln (2.5) q ni q ni In addition, we define the built-in potential, shown in Figure. 2-3(c), as:

kT NaNd φB = φn − φp = ln 2 (2.6) q ni Next, in order to obtain the potential difference in the depletion region, we take a path integral over the electric field using the definition of electric potential, shown below:

Z x2 φ (x2) − φ (x1) = − E(x)dx (2.7) x1 And thus, we obtain the distribution shown in Figure. 2-3(c), mathematically de- scribed below:

 φ(x) = φp; x < −xp0   qN  = φ + a (x + x )2 ; − x < x < 0  p 2ε p0 p0 s (2.8)  qNd 2  = φn − (x − xn0) ; 0 < x < xn0  2εs    = φn; x > xn0

In Eq. 2.8, we have obtained relationships between our unknown depletion width parameters, xp0 and xn0, electric potential, and known quantities such as doping concentration and permittivity. However, since there are two unknown quantities, we need another equation to solve for the depletion width. The solution is described in the following section.

2.2.2 Depletion width calculation

Here we derive the depletion width formula from the previously discussed potential distribution. In order to obtain a second formula to constrain our two unknown width parameters, xp0 and xn0, we assume that the overall charge must remain neutral,

22 (a) Total charge distribution is assumed to follow sharp transitions, between neutral regions and the depletion region with acceptor and donor atoms.

(b) Electric field is obtained using Gauss’ Law from the charge distri- bution from a).

(c) Electrostatic potential is obtained by integrating over the electric field from b).

Figure 2-3: Total charge concentrations, electric field distribution, and potential dis- tribution of a p-n junction at equilibrium.[11]

23 which gives us:

qNaxp0 = qNdxn0 (2.9)

We also know that the potential function must be continuous at x = 0. Then we have:

qNa 2 qNd 2 φp + xp0 = φn − xn0 (2.10) 2εs 2εs So from the system of equations Eq. 2.9, and Eq. 2.10, we can finally solve for the depletion width parameters. Plugging in the built-in potential from Eq. 2.6, we obtain:

 s  2εsφBNa xn0 =  q (Na + Nd) Nd s (2.11)  2εsφBNd xp0 =  q (Na + Nd) Na

The theoretical value of depletion width ω is therefore:

s r r ! 2εsφB Na Nd ω = xn0 + xp0 = + (2.12) q (Na + Nd) Nd Na

We note that the depletion width approximation analytically models the p-n junc- tion, and neatly avoids the complexity of having to numerically solve coupled differ- ential equations. However, this theoretical treatment suffers from unrealistic assump- tions of a rigidly defined and completely carrier-free depletion layer. In the following sections, we will discuss the efficacy of our random walk simulations to model p-n junctions, obtaining results with comparable accuracy to those from the depletion approximation model.

24 Chapter 3

Random walks and the diffusion process

In this chapter, we will describe the theory and methodology of using random walks to simulate the diffusion process. We discuss this in detail, because we need to dynamically change the probabilities of carrier motion during our Monte Carlo sim- ulation. By exploring the dependence of these probabilities on the diffusion constant and electric field, we take into account the Coulomb interactions between moving charge carriers and stationary ions. To ensure that we understand a generalized model of diffusion, we will consider diffusion with an overall drift term, known as the drift-diffusion equation. Section 3.1 explores the relationship between the drift-diffusion equation and ran- dom walks. In Section 3.2, we derive a finite difference method to numerically solve the drift-diffusion equation, which is a deterministic method that always results in the same distribution for the same initial conditions. Section 3.3 briefly outlines our implementation of random walks with Monte Carlo methods. In Section 3.4, we solve the drift-diffusion equation using this method, which is stochastic and introduces ran- dom variation into the solutions. Finally, by comparing the results from deterministic and stochastic solvers, we confirm that derived diffusion and drift terms correspond to an accurate description of a drift-diffusion process. In particular, to optimize our random walk model methodology, we will explore

25 three random walk cases with different carrier motion probabilities. First, we consider the basic random walk without drift, in which carriers can move with equal probability to the left or right. Secondly, we consider biased random walks in which carriers are biased to move towards either left or right. Finally, we consider a compound random walk, in which carriers can move left, right, or stay in place. Having carriers stay in place resolves some technical drawbacks from the first two cases, and allows us to implement the time-dependent carrier motion probabilities, in which the calculated probabilities of moving left and right do not exactly sum to 1. Thus, we posit that the compound random walk method may result in the most realistic model of carrier distribution.

3.1 The drift-diffusion equation

The drift-diffusion equation is a partial differential equation that can describe the motion of particles from a combination of two processes: diffusion, by which the particles move from higher to lower concentrations, and drift, by which particles move collectively in one direction due to an external force, such as one imposed on charged particles by an electric field. The generalized drift-diffusion equation in one dimension is shown below:

∂c(x, t) ∂2c(x, t) ∂c(x, t) = D − v (3.1) ∂t ∂x2 ∂x In Eq. 3.1, c represents the concentration of particles, D is a diffusion constant depending on the material parameters, and v is the instantaneous drift velocity of the particles. We are studying how the concentration changes in one dimension along the x axis, as well as in time t. The interpretation of this drift-diffusion equation can be found in references such as Stickler.[12]

26 3.1.1 Derivation of drift-diffusion equation from random walk

We now derive the drift-diffusion equation starting from a generalized random walk, in order to better understand how to manipulate drift and diffusion terms to suit our simulation goals. Assume we have a biased random walk, with the probability of a walker moving right given by r and the probability of a walker moving left given by l; therefore, the probability of staying in place is s = 1 − r − l. Each step is taken in time ∆t of size ∆x. We denote the probability of a walker reaching position m after n steps as Pn(m). We can write a master equation, showing the dependence of the Pn(m) on the walker motion probabilities from the previous time step n − 1:

Pn(m) = rPn−1(m − 1) + lPn−1(m + 1) + (1 − r − l)Pn−1(m)

We rearrange this equation as:

Pn(m) − Pn−1(m) = rPn−1(m − 1) + lPn−1(m + 1) − (r + l)Pn−1(m)

In order to obtain time and position derivatives, we divide both sides by ∆t, as well as (∆x)2 . We assume that these time and position steps are sufficiently small. On the left hand side, we then obtain:

P (m) − P (m) 1 ∂P (x, t) 1 n n−1 = (3.2) ∆t ∆x2 ∂t ∆x2 Note that we can rewrite the right hand side as:

1 [rP (m − 1) + lP (m + 1) − (r + l)P (m)] n−1 n−1 n−1 ∆t∆x2 1 1 = (r + l)[P (m − 1) + P (m + 1) − 2P (m)] (3.3) 2 n−1 n−1 n−1 ∆t∆x2 1 1 − (r − l)[P (m + 1) − P (m − 1)] 2 n−1 n−1 ∆t∆x2

We consider the last term of Eq. 3.3; this becomes a spatial derivative, i.e.

27 P (m + 1) − P (m − 1) (r − l) ∂P (x, t − ∆t) (r − l) n−1 n−1 = (3.4) 2∆x ∆t∆x ∂x ∆t∆x Similarly, when we analyze the first term in the right hand side of Eq. 3.3, we discover that it is a second-order spatial derivative, i.e. when we divide by (∆x)2, we obtain:

Pn−1(m − 1) + Pn−1(m + 1) − 2Pn−1(m) (r + l) (∆x)2 2∆t 1 P (m + 1) − P (m) P (m) − P (m − 1) (r + l) = [ n−1 n−1 − n−1 n−1 ] ∆x ∆x ∆x 2∆t (3.5) 1 ∂P (x + ∆x, t − ∆t) ∂P (x, t − ∆t) (r + l) = [ − ] ∆x ∆x ∆x 2∆t ∂2P (x, t − ∆t) (r + l) = ∂x2 2∆t

Assuming that ∆t is small, we can note that P (x, t − ∆t) ≈ P (x, t). Therefore we plug Eq. 3.4 and Eq. 3.5 back into Eq. 3.3, and then set it equal to Eq. 3.2. We rearrange to obtain:

∂P (x, t) 1 ∂2P (x, t) (r + l) ∂P (x, t) (r − l) = − ∂t ∆x2 ∂x2 2∆t ∂x ∆x∆t

∂P (x, t) (∆x)2 ∂2P (x, t) ∆x ∂P (x, t) = (r + l) − (r − l) (3.6) ∂t 2∆t ∂x2 ∆t ∂x in which we have a diffusion term and drift term. We can define the diffusion coeffi- cient and drift velocity with the following expressions:

(∆x)2 D = (r + l) (3.7) 2∆t ∆x v = (r − l) (3.8) ∆t which match the relations given in Stickler.[12] This is reasonable, since the diffusion constant should have units of area over time, and velocity should have units of length over time. Note that velocity is usually dependent on time, space and other factors, but v represents the drift velocity at a certain time step, and can thus be treated as

28 a constant. These expressions simplify our master equation to

∂P (x, t) ∂2P (x, t) ∂P (x, t) = D − v ∂t ∂x2 ∂x This equation exactly corresponds to the original diffusion equation Eq. 3.1, keep- ing in mind that the concentration of walkers at a certain point is equivalent to the total number of walkers, N, times the probability of a walker arriving at that point, i.e. c(x, t) = NP (x, t).

3.1.2 Derivation of carrier motion probability

From the previous section, we have the system of equations

(∆x)2 D = (r + l) (3.7) 2∆t ∆x v = (r − l) (3.8) ∆t From Hu et.al, we know that the diffusion coefficient D is a constant determined by material parameters, such as mobility, and external conditions such as temperature.[2] For our purposes, we can treat this value as a predetermined constant. This leaves us with the drift velocity v, which an be expressed in terms of the electric field E and mobility µ, namely

v = µE (3.9)

of which the derivation of this expression is shown below.[2] From our discussion in Chapter 1, Section 1.1.1., we know that the movement of carriers in p-n junctions follows a drift-diffusion process, in which the diffusion process is counteracted by the drift velocity, brought on by an internal electric field originating from local Coulomb interactions with other charged particles. We can visualize this in Figure. 3-1. Here, a mobile hole carrying one unit of positive charge undergoes diffusion steps (collisions), as indicated by the haphazard arrows, but is also affected by a net electric field, E,

causing it to drift towards the right with a net drift velocity vp. We assume that the

29 mean free time between collisions is τmp; the momentum gained from each collision is

the force F = qE times τmp. We also assume that the hole’s momentum gain, mpvp, is entirely lost between collisions. Thus, we have:

mpvp = qEτmp

Which we rearrange as: qEτmp vp = mp This is known as the Drude Model [2], commonly written in the form:

qτmp vp = µpE, where µp = mp

Note that the first expression matches our expected relation in Eq. 3.9. The second expression µp is defined as the mobility of holes, which is a material parameter that we will treat as a predefined constant obtained from Hu.[2] A similar process is followed for electrons, noting that the electric field will have an exact opposite effect.

Figure 3-1: An electric field creates a drift velocity that is superimposed on the diffusion process.[2]

We can now solve for the probabilities of carriers moving right or left, by plugging in Eq. 3.9 to Eq. 3.8, and then solving the system of equations with Eq. 3.7. For

holes, the probability of moving right (rp) and the probability of moving left (lp) are as follows:

30 µE∆t D∆t r = + (3.10) p 2∆x (∆x)2 µE∆t D∆t l = − + (3.11) p 2∆x (∆x)2 For electron transport, we would just reverse the sign of the first terms. These probability equations imply that the probabilities of carriers moving right or left is comprised of two terms, as expected: a bias term (drift process dependent on electric field magnitude) and a diffusion term. In order to interpret these two terms, note (∆x)2 that we can still plug in D = 2∆t (r + l), as well as the stay in place probability s = 1 − (r + l). We obtain the relation

(∆x)2 D = (1 − s) (3.12) 2∆t

Plugging in Eq. 3.12 to Eq. 3.10 and Eq. 3.11 transforms our probabilities of move- ment, in which we drop the subscript p for convenience.

µE∆t D∆t µE∆t 1 − s r = + = + (3.13) 2∆x (∆x)2 2∆x 2

µE∆t D∆t µE∆t 1 − s l = − + = − + (3.14) 2∆x (∆x)2 2∆x 2 In both equations, the first term is the probability of drift, dependent on the magnitude of the electric field, as well as the material parameter mobility; usually this term is quite small, on the order of 1e-5 in our simulations, but achieves the necessary counterbalance with the diffusion process to form the depletion region in p-n junctions. The second term assumes symmetric diffusion, in which the left and right move- ment probabilities are equal, and thus both start off as half of the total movement probability r + l = 1 − s. From this formulation, we see that the probabilities of movement are the difference from half of the total probability of movement (both left and right), which makes sense if we plug in some numbers. If the probability of

1 staying in place is s = 0, then the diffusion term is 2 , and we revert to the most basic

31 assumption that the probabilities of movement add up, i.e. r + l = 1.

3.2 The finite difference method

The finite difference method numerically solves partial differential equations with discretization. In general, we convert the equation we are trying to solve to a dif- ference equation, which converts the differential terms to finite steps; in our 1D problem, we consider finite steps of time and space. A mesh is created using the spac- ing from these finite steps, and calculations can be performed over each point in the mesh to approximate the solution to the original partial differential equation. Our finite difference approach for the drift-diffusion equation is outlined below.

∂c(x, t) ∂2c(x, t) ∂c(x, t) = D − v (3.1) ∂t ∂x2 ∂x We consider our original drift-diffusion equation, shown again here. Without assuming that the particles undergo a random walk process, we can still utilize the same differential relations to approximate the diffusion equation. We rewrite Eq. 3.1 using particle concentration c(x, t) = cn(m). Analogously to Eq. 3.2, Eq. 3.4, and Eq. 3.5, we have

∂c(x, t) c (m) − c (m) = n n−1 ∂t ∆t ∂c(x, t − ∆t) c (m + 1) − c (m + 1) = n−1 n−1 ∂x ∆x ∂2c(x, t − ∆t) c (m − 1) + c (m + 1) − 2c (m) = n−1 n−1 n−1 ∂x2 (∆x)2

1 We assume ∆x = 1 and ∆t = 1, so from Section 2.1, D = 2 (r + l) and v = (r − l). Thus, we obtain a generalized difference equation similar to Eq. 3.3.

cn(m) − cn−1(m) = D[cn−1(m − 1) + cn−1(m + 1) − 2cn−1(m)] 1 (3.15) − v[c (m + 1) − c (m + 1)] 2 n−1 n−1

32 To calculate the result of approximating the drift-diffusion equation with Eq. 3.15, we create a position-time matrix and calculate the value of the Eq. 3.15 at each point. In the results shown in Section 3.4, we achieve this by creating a single position array, then incorporating the finite difference equation into a for-loop that also controls the time steps for a random walk simulation.

3.3 Random walk simulation implementation

Before analyzing results, we briefly discuss the implementation of random walks simulations using a Monte Carlo method. As introduced in the beginning of this chapter, we envision walkers starting out at a central position, then allow them to step right, left, or stay in place, with predetermined probabilities. This results in normal distribution of walkers, consistent with the diffusion of particles in a homogeneous medium.

3.3.1 Simulation mechanics

As shown in the code in Appendix A, we start off with a fixed number of 20,000 walkers, taking 1000 steps in total; these numbers are chosen so that the simulation reaches a stable state. To keep track of the walker locations, we create a position array of length 1000, which stores the distance of each walker from the starting position, x = 0. We also define of walker motion probabilities, i.e. the probabilities for a walker to move left, right or stay in place, with fixed initial variables. To implement our random walk, we run a for-loop over 1000 steps. During each step, we generate a random number between 0 and 1 for each walker, stored in a probability array of length 1000. This provides the stochastic basis for our simula- tion, and ensures that we do not get the exact same distribution of walkers for each run. Then, using the vectorization methods provided in MATLAB, we compare the probability array to the previously set carrier motion probabilities, and carry out the appropriate movement (left/right/stay in place) in the position array, updating the location of each of the 1000 walkers. After 1000 iterations of this process, we arrive

33 at the final state of the random walk simulation, which is a normal distribution that may be shifted or flattened, depending on relative walker motion probabilities. For a visualization of this process, refer back to Chapter 1, Section 1.1.2.

3.3.2 Simulation cases

We will discuss three different cases of random walks, mentioned at the beginning of this chapter. In the basic random walk, we assume walkers move either left or right with equal probability. In the biased random walk, walkers still either move left or right, but can have unequal probabilities of movement, i.e. they can be biased to move in one direction. In the compound random walk, the walker can still be biased to move in one direction, but we add the possibility that walkers can stay in place. We note that for all the basic, biased and compound random walk cases, we assume all the walkers start on x = 0. This results in a binning issue for the first two cases. Since the walkers can either take an even or odd number of steps, they end up in either all even or all odd positions at the end of the simulation; thus, it is necessary to multiply the final distribution by a scaling constant, C = 2, to plot an accurate Gaussian model of random walk simulation results, as well as add extra constraints on histogram binning. For reference, see code in Appendix A.1 and A.2. In the compound case, shown in Appendix A.3, because walkers have a non-zero probability of staying in place, we do not need these extra steps.

3.4 Comparing random walk and finite difference methods

In this section, we give a detailed description of simulation results comparing the random walk and finite-difference solutions for the drift-diffusion equation. In Fig. 3- 2 through Fig. 3-4, we see comparisons of the basic, biased and compound random walk cases. All runs used the same number of walkers and steps, and the same initial condition of all walkers located at the origin x = 0 at time t = 0. The blue pillars are a

34 histogram of the walker positions, showing an expected amount of stochastic variation and overall Gaussian distribution. In each graph, the red line delineates a Gaussian distribution with mean and standard deviation obtained from walker positions, and thus represents an idealized version of random walk results. The green line indicates the expected, non-stochastic result using the finite-difference method, over the same number of time steps as the random walk process.

Figure 3-2: Basic random walk with equal probability of walkers moving left or right in each time step. The idealized random walk simulation result (red line) matches the finite difference result (green line).

Since the different methods for simulating random walk processes concur with the finite difference method, we conclude that our interpretation of the random walk process and theoretical derivation of diffusion and drift constants is correct. We also note that the compound random walk, whilst slightly more complex than the other two cases, neatly accounts for the binning issue mentioned in Section 3.3.2; as we can see in the graph, there are twice the amount of bins (blue pillars) as the other random walk cases. Though the walkers all start from position x = 0, during each time step, they no longer end up in solely even or odd positions, due to the probability that some walkers stay in place. This leads to easier plotting of results and has the potential to model more realistic carrier behavior.

35 Figure 3-3: Biased random walk with walkers moving right with probability 0.7 and moving left with probability 0.3. The idealized random walk simulation result (red line) matches the finite difference result (green line).

Figure 3-4: Compound random walk with walkers moving right with probability 0.5, moving left with probability 0.4, and staying in place with probability 0.1. The idealized random walk simulation result (red line) matches the finite difference result (green line).

36 Chapter 4

Simulation method for p-n junctions

4.1 Simulation overview

Previously, we have explored the theory of p-n junctions in Chapter 2, as well as the applicability of random walks to simulate drift-diffusion processes in Chapter 3. We now discuss the p-n junction simulation setup, as mentioned in Chapter 1, Section 1.1. Recall that we only consider the p-n junction at equilibrium, envisioning a joining of the p-type and n-type regions under no external voltage bias. The geometry of the junction and simulation setup is reproduced in Figure. 4-1 below, showing the p-n junction right before carriers start to diffuse across the junction. In order to model the p-n junction with random walks, we discretize the region by representing it as a of parallel infinite sheets on which charge carriers and donor atoms can be located; each step of the random walk transfers the walkers, i.e. electron and hole charge carriers, to an adjacent infinite sheet. We note that the ionized donors (blue) and acceptors (red) are fixed charges, whereas electrons (negative green circle) and holes (positive green circle) are mobile. In order to simulate the depletion region of our p-n junction, we allow these mobile charge carriers to undergo random walks; each step of the random walk transfers a charge carrier to an adjacent infinite sheet. Since the concentration of electrons and

37 Figure 4-1: Setup of the p-n junction simulation, in which the junction is discretized into a series of infinite sheets, on which electrons, holes, donor atoms, and acceptor atoms reside. The electrons (negative green circles) and holes (positive green circles) are charge carriers free to move away from their original positions near atomic nuclei. Once they do, they leave behind the fixed charges, i.e. ionized donor (positive blue circles) and acceptor (negative red circles) atoms, which cannot move between sheets. Due to concentration disparity of mobile charge carriers between the p-type and n- type regions, electrons diffuse to the p-type region while holes diffuse to the n-type region. holes is disparate between the p-type and n-type regions, they immediately start to undergo diffusion, moving from regions of higher concentrations to regions of lower concentrations. As the blue arrows show, electrons diffuse towards the p-type region, and holes diffuse towards the n-type region. In our simulation, we keep track of the fixed and mobile charges by creating data arrays of length equal to the total number of infinite sheets. At each index of the data arrays, corresponding to an infinite sheet at a specific location, we store and update the number of donor atoms, acceptor atoms, mobile charge carriers, and minority carriers on the infinite sheet. This enables us to initialize the state of the p-n junction, perform random walk steps using the results of the previous step, and automatically generate carrier concentration profiles at the end of the simulation.

38 4.1.1 Finding discretized electric field

From Chapter 3, we are familiar with how random walks can model drift-diffusion processes. At each step of the random walk process, the movement of mobile charge carriers involves not only diffusion, but also drift, generated by the Coulomb inter- actions between fixed charges and mobile charges on other infinite sheets. Here we discuss how to obtain the electric field affecting each charge carrier at any time step of the simulation. According to Gauss’ law [1], the magnitude of the electric field generated by an infinite sheet is σ E = 2ε0 Though our ideal model will assume infinite sheets, we will actually model sheets that are sufficiently large compared to the lateral dimension of the p-n junction, for ease of simulation and to define doping concentrations; this decision will be explained in more detail in Section 4.3.2. For now, we can assume the area of each sheet is A, and using Gauss’s law on a rectangular “pillbox” surface, as shown in Figure. 4-2, we obtain the magnitude of the electric field generated by large sheets,

Nq E = (4.1) 2εsA in which N is the total units of net charge from mobile and fixed carriers, q is the

unit electron charge, and εs is the permittivity of silicon. We note that N is easily

found by totaling up the amount of charge on each sheet, i.e. N = Nd–Na + h–e, in

which Nd is the number of donors, Na is the number of acceptors, h is the number of holes, and e is the number of electrons. The direction of the field created by each sheet will depend on the signage of N; if N is positive, the field will point out from the sheet, while if N is negative the field will point into the sheet. Operationally, we have to calculate the electric field felt by each charge carrier at each step of the random walk process. We observe that for each unique position, i.e. for each infinite sheet, the electric field felt by charge carriers should be identical in magnitude, and only differ in signage for electrons versus holes. We can then create

39 Figure 4-2: Derivation of electric field generated by each infinite sheet. The electric field generated by an infinite sheet is perpendicular to the surface, as shown by the small green ‘E field’ arrows. By Gauss’ law, if we draw a rectangular “pillbox” on each sheet, shown by the blue dashed lines, we can calculate the magnitude of the electric field, which is proportional to net charge within the enclosed area. Overall, as charge carriers diffuse across the junction, an internal electric field arises from the ionized donor and acceptor atoms, depicted by the ‘Net E field’ arrow. an E-field data array which discretizes the electric field, in which each index stores the magnitude of the electric field felt by charge carriers at that position. This electric field magnitude is calculated as follows. For each infinite sheet, we sum up the net charges from the previously mentioned donor, acceptor, and charge carrier data arrays, then scale by various constants to obtain the electric field, as de- scribed in Eq. 4.1. Based on the index of the E-field array, we know how many infinite sheets are to the left or right of the target position; thus, we can appropriately assign electric field directions and sum up the electric field contributions from other infinite sheets. Thus, we obtain the total electric field magnitude felt by charge carriers at the target index. We repeat this process for the whole E-field array during each step of the random walk process, which amounts to a nested for-loop. As electrons and holes diffuse across the junction, we know from the discussion in Chapter 1, Section 1.1,

40 that an internal electric field arises in the p-n direction (pointing left on the page), generated by the stationary ionized donor and acceptor atoms. This electric field will be reflected in the final profile of the E-field data array, when the p-n junction simulation reaches equilibrium.

4.1.2 Calculating carrier motion probabilities

In Chapter 3, Section 3.1.2, we provided a detailed derivation of carrier motion probabilities. For ease of reference, the carrier motion probabilities for holes are reproduced below; for electrons, the sign of the first term is reversed.

µE∆t D∆t r = + (3.10) 2∆x (∆x)2

µE∆t D∆t l = − + (3.11) 2∆x (∆x)2 Recall that these equations represent drift (first term) and diffusion (second term) processes, which counteract each other to create a depletion region close to the p-n junction. This process is depicted in Figure. 4-3 below. As the magnitude of the net electric field across the junction builds up, electrons drift back towards the n-type region and holes drift back towards the p-type region, both opposing their respective directions of diffusion. This creates a depletion region in the middle, with ionized donors and acceptors but no charge carriers, under the depletion approximation dis- cussed in Chapter 2. However, since the solutions to the drift-diffusion differential equations should be continuous, realistically there should be a small but non-zero amount of charge carriers in the region, as previously shown in Chapter 2, Figure. 2- 2. From our previous discussion of finding electric field, we have all the parameters we need to calculate motion probabilities for each carrier, since D and µ are predeter- mined constants for silicon, and the parameters ∆t and ∆x are simulation parameters for the random walk process. Our expectation is that we will be able to stochastically and accurately generate a realistic carrier concentration profile, with a depletion re-

41 gion that is not so rigidly defined as the theoretical depletion approximation. We do so by inserting the Eq. 3.10 and Eq. 3.11 in the overall random walk for-loop, under each electric field calculation, to update carrier motion probabilities for each infinite sheet. For a pseudocode summary of the entire simulation process, see the following section.

Figure 4-3: Carrier motion probabilities describe carrier movement given by oppos- ing drift and diffusion processes, dependent on the diffusion coefficient and internal electric field. The equilibrated result is a depletion region, in which theoretically no charge carriers reside; however, our simulations account for stochastic effects, and will show a more realistic depletion region with few charge carriers remaining.

4.1.3 Running the simulation

To summarize the simulation overview, we provide a pseudocode description of the data structures used and the simulation process. As discussed, we initialize the following data arrays, to keep track of charge, electric field, and carrier motion prob- abilities on each infinite sheet, shown in Table. 4.1 below.

42 Table 4.1: Data arrays used to keep track of system behavior at each infinite sheet location, denoted with index i. Examples of initial values stored in the arrays are shown in the last column.

Data array Function at ith sheet Ex. of data stored at index i Na Number of acceptor atoms 2000 acceptors (one - unit charge) Nd Number of donor atoms 2000 donors (one + unit charge) holes Number of holes 2000 holes (one + unit charge) elecs Number of electrons 2000 electrons (one - unit charge) rholes Probability that hole moves right 0.5 lholes Probability that hole moves left 0.5 relecs Probability that electron moves left 0.5 lelecs Probability that electron moves left 0.5 E-field Electric field felt by carrier 0.00005 N/C

The pseudocode for the entire simulation process is also shown on the next page. We see that the nested for-loop provides a simple structure: for each time step of the random walk, we iterate through the series of parallel random sheets, updating the electric field and carrier motion probabilities, which depend on the positions of carriers and fixed charges from the previous time step. Then, we use the carrier motion probabilities to update the position of carriers, which will in turn define the electric field and motion probabilities for the next time step. The simulation source code may be found in Appendix B.

43 4.2 Material parameters for p-n simulations

Having set up the simulation, we now briefly list material parameters that are specific to silicon. From Hu, we obtain that typical doping concentrations in silicon are around 1 × 1016 cm−3 for electrons and holes, which we will use for preliminary simulations.[2] Mobility of charge carriers is given by material parameters, so we also use typical values for silicon, i.e. 0.13 m/V · s for electrons and 0.04 m/V · s

for holes.[2] Moreover, the intrinsic carrier concentration of silicon is around ni = 1 × 1010 cm−3 at room temperature of 300 K; in our simulations, for ease of setup in defining minority carrier concentrations, we change the intrinsic carrier concentration to be around 1 × 1015 cm−3. Note that this does not affect the overall behavior of the system.

4.3 Scaling parameter derivations

To simplify the mechanics of our simulation, we introduce three pairs of scaling parameters. The first pair, time step ∆t and position step ∆x, are the mean free time and mean free path between collisions, respectively. They correspond to the random walk time step, as well as the distance between infinite sheets. In addition, we also make use of parameters to determine doping concentration, which are related to the number of initial charge carriers on each sheet init and area of each sheet A. For ease of calculating the induced electric field within each time step, we also

∗ introduce a unitless parameter E and scaling parameter E0. The parameters and relevant conversions are summarized in Table. 4.2 and Table. 4.3 below, and can be referenced in the source code in Appendix B. We now establish the derivation and usage of each pair of scaling parameters.

4.3.1 Fixed physical dimension (∆x) and time scale (∆t)

We briefly note the physical dimension and time scale of our simulation. Firstly, we set the position step to ∆x to 20 nanometers, which is a typical value for the mean

44 Table 4.2: Summary of scaling parameters and their interpretation, or conversion to SI units. Values shown are initial values.

Parameter Symbol Fixed/Variable Value Interpretation Time step ∆t Fixed 5.88 × 10−14 s Random walk time step Position step ∆x Fixed 2 × 10−8 m Distance b/w adjacent sheets Initial carriers init Variable 2000 Doping concentration −11 2 Area of sheet A Fixed 1 × 10 m Nd = init · A · ∆x ∗ N E-field unit E Variable 2 Electric field E-field scaling E Fixed q E = E∗ · E 0 εsA 0

Table 4.3: Summary of other constant parameters, both unitless and in SI units. Constants obtained from Hu.[2]

Physical interpretation Symbol Value or unitless description Number of time steps taken overall numSteps 20000 steps Total number of sheets numSheets 100 sheets Net charge on each sheet N counts Electron charge q 1.6 × 10−19 C −12 Permittivity of silicon εs 12 · 8.85 × 10 F/m 2 Mobility of electrons in silicon µn 0.13 m /V · s 2 Mobility of holes in silicon µp 0.04 m /V · s kT Thermal voltage q 0.02586 V

free path of electron transport within silicon from Vasileska, et al.[9] Over the fixed number of N = 100 sheets, this indicates we are simulating a p-n junction system in a range spanning about 2 µm. For ease of interpreting results, we will keep this physical dimension fixed. For ease of simulation, we will also set the boundary condition that carriers cannot move out of the 2 µm p-n junction system. For our time scale, we use ∆t = 5.88 × 10−14 seconds, or 0.0588 picoseconds. This value is determined as follows. We first refer back to Eq. 3.7 for the diffusion coefficient derived in Chapter 3, reproduced below.

(∆x)2 D = (r + l) (3.7) 2∆t At this point, we have assumed a fixed value for ∆x, and are able to find carrier motion probabilities r and l through the process outlined in Section 4.1.2. Thus, the only unknown values so far are the diffusion coefficient D and time step ∆t.

45 However, as mentioned in Chapter 3, Section 3.1.2, the diffusion coefficient is a constant material parameter. It is commonly defined by the Einstein relationship, shown in Eq. 4.2 and Eq. 4.3.[2] This relationship indicates that we can calculate the

kT diffusion coefficient values for electrons and holes by multiplying thermal voltage q by the respective carrier mobilities.

kT D = µ (4.2) n q n kT D = µ (4.3) p q p From these equations, we can obtain an appropriate constant value for D, then plug it back into into Eq. 3.7. In order to define a reasonable value for ∆t, we will choose to use the Einstein relationship with electron mobility in Eq. 4.2, and assume the basic random walk case, in which the left and right motion probabilities satisfy r + l = 1. We obtain the diffusion coefficient D = 34 cm2/s, which is a realistic value for electron transport in silicon.[2] From this value, we determine ∆t = 5.88 × 10−14 seconds. Note that this time scale value is within range for the typical mean free time between collisions during carrier flow, as found in Vasileska, et al., so our process for defining ∆t has been effective.[9] Finally, we will run each simulation over 20,000 time steps, which is a number experimentally determined to let the system reach equilibrium; with the time step of ∆t = 5.88 × 10−14 seconds, we essentially simulate the system for around 1.2 nanoseconds.

4.3.2 Doping concentration: fixed A and variable init

Doping concentrations are a measure of number of dopants within a certain vol- ume, and we have three relevant scaling parameters to control this: the area of each sheet A, the fixed position step ∆x, and the initial number of charge carriers on each sheet, init. To effectively vary doping concentration, we must set an additional parameter to a constant, and we have chosen to fix the area of each sheet, A. There

46 is a subtlety to this point, as in our setup we mentioned the use of infinite sheets; we are not considering variation along the axes parallel to the p-n junction interface and our simulation is wholly 1-dimensional. However, we fix the area of each sheet to be a sufficiently large value (10 µm) compared to the lateral dimension of the p-n junction (2 µm), which preserves our infinite sheet assumption. We can then set dopant concentration by varying the number of charge carriers and donors/acceptors on each sheet, which is controlled by the variable init. For our simulations, we set the value of init at 2000 counts, corresponding to a doping concentration of 1 × 1016 cm−3 by the conversion shown in Table 1.

4.3.3 Electric field: fixed scaling parameter and E-field unit

Next, we discuss the scaling parameter and unit used for the induced electric

∗ field, E0 and E . Recall that in order to calculate the electric field at each time step, we have create an E-field array to store the electric field felt by carriers in each infinite sheet. As discussed in Section 4.1.1, by Gauss’ Law, the net charge on each infinite sheet will give us the magnitude of the electric field produced by said sheet. The direction of the electric field points out of or into the sheet, depending on the signage of net charge on the sheet and the signage of the moving charge carrier, but will always be opposite for left and right sides of the sheet. In order to fill in the position array, we have to iterate over all the infinite sheets while considering if they are to the left or right of the target sheet. Since this process is relatively involved, we find it easier to establish an electric field unit, E∗, which is directly proportional to the net charge N, to describe the electric field produced by each sheet; in order to convert to SI units, we multiply by an E-field scaling parameter E0. The derivation is summarized below. From our previous discussion, we have the electric field generated by an infinite sheet as: Nq E = (4.1) 2εSA

47 We can pull out the physical constants to define the E-field scaling parameter:

q E0 = (4.4) εSA

So, the E-field unit parameter is then

N E∗ = (4.5) 2

∗ with the electric field SI unit conversion given by E = E · E0. Having defined these scaling parameters, it is simple to write the process for finding electric field on each sheet. Additionally, these scaling parameters also help us simplify the code to for left/right movement probabilities within the random walk. For example, from Chapter 3 Eq. 3.10, the bias in the probability of moving right in a basic random walk with r + l = 1 is

1 µE∆t µE ∆t µe∆t r − = = E∗ 0 = E∗ 2 2∆x 2∆x 2εsA∆x in which we can simplify the complicated fraction to a constant, c = µe∆t . For 1 2εsA∆x reference, see code in Appendix B.

4.4 Simulation strategy

4.4.1 Basic p-n junction case

Having set up simulation parameters, we now discuss implementation strategy and expectations. In this thesis, we will explore two different cases of p-n junction simulations. Firstly, as proof of concept, we consider a simple basic case in which charge carriers can either move left or right, corresponding to the basic random walk case in Chapter 3. For this simulation, since the probabilities of moving left and right sum to 1, we will use the carrier probabilities in a simplified form, derived from Eq. 3.13 and Eq. 3.14:

48 µE∆t D∆t µE∆t 1 r = + = + 2∆x (∆x)2 2∆x 2 (4.6) µE∆t D∆t µE∆t 1 l = − + = − + 2∆x (∆x)2 2∆x 2

4.4.2 Limitation of basic p-n junction case

However, we now explain that basic random walk assumption results in a key limitation: namely, that we can only incorporate the diffusion coefficient value for electrons. From Eq. 4.6 above, we see that we have equated the diffusion term to:

D∆t 1 = (4.7) (∆x)2 2 From our definition of the fixed time and position step parameters in Section 4.3.1, this relation only works with the electron diffusion coefficient, which is dependent

on electron mobility µn by the Einstein relationship in Eq. 4.2. However, we recall from Table. 4.3 that holes have a different mobility, and therefore a different diffusion

2 constant. If we plug in the hole mobility µp = 0.04 m /V · s to Eq. 4.7, we obtain:

D ∆t kT ∆t 1 p = ( µ ) = 0.1521 6= (4.8) (∆x)2 q p (∆x)2 2 Then from the first half of Eq. 4.6, we have

µ E∆t r = p + 0.1521 (4.9) p 2∆x µ E∆t l = − p + 0.1521 (4.10) p 2∆x in which rp + lp = 0.3042 6= 1. We infer from this equation that about 70% of holes do not move left or right, i.e. they need to stay in place. However, our basic random walk method requires that rp + lp = 1, which results in an incorrect carrier motion probability. For instance, if rp is calculated first in the simulation, as shown in Eq.4.9, then we have an incorrect expression

49 µ E∆t l = 1 − r = − p + 0.8479 (4.11) p p 2∆x which will force holes that should have stayed in place to move towards the left, as opposed to the correct expression in Eq. 4.10. Thus, the basic random walk cannot accurately model p-n junction behavior when realistic diffusion coefficients are incorporated; we will demonstrate this in Chapter 5, Section 5.2.

4.4.3 Compound p-n junction case

The basic case limitation pushes us to consider a compound case, in which charge carriers can move left, right, or stay in place, corresponding to the compound random walks performed in Chapter 3. For this simulation, we will use the original form of carrier motion probabilities:

µE∆t D∆t r = + 2∆x (∆x)2 (4.12) µE∆t D∆t l = − + 2∆x (∆x)2 Additionally, during the process of updating position arrays, as shown in the pseudocode in Section 4.1.3, we will add cases to account for carriers staying in place. This relaxes the requirement that the left and right motion probabilities must sum to 1 for both electrons and holes. Then, we can use the electron and hole mobilities in Table. 4.3 to obtain different diffusion coefficients Dn and Dp, plug them in to the above equations, and independently calculate four motion probabilities: electrons moving right (rn) and left (ln), as well as holes moving right (rp) and left (lp). For reference, see the compound p-n junction code in Appendix B. Thus, the compound p-n junction allows us to move beyond the limitations of the basic case and incorporate realistic mobilities for different charge carriers. We will demonstrate this result in Chapter 5, Section 5.3.

50 Chapter 5

Results

In this chapter, we will explore two different cases of the p-n junction simulations: basic and compound. For clarity, we briefly outline our expectations. 1. Overall, the behavior of our p-n junction simulations should match theoreti- cal predictions discussed in Chapter 2. By dynamically changing the carrier motion probabilities for mobile charge carriers performing random walks, we implement coun- terbalanced drift and diffusion processes. We expect these processes to give typical depletion width, electric field, and electric potential profiles for a p-n junction. 2. In Section 4.4.2, we discussed the limitation of using a basic random walk strategy that assumes carriers move either left or right, namely that the diffusion co- efficient value is constrained. Hence, we expect that the basic p-n junction simulation cannot incorporate a realistic diffusion coefficient for holes, and we will demonstrate how the simulation fails in Chapter 5, Section 5.2. 3. In Section 4.4.3, we have proposed a compound p-n junction simulation, which will solve the aforementioned problem. We expect two results: firstly, when we plug in identical values for diffusion coefficients, as in the basic case, the compound case will display identical behavior. Secondly, when we plug in the hole mobility and diffusion coefficient, the compound case will successfully model the p-n junction with realistic material parameters.

51 5.1 Basic p-n junction simulation

Here we present simulation results of the basic p-n junction simulation, assum- ing doping concentration of 1e16 cm−3 for both the p-type and n-type regions. As discussed in Chapter 4, our carrier motion probabilities are:

µE∆t 1 r = + 2∆x 2 (4.6) µE∆t 1 l = − + 2∆x 2

Having set up the relationship between probability of directional movement and the strength of the electric field felt by each infinite sheet, we can run the simulation for 20,000 time steps, an experimentally determined length of time decided by how quickly the simulation results stabilize. Since the time step ∆t = 0.0588 ps, each run simulates the system over 1.2 ns. Final results are averaged over 2000 runs. As shown in Figure. 5-1(a), we start from a particle density of 2000 carriers on each infinite sheet for holes and electrons, and as the system evolves, the depletion region is formed due to the balancing diffusion and drift processes. The black and red lines indicate concentrations of holes and electrons versus position in the junction, and the green line indicates the distribution of total charge; as expected, there is a depletion of charge around the junction, but the transition between bulk material and depletion region is not as abrupt as that of the theoretical model, in Figure. 5-1(b). The theoretical expectation for depletion width, using the conventional theory outlined in Chapter 2, is graphed in the blue line in Figure. 5-1(a); visual inspection will confirm that our simulation result matches this value. An estimate of depletion width from our simulation, given by a full-width-half-max calculation, shows that the estimated depletion width of 5.742∆x, or around 115 nm, is close to the expected theoretical value of 7.834∆x, or around 157 nm, calculated using the depletion ap- proximation in Chapter 2. This simulation performance matches our expectation for the stochastic benefits of our random walk model; we have obtained depletion width results within around 25% from the theoretical value. We note that the theoretical depletion width approximation does not necessarily depict a perfectly realistic deple-

52 tion layer, which indicates that our simulation results are viable. Using basic random walks, we have included a statistical estimate of realistic carrier distribution around the depletion region, and did so without resorting to the complexity of conventional partial differential equation solutions. Next, we briefly consider the np product relation, previously mentioned in Chapter 2. Since we have not yet incorporated recombination-generation processes in our simulation, we do not expect this relation to hold true. However, our chosen minority carrier concentration happens to approximate the np product relation, as follows.

2 From Chapter 2, Section 2.1, we have the relation np = ni , which we can write in the form: np 2 = 1 (2.1) ni For ease of simulation, we assume that there is an integer number of minority carriers

2 per sheet, i.e. 2 carriers per sheet. We obtain an estimated value for ni by graphing the product of electron and hole concentrations (np) versus position. Since we want

2 the product to remain constant, we can then optimize for ni ; in Figure. 5-2, we show 2 42 −6 2 that the estimate ni = 2.8 × 10 m gives a 1:1 ratio of np and ni for our current system.

2 Without incorporating recombination-generation processes, the ni estimate is larger than expected. An additional source of error lies in our boundary conditions. Because carriers cannot move beyond the 100 sheets, the carriers originally in the de- pletion layer have to spread out over the quasi-neutral regions; this results in a higher carrier count than expected. In addition, there is a small peak in the np product at the p-n junction interface, which is caused by the few charge carriers remaining in the depletion layer, as shown in Figure. 5-1(a). Future work can compensate for these effects with more sophisticated boundary conditions or a longer physical length for the p-n junction, which will allow the quasi-neutral regions to be closer to neutral. The fundamental solution would be to incorporate carrier generation and recombination processes to ensure the system is in dynamic equilibrium. Nevertheless, for the purposes of this thesis, the overall

53 (a) Graph of p-n junction carrier distribution and depletion width us- ing basic random walk method. Black and red lines indicate hole and electron distribution, respectively, and the green line indicates total charge distribution. Blue line is the theoretical expectation for depletion width of 7.834∆x, whereas our simulation results in a depletion width of 5.742∆x, which is within around 25% of the theoretical result calculated using the depletion approximation in Chapter 2.

(b) Theoretical description of p-n junction total charge distribution. Total charge distribu- tion is the solid black lines, while the depletion width is the distance between −xp0 and xn0. We note the abrupt transition from bulk material to depletion region completely devoid of charge carriers, which arises from the purely numerical nature of the partial differential equation solution method.[11]

Figure 5-1: Comparing the total charge distribution and depletion width estimates of our basic p-n junction simulation, versus the theoretical expectation from the depletion approximation explained in Chapter 2.

54 2 42 Figure 5-2: An estimate of ni = 2.8 × 10 allows us to approximate the expected 2 relation np = ni . behavior of the p-n junction is not overly affected. Since our simulation is just a proof

2 of concept, we can still use our estimated ni value to calculate the electric potential, as derived in Chapter 2.

2 Having discussed depletion width and obtained an estimate for ni , we now look into the electric field and potential graphs of the p-n simulation to confirm that the simulation is modeling the correct processes. As shown in Figure. 5-3, we obtain the electric field by integrating over charge distribution and obtain the potential graph by integrating over the electric field. For comparison, since at each step in our random walk simulation we calculate the electric field felt by the charge carriers on each infinite sheet, we already have an array of electric field values for each position in the p-n junction. We can then directly graph the electric field in Figure. 5-3(a), and then integrate to obtain the voltage versus position graph in Figure. 5-4(a). Using the integration method for the potential, we obtain a value of 0.0941 V from the simulation. The theoretical potential, obtained using the depletion approximation in Chapter 2, is 0.0925 V; our simulated potential is accurate to within 1% of the

2 42 . Both potential calculations use the estimated value of ni = 2.8×10 m−6 from Figure. 5-2.

55 (a) Simulation results for the net electric field, in which the electric field is directly graphed from the array E-field used to calculate random walk probabilities, previously discussed in Chapter 4.

(b) Theoretical description of p-n junction electric field.[11]

Figure 5-3: Comparing the electric field of simulation versus that of the theoretical description.

56 (a) Potential is calculated by integrating the electric field from Figure. 5- 3(a).

(b) Theoretical description of p-n junction potential profile.[11] Poten- tial is calculated by integrating the electric field from Figure. 5-4(a).

Figure 5-4: Comparing the potential profile of simulation versus that of the theoret- ical description. Results from the potential calculation show a close match between simulation (0.0941 V) and theory (0.0925 V), which are within 1% of each other.

57 5.2 Realistic diffusion coefficient issue

From our previous discussion in Chapter 4, Section 4.4.2, we know that when we

plug in realistic values of µp and Dp for holes into a basic p-n junction simulation, we bias the carriers to move in one direction. Recall that the carrier motion probabilities for holes become:

µ E∆t r = p + 0.1521 (4.10) p 2∆x µ E∆t l = − p + 0.8479 (4.12) p 2∆x Thus, carriers that should stay in place are biased to move towards the left. Since boundary conditions constrain carriers to stay within the p-n system of 100 sheets, there is a buildup of holes at the left end of the system. Due to local Coulomb interactions taken into account by the drift term our carrier motion probabilities, a significant number of electrons also move towards the left end of the system. Figure. 5- 5 demonstrates this behavior.

Figure 5-5: Basic p-n junction simulation with realistic hole mobility and diffusion coefficient. Performance fails due to no consideration of carriers staying in place. By default, extra carriers move with bias towards one end of the junction

58 Therefore, to fix this issue, we add independent calculations of both left and right movement probabilities, as well as cases to account for carriers staying in place. This becomes our compound p-n junction simulation, with code in Appendix B.3.

5.3 Compound p-n junction simulation

Here we explore the results of the compound p-n junction simulation, defined as using the hole motion probabilities below. As before, we obtain the electron motion probabilities by changing the sign of the first term.

µE∆t D∆t r = + 2∆x (∆x)2 (4.6) µE∆t D∆t l = − + 2∆x (∆x)2 Again, we start from the initial concentration of 2000 charge carriers (either holes or electrons) on each infinite sheet, simulate the system over a total time frame of 1.2 ns, and average results over 2000 runs. In Figure. 5-6(a), we only use the electron diffusion coefficient in order to demonstrate consistency with the basic p-n junction simulation. As shown, we obtain a depletion width of 5.745∆x. This value is within 0.1% of the depletion width found using the basic p-n junction simulation, 5.742∆x; the difference is negligible and arises from the stochastic nature of the simulation. In addition, there is no significant difference in our estimates for potential; the compound case results in a potential of 0.0944 V, which is within 0.5% of the previous basic case potential, 0.0941 V. Therefore, our compound p-n junction simulation and basic p-n junction simulation are consistent. Next, we demonstrate the advantages of using the compound p-n junction simu-

lation. In Figure. 5-6(b), we now plug in realistic values of µp and Dp for holes. As discussed in Chapter 4, Section 4.4.3, since the compound p-n junction simulation accounts for carriers staying in place, we are no longer constrained by the requirement

that rp + lp = 1. This allows us to calculate the carrier motion probabilities inde- pendently, and results in the expected equilibration process for a p-n junction. We

59 obtain a depletion width of 5.716∆x, which is reasonable given the range of depletion width values we have simulated so far. In short, from these runs of the compound p-n junction simulation, we can see that our expectation for consistency with the basic p-n junction simulation is met. In addition, we can use different mobilities and diffusion coefficient values for different charge carrier species, by adjusting the calculation method of carrier motion proba- bilities and allowing carriers to stay in place. Therefore, the compound approach is the most flexible and comprehensive of our p-n junction simulations.

60 (a) Depletion width w = 5.745∆x, electric potential 0.0944 V, using the same simulation parameters as the basic p-n junction simulation.

(b) Depletion width w = 5.716∆x, electric potential 0.0930 V, using realistic mobility and diffusion coefficient for holes.

Figure 5-6: Compound p-n junction simulation results are consistent with basic emphp-n junction simulation results, and can also handle realistic mobility and dif- fusion coefficient parameters. The green lines represent total charge concentrations, black lines represent hole concentrations, red lines represent electron concentrations, and the blues lines are the analytical expectations for depletion width, existing as reference.

61 Chapter 6

Conclusions and future work

In this thesis, we have explored the use of Monte Carlo random walks to model drift-diffusion processes, in particular their efficacy at simulating carrier transport in p-n junctions at equilibrium. Here we summarize the conclusions drawn and point towards future research directions. Taking a simple classical view, carrier transport in p-n junctions is character- ized by two counterbalancing processes: diffusion, resulting from difference in carrier concentration gradient, and drift, resulting from local Coulomb interactions between carriers and dopant atoms. To describe this process, we rely on differential equa- tions of varying complexity, such as the drift-diffusion equation discussed in Chapter 3. There are more complex extensions of this equation, discussed in Vasileska et al., that cover semiclassical to quantum approaches and have their respective advantages. [9] However, model complexity quickly becomes an issue, as an increasing number of coupled differential equations are needed to account for external conditions, such as illumination by light sources, etc. By contrast, the most conventional approach towards simulating p-n junctions relies on the depletion approximation, which we have developed the framework for in Chapter 2. As demonstrated, this theoretical treatment can adequately predict p-n junction carrier profiles, but assumes an unrealistic, abrupt depletion layer com- pletely unpopulated by charge carriers. In addition, the mathematical process, while effectively avoiding solving complicated differential equations, requires specific knowl-

62 edge of semiconductor physics and statistical mechanics, thus making it unsuitable for communication to a broader audience. The Monte Carlo random walk approach presents a simple alternative to p-n junc- tion simulation. We revisit the three points proposed in Chapter 1: firstly, random walk simulations result in reasonably accurate and realistic charge carrier profiles, with a small but non-zero amount of charge carriers remaining in the depletion layer. We note that since our simulation makes the classical assumption that particles have a simultaneously defined position and momentum, our simulation is not applicable to small systems where quantum mechanical effects become pronounced. However, for the purposes of large-scale simulation and understanding the key points of junction physics, our model is viable. Secondly, the random walk method is flexible. Since charge carriers are treated as individual particles undergoing random walks that can be biased by external and local effects, external conditions such as radiative excitation can be easily added to the system.[10] Carrier transport in bulk semiconductors is often modelled with random walks for this reason, for example in software such as CASINO,[7] and the capability to model junction physics using similar methods lends a similar degree of flexibility. Thirdly, as we can glean from the discussion in Chapter 1, Section 1.1.2, random walks are mathematically simple and can offer an intuitive understanding of carrier transport to a general audience. Recent literature suggests that in the solar energy industry, open-access platforms for band diagram simulation are valuable for acces- sibility and ease of experimental design. In particular, the band diagram of mobile ions in halide perovskite solar cells is similar to that of p-n junctions, and researchers have proposed a hybrid approach, combining analytical and numerical analysis, to enable a wide range of users to accurately and quickly simulate these systems. [13] Thus, Monte Carlo random walks are a promising avenue for p-n junction sim- ulation. This thesis lays out a basic methodology and presents preliminary results. To summarize, in Chapter 3, we explain and validate how to model drift-diffusion equations with random walks, accounting for different strategies that improve upon the basic random walk model, such as allowing a portion of carriers to stay in place.

63 We then discuss the assumptions and setup for a basic p-n junction, and in Chapter 5, we demonstrate that the random walk approach can model depletion layer profiles with comparable accuracy to the theoretical depletion approximation. In particular, our prior exploration of different random walk models enables us to design a robust and flexible compound p-n junction simulation. We acknowledge that we have made our own share of assumptions, including an exaggerated minority carrier concentration, rigid boundary conditions, transport processes and electric fields that act only in one dimension, and a system confined to the classical regime. These assumptions do not prevent us from capturing the main features of p-n junction behavior; they were all made to simplify the simulation process, and they can be rectified in future work. More broadly, future work on random walk simulation of p-n junctions can fall into three categories. We hope to move towards more accurate and comprehensive physics: as discussed, we can replace assumptions with more realistic conditions. We also need to incorporate more fundamental processes, such as carrier recombination and generation. Computationally, the relative simplicity of this model also presents interesting questions in the cost-benefit analysis of model complexity, as well as the vectorization capabilities of different programming languages. Finally, since the ran- dom walk approach is extremely accessible, both in terms of mathematical simplicity and low computational cost, it can be utilized as an educational tool for undergrad- uate students and non-scientific audiences alike.

64 Appendix A

Simulation code for random walks

A.1 Basic random walk

1 %Random walk basic case

2 %Jennifer Wang, 10/18/19

3

4 c l e a r all; close all

5

6 numWalkers = 20000;%number of walkers

7 N = 1000;%number of steps each walker takes

8 r = 0.5;%probability ofa walk takinga step to the right

9 s=0;%probability of staying in place

10 pos=zeros(1,numWalkers);%initial position of all walkers

11 f i g u r e

12 p l o t(pos,1: numWalkers,’r ∗ ’)

13 a x i s([ −3∗ s q r t(N), 3 ∗ s q r t(N) ,0,numWalkers])

14 pause(.1)

15

16 c= zeros(2 ∗N+1,2);

17 i 0=1;

65 18 i 1=2;

19 c(N) = numWalkers;

20 D= 0.5;

21 U= 0;%U=r −l

22

23 f o rn=1:N

24 prob=rand(1,numWalkers);

25 pos(prob

26 pos(prob >=r+s) = pos(prob >=r+s) −1;

27 % equation

28 f o rm= 2:2 ∗N

29 c(m,i1)=c(m,i0)+D ∗(c(m −1,i0) −2∗c(m,i0)+c(m+1,i0)) ;

30 end

31 i i= i1;

32 i 1= i0;

33 i 0= ii;

34 p l o t(pos,1: numWalkers,’r ∗ ’)

35 a x i s([ −N,N,0,numWalkers])

36 drawnow

37 end

38

39 %the theoretical distribution

40 xMean=(2∗r −1)∗N

41 xMeanSimulation=sum(pos)/numWalkers

42 sigma=sqrt(4 ∗ r ∗(1− r) ∗N)

43 sigmaSimulation=sqrt(sum(pos.ˆ2)/numWalkers −xMeanSimulation ˆ2)

44 C=2∗numWalkers;

45 xDistribution=−N:N;

66 46 probDistribution=C/(sqrt(2 ∗ ∗sigmaˆ2)) ∗ ...

47 exp( −(xDistribution −xMean).ˆ2/(2 ∗ sigmaˆ2));

48 probDistribution 2=C/(sqrt(2 ∗ pi ∗ sigmaSimulationˆ2)) ∗ ...% using simulation mean and sigma

49 exp( −(xDistribution −xMeanSimulation).ˆ2/(2 ∗ sigmaSimulationˆ2));

50 fd=c(:,1);

51 %since walkers split between prev& this step; this is faster

52

53 %plot distribution

54 f i g u r e

55 [binDistribution,binX]=hist(pos,2 ∗N);

56 h i s t(pos,2 ∗N)

57 hold on

58 p l o t(xDistribution,probDistribution 2,’r −’,’LineWidth’,2);

59 p l o t(xDistribution(2:2:end),fd(2:2:end),’g −’,’LineWidth’,2);

60 a x i s([min(binX) −5,max(binX)+5,0,max(binDistribution)/0.65])

61 x l a b e l(’Position’)

62 y l a b e l(’Number of Walkers’)

63 text(min(binX)+(max(binX) −min(binX)) ∗ . 6 ,max(binDistribution) ∗ 1 . 2 , . . .

64 [’r=’,num2str(r)])

65 text(min(binX)+(max(binX) −min(binX)) ∗ . 6 ,max(binDistribution) ∗ 1 . 1 , . . .

66 [’l=’,num2str(1 −r)])

67 text(min(binX)+(max(binX) −min(binX)) ∗ . 6 ,max(binDistribution) ,...

68 [’Number of Walkers=’,num2str(numWalkers)])

69 text(min(binX)+(max(binX) −min(binX)) ∗ . 6 ,max(binDistribution) ∗ . 9 , . . .

67 70 [’Number of Steps=’,num2str(N)])

A.2 Biased random walk

Note that the code for graphing the biased random walk is the same as that of the basic random walk; hence, it is not reproduced below.

1 %Random walk biased case

2 %Jennifer Wang, 10/1/2019

3

4 c l e a r all; close all

5

6 numWalkers = 20000;%number of walkers

7 N = 1000;%number of steps each walker takes

8 r = 0.7;%probability ofa walk takinga step to the right

9 s=0;%always0 for this simulation

10 pos=zeros(1,numWalkers);%initial position of all walkers

11 f i g u r e

12 p l o t(pos,1: numWalkers,’r ∗ ’)

13 a x i s([ −3∗ s q r t(N), 3 ∗ s q r t(N) ,0,numWalkers])

14 pause(.1)

15

16 c= zeros(2 ∗N+1,2);

17 i 0=1;

18 i 1=2;

19 c(N) = numWalkers;

20 D= 0.5;

21 U=r − (1−r);

22

23 f o rn=1:N

24 prob=rand(1,numWalkers);

68 25 pos(prob

26 pos(prob >=r+s) = pos(prob >=r+s) −1;

27

28 %diffusion equation

29 f o rm= 2:2 ∗N% again, since walkers must move positions, c bins alternate even−odd

30 c(m,i1)=c(m,i0)+D ∗(c(m −1,i0) −2∗c(m,i0)+c(m+1,i0)) − U∗0.5∗(c(m+1, i0) − c(m−1, i0));

31 end

32 i i= i1;

33 i 1= i0;

34 i 0= ii;

35 %end

36 p l o t(pos,1: numWalkers,’r ∗ ’)

37 a x i s([ −N,N,0,numWalkers])

38 drawnow

39 end

40

41 %the theoretical distribution

42 xMean=(r −(1−r−s)) ∗N

43 xMeanSimulation=sum(pos)/numWalkers

44 sigma=sqrt(4 ∗ r ∗(1−r−s) ∗N)

45 sigmaSimulation=sqrt(sum(pos.ˆ2)/numWalkers −xMeanSimulation ˆ2)

46 C=2∗numWalkers;

47 xDistribution=−N:N;

48 probDistribution=C/(sqrt(2 ∗ pi ∗sigmaˆ2)) ∗ ...

49 exp( −(xDistribution −xMean).ˆ2/(2 ∗ sigmaˆ2));

50 probDistribution 2=C/(sqrt(2 ∗ pi ∗ sigmaSimulationˆ2)) ∗ ...% using simulation mean and sigma

69 51 exp( −(xDistribution −xMeanSimulation).ˆ2/(2 ∗ sigmaSimulationˆ2));

52 fd=c(:,1);

A.3 Compound random walk

1 %Random Walk compound case

2 %Jennifer Wang, 10/1/2019

3

4 c l e a r all; close all

5

6 numWalkers = 20000;%number of walkers

7 N = 1000;%number of steps each walker takes

8 r = 0.5;%probability ofa walker taking step to right

9 s = 0.1;%probability ofa walker staying

10 pos=zeros(1,numWalkers);%initial position of all walkers

11 f i g u r e

12 p l o t(pos,1: numWalkers,’r ∗ ’)

13 a x i s([ −3∗ s q r t(N), 3 ∗ s q r t(N) ,0,numWalkers])

14 pause(.1)

15

16 c= zeros(2 ∗N+1,2);

17 i 0=1;

18 i 1=2;

19 c(N) = numWalkers;

20 D= (1 −s) ∗ 0 . 5 ;%half of prob right+ prob left

21 U=r −(1−r−s);%prob right − prob left

22

23 t i c

70 24 f o rn=1:N

25 prob=rand(1,numWalkers);

26 pos(prob <=r) = pos(prob <=r)+1;

27 pos(prob >=r+s) = pos(prob >=r+s) −1;

28

29 %diffusion equation

30 f o rm= 2:2 ∗N

31 c(m,i1)=c(m,i0)+D ∗(c(m −1,i0) −2∗c(m,i0)+c(m+1,i0)) − U∗0.5∗(c(m+1, i0) − c(m−1, i0));

32 end

33 i i= i1;

34 i 1= i0;

35 i 0= ii;

36 p l o t(pos,1: numWalkers,’r ∗ ’)

37 a x i s([ −N,N,0,numWalkers])

38 drawnow

39 end

40 toc

41

42 %the theoretical distribution

43 xMean=(r −(1−r−s)) ∗N

44 xMeanSimulation=sum(pos)/numWalkers

45 sigma=sqrt(4 ∗ r ∗(1−r−s) ∗N)

46 sigmaSimulation=sqrt(sum(pos.ˆ2)/numWalkers −xMeanSimulation ˆ2)

47 C= numWalkers;%removed the ∗2 fudge factor

48 xDistribution=−N:N;

49 probDistribution=C/(sqrt(2 ∗ pi ∗sigmaˆ2)) ∗ ...%using theoretical mean and sigma

50 exp( −(xDistribution −xMean).ˆ2/(2 ∗ sigmaˆ2));

71 51 probDistribution 2=C/(sqrt(2 ∗ pi ∗ sigmaSimulationˆ2)) ∗ ...% using simulation mean and sigma

52 exp( −(xDistribution −xMeanSimulation).ˆ2/(2 ∗ sigmaSimulationˆ2));

53

54 %plot distribution

55 f i g u r e

56 [binDistribution,binX]=hist(pos,N);

57 h i s t(pos,N)

58 hold on

59 p l o t(xDistribution,probDistribution,’k −’,’LineWidth’,2);

60 p l o t(xDistribution,probDistribution 2,’r −’,’LineWidth’,2);

61 p l o t(xDistribution,c(:,1),’g −’,’LineWidth’,2);%either c1 or c2 works

62 a x i s([min(binX) −5,max(binX)+5,0,max(binDistribution)+sqrt( numWalkers)])

63 x l a b e l(’Position’)

64 y l a b e l(’Number of Walkers’)

65 text(min(binX)+(max(binX) −min(binX)) ∗ . 6 ,max(binDistribution) ∗ 1 . 4 , . . .

66 [’r=’,num2str(r)])

67 text(min(binX)+(max(binX) −min(binX)) ∗ . 6 ,max(binDistribution) ∗ 1 . 3 , . . .

68 [’s=’,num2str(s)])

69 text(min(binX)+(max(binX) −min(binX)) ∗ . 6 ,max(binDistribution) ∗ 1 . 2 , . . .

70 [’l=’,num2str(1 −r−s)])

71 text(min(binX)+(max(binX) −min(binX)) ∗ . 6 ,max(binDistribution) ∗ 1 . 1 , . . .

72 [’Number of Walkers=’,num2str(numWalkers)])

72 73 text(min(binX)+(max(binX) −min(binX)) ∗ . 6 ,max(binDistribution) ,...

74 [’Number of Steps=’,num2str(N)])

73 Appendix B

Simulation code for p-n junctions

B.1 Basic p-n junction

1 %PHYS 370, Jennifer Wang, 5/5/20

2 %biased random walk to simulate pn junction at equilibrium

3

4 %variables

5 numSteps = 50000;

6 N= 100;% number of sheets, assume even

7

8 i n i t = 2000;

9 dt = 5.88e −14;%time step

10 dx=2e −8;%position step

11 A=1e −11;

12 N a= init;% units ofe, number of negative charges due to nucleus of acceptor atom

13 N d= init;

14 h o l e s i n i t= init;

15 e l e c s i n i t= init;

16 m i n c a r r i e r s=2;%resulting in intrinsic concentration about

74 1e13

17

18 mob p = 0.13;%for holes,SI units

19 mob n = 0.13;%for electrons,SI units

20 e p s s=12 ∗8.85e −12;

21 e = 1.6e −19;

22 E 0=e/(eps s ∗A);

23 th ermal vol tage = 0.02586;%volts, kT/e

24

25 %probability coefficients

26 c1 p= mob p∗e∗dt/(2 ∗ e p s s ∗A∗dx);

27 c1 n= mob n∗e∗dt/(2 ∗ e p s s ∗A∗dx);

28 c2 p = 0.5;%(thermal vol tage ∗mob p) ∗dt/(dxˆ2);

29 c2 n = 0.5;%(thermal vol tage ∗mob n) ∗dt/(dxˆ2);

30

31 %initialize data structures

32 Na= cat(2, −ones(1,N/2) ∗N a, zeros(1,N/2));

33 Nd= cat(2, zeros(1,N/2) , ones(1,N/2) ∗N d);

34 h o l e s= cat(2, ones(1,N/2) ∗ h o l e s i n i t, ones(1,N/2) ∗ m i n c a r r i e r s);

35 e l e c s= cat(2, ones(1,N/2) ∗ m i n c a r r i e r s, ones(1,N/2) ∗ e l e c s i n i t);

36

37 E= zeros(1,N);

38 r h o l e s= zeros(1,N);

39 r e l e c s= zeros(1,N);

40

41 %cumulative data structures

42 h o l e s t o t= zeros(1,N);

43 e l e c s t o t= zeros(1,N);

75 44 E tot= zeros(1,N);

45

46 loop = 2000;

47

48 t i c

49

50 %biased random walk loop

51 f o rn= 1:numSteps%for every step

52 tempH= zeros(1,N);

53 tempE= zeros(1,N);

54 f o ri=1:N%for every slice

55 %calculateE field and probability on each slice

56 i fi == 1

57 E(i)= −sum(holes(2:N) −e l e c s(2:N)+Na(2:N)+Nd(2:N) ) /2;

58 e l s e i fi ==N

59 E(i)= sum(holes(1:N −1)−e l e c s(1:N −1)+Na(1:N−1)+Nd ( 1 :N−1) ) /2;

60 e l s e

61 pos=1:i −1;

62 neg=i+1:N;

63 p o s f i e l d= sum(holes(pos) −e l e c s(pos)+Na(pos)+Nd( pos));

64 n e g f i e l d= sum(holes(neg) −e l e c s(neg)+Na(neg)+Nd( neg));

65 E(i)=(pos f i e l d − n e g f i e l d)/2;

66 end

67 r h o l e s(i)=E(i) ∗ c1 p+ c2 p;

68 r e l e c s(i)= −E(i) ∗ c1 n+ c2 n;

69

76 70 %%%% HOLES %%%%

71 numH= holes(i);% num holes in this slice

72 prob= rand(1, numH);% generate random probability f o r each hole in this slice

73 numRight= sum(prob

74 i fi==1% leftmost slice

75 tempH(2) = tempH(2) + numRight;%move right

76 tempH(1) = tempH(1) + (numH − numRight);%can’t move left

77 e l s e i fi==N% rightmost slice

78 tempH(N−1) = tempH(N−1) + (numH − numRight);% move left

79 tempH(N) = tempH(N) + numRight;%can’t move right

80 e l s e% any other slice

81 %note tempH(i)= numH −numH since we assume all p a r t i c l e s move

82 tempH(i+1) = tempH(i+1) + numRight;%move right

83 tempH(i −1) = tempH(i −1) + (numH − numRight);% move left

84 end

85 %%%% ELECTRONS %%%%

86 numE= elecs(i);% num electrons in this slice

87 prob= rand(1, numE);% generate random probability f o r each electron in this slice

88 numRight= sum(prob

89 i fi==1% leftmost slice

90 tempE(2) = tempE(2) + numRight;%move right

91 tempE(1) = tempE(1) + (numE −numRight);%can’t move left

92 e l s e i fi==N% rightmost slice

77 93 tempE(N−1) = tempE(N−1) + (numE−numRight);%move l e f t

94 tempE(N) = tempE(N) + numRight;%can’t move right

95 e l s e% any other slice

96 tempE(i+1) = tempE(i+1) + numRight;%move right

97 tempE(i −1) = tempE(i −1) + (numE−numRight);%move l e f t

98 end

99 end

100 % update hole and electron position arrays

101 h o l e s= tempH;

102 e l e c s= tempE;

103

104 i fn > (numSteps −loop)

105 h o l e s t o t= holes t o t+ holes;

106 e l e c s t o t= elecs t o t+ elecs;

107 E tot=E tot+E;

108 end

109 end

110

111 toc

112

113 h o l e s t o t= holes t o t/loop;

114 e l e c s t o t= elecs t o t/loop;

115 E tot=E tot/loop;

116 tot= holes t o t −e l e c s t o t+Nd+Na;

117

118 % GRAPH %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

78 119 pos=1:N;

120 f i g u r e(1);

121 p l o t(pos, holes t o t,’black’)

122 hold on

123 p l o t(pos, elecs t o t,’red’)

124 hold on

125 p l o t(pos, tot,’green’)

126 hold on

127 p l o t(46:54, ones(1,9),’blue’)

128 hold off

129

130 ax= gca;

131 ax.FontSize = 16;

132 x l a b e l(’Position’)

133 y l a b e l(’Particle Density’)

134 legend( { ’Holes’,’Electrons’,’Total’ } ,’Location’,’northwest ’)

135 t i t l e(’Carrier concentrations and depletion width’)

136

137 f i g u r e(2);

138 n i 2 = 2.8e42;%estimated from np graph

139 np= elecs t o t. ∗ h o l e s t o t/((A ∗dx)ˆ2);

140 p l o t(pos, np/n i 2);

141 a x i s([0 100 0 1.2])

142 t i t l e(’np/n iˆ2 vs. position’)

143

144 f i g u r e(3);

145 E=E tot ∗E 0;%convert back to electric field units

146 p l o t(pos,E);

147 t i t l e(’E field vs. position’)

79 148

149 f i g u r e(4);

150 V= cumtrapz( −E∗dx);

151 p l o t(pos,V);

152 t i t l e(’Voltage vs. position’)

153 V sim= trapz( −E∗dx)

154

155 %Depletion Width %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

156 na=N a/(A ∗dx);

157 nd=N d/(A ∗dx);%back into units of meters

158 V t= thermal vol tage ∗ log(na ∗nd/n i 2)

159

160 %simulated depletion width

161 h= max(tot)/2;

162 a b s t o t= abs(tot);

163 idx1=find(abs tot >h,1) +[ −1 0 ] ;

164 idx2=find(abs tot >h,1,’last’) +[0 1];

165 x1= interp1(abs t o t(idx1),pos(idx1),h);

166 x2= interp1(abs t o t(idx2),pos(idx2),h);

167 w sim dim= x2 − x1

168

169 %theoretical depletion width

170 w= sqrt(2 ∗ e p s s ∗V t ∗(na+ nd)/(na ∗nd∗e));

171 w t dim=w/dx

B.2 Compound p-n junction

Note that graphing instructions for the concentration profile, electric field, and potential are identical to the graphing instructions in section B.1 and are thus not

80 reproduced below.

1 %PHYS 370, Jennifer Wang, 5/5/20

2 %compound random walk to simulate pn junction at equilibrium

3

4 %variables

5 numSteps = 20000;

6 N= 100;% number of sheets, assume even

7

8 i n i t = 2000;

9 dt = 5.88e −14;%time step

10 dx=2e −8;%position step

11 A=1e −11;

12 N a= init;% units ofe, number of negative charges due to nucleus of acceptor atom

13 N d= init;

14 h o l e s i n i t= init;

15 e l e c s i n i t= init;

16 m i n c a r r i e r s=2;%resulting in intrinsic concentration about 1e13

17

18 mob p = 0.13;%for holes,SI units

19 mob n = 0.13;%for electrons,SI units

20 e p s s=12 ∗8.85e −12;

21 e = 1.6e −19;

22 E 0=e/(eps s ∗A);

23 th ermal vol tage = 0.02586;%volts, kT/e

24

25 %probability coefficients

26 c1 p= mob p∗E 0∗dt/(2 ∗ dx);

27 c2 p = 0.5;%(thermal vol tage ∗mob p) ∗dt/(dxˆ2);

81 28 c1 n= mob n∗E 0∗dt/(2 ∗ dx);

29 c2 n = 0.5;%(thermal vol tage ∗mob n) ∗dt/(dxˆ2);

30

31 %initialize data structures

32 Na= cat(2, −ones(1,N/2) ∗N a, zeros(1,N/2));

33 Nd= cat(2, zeros(1,N/2) , ones(1,N/2) ∗N d);

34 h o l e s= cat(2, ones(1,N/2) ∗ h o l e s i n i t, ones(1,N/2) ∗ m i n c a r r i e r s);

35 e l e c s= cat(2, ones(1,N/2) ∗ m i n c a r r i e r s, ones(1,N/2) ∗ e l e c s i n i t);

36

37 E= zeros(1,N);

38 r h o l e s= zeros(1,N);

39 r e l e c s= zeros(1,N);

40

41 %cumulative data structures

42 h o l e s t o t= zeros(1,N);

43 e l e c s t o t= zeros(1,N);

44 E tot= zeros(1,N);

45

46 loop = 2000;

47

48 t i c

49

50 %biased random walk loop

51 f o rn= 1:numSteps%for every step

52 tempH= zeros(1,N);

53 tempE= zeros(1,N);

54 f o ri=1:N%for every slice

55 %calculateE field and probability on each slice

82 56 i fi == 1

57 E(i)= −sum(holes(2:N) −e l e c s(2:N)+Na(2:N)+Nd(2:N) ) /2;

58 e l s e i fi ==N

59 E(i)= sum(holes(1:N −1)−e l e c s(1:N −1)+Na(1:N−1)+Nd ( 1 :N−1) ) /2;

60 e l s e

61 pos=1:i −1;

62 neg=i+1:N;

63 p o s f i e l d= sum(holes(pos) −e l e c s(pos)+Na(pos)+Nd( pos));

64 n e g f i e l d= sum(holes(neg) −e l e c s(neg)+Na(neg)+Nd( neg));

65 E(i)=(pos f i e l d − n e g f i e l d)/2;

66 end

67 r h o l e s(i)=E(i) ∗ c1 p+ c2 p;

68 l h o l e s(i)= −E(i) ∗ c1 p+ c2 p;

69 r e l e c s(i)= −E(i) ∗ c1 n+ c2 n;

70 l e l e c s(i)=E(i) ∗ c1 n+ c2 n;

71

72 %%%% HOLES %%%%

73 numH= holes(i);% num holes in this slice

74 prob= rand(1, numH);% generate random probability f o r each hole in this slice

75 numRight= sum(prob

76 numLeft= sum(prob >(1− l h o l e s(i)));

77 numStay= numH − numRight − numLeft;

78 i fi==1% leftmost slice

79 tempH(2) = tempH(2) + numRight;%move right

83 80 tempH(1) = tempH(1) + numLeft+ numStay;%can’t move left

81 e l s e i fi==N% rightmost slice

82 tempH(N−1) = tempH(N−1) + numLeft;%move left

83 tempH(N) = tempH(N) + numRight+ numStay;%can’t move right

84 e l s e% any other slice

85 tempH(i)= tempH(i)+ numStay;

86 tempH(i+1) = tempH(i+1) + numRight;%move right

87 tempH(i −1) = tempH(i −1) + numLeft;%move left

88 end

89 %%%% ELECTRONS %%%%

90 numE= elecs(i);% num electrons in this slice

91 prob= rand(1, numE);% generate random probability f o r each electron in this slice

92 numRight= sum(prob

93 numLeft= sum(prob >(1− l e l e c s(i)));

94 numStay= numE − numRight − numLeft;

95 i fi==1% leftmost slice

96 tempE(2) = tempE(2) + numRight;%move right

97 tempE(1) = tempE(1) + numLeft+ numStay;%can’t move left

98 e l s e i fi==N% rightmost slice

99 tempE(N−1) = tempE(N−1) + numLeft;%move left

100 tempE(N) = tempE(N) + numRight+ numStay;%can’t move right

101 e l s e% any other slice

102 tempE(i)= tempE(i)+ numStay;

103 tempE(i+1) = tempE(i+1) + numRight;%move right

104 tempE(i −1) = tempE(i −1) + numLeft;%move left

84 105 end

106 end

107 % update hole and electron position arrays

108 h o l e s= tempH;

109 e l e c s= tempE;

110

111 i fn > (numSteps −loop)

112 h o l e s t o t= holes t o t+ holes;

113 e l e c s t o t= elecs t o t+ elecs;

114 E tot=E tot+E;

115 end

116 end

117

118 toc

119

120 h o l e s t o t= holes t o t/loop;

121 e l e c s t o t= elecs t o t/loop;

122 E tot=E tot/loop;

123 tot= holes t o t −e l e c s t o t+Nd+Na;

85 Bibliography

[1] David Halliday, Robert Resnick, and Jearl Walker. Fundamentals of Physics. Wiley, 2010.

[2] Chenming C. Hu. Modern semiconductor devices for integrated circuits. Boston: Pearson, 2010.

[3] p–n junction. Wikipedia. Retrived from https://en.wikipedia.org/wiki/P- n junction.

[4] Rebecca Belisle. Phys 331: Modern materials. Wellesley College, Fall 2019. From lecture slides.

[5] Emmanuel Gobet. Monte-Carlo Methods and Stochastic Processes. CRC Press, 2016.

[6] J. P. Gonzalez-Vazquez, Juan A. Anta, and Juan Bisquert. Determination of the electron diffusion length in dye-sensitized solar cells by random walk simu- lation: Compensation effects and voltage dependence. The Journal of Physical C, 114:8552–8558, May 2010.

[7] Casino software. Software for Monte Carlo simulation of electron trajectory in solids. Retrieved from https://www.gel.usherbrooke.ca/casino/index.html.

[8] Camilla Nestande Kirkemo. Monte carlo simulation of p-n junctions. Retrieved from https://www.duo.uio.no/handle/10852/11062.

[9] Dragica Vasileska, Katarina Raleva, and Stephen M. Goodnick. Monte carlo device simulations. Handbook of Optoelectronic Device Modeling and Simulation, 2017.

[10] D.Munteanu S. Clerc G. Gasiot M. Glorieux, J. L.Autran and P. Roche. Random- walk drift-diffusion charge-collection model for reverse-biased junctions embed- ded in circuits. IEEE Transactions on Nuclear Science, 61:3527–3534, December 2014.

[11] Jes´us del Alamo. 6.012 microelectronic devices and circuits. Mas- sachusetts Institute of Technology: MIT OpenCourseWare., Fall 2005. Re- trieved from https://ocw.mit.edu/courses/electrical-engineering-and-computer- science/6-012-microelectronic-devices-and-circuits-fall-2005/.

86 [12] Benjamin A. Stickler and Ewald Schachinger. Basic Concepts in Computational Physics. Springer International Publishing, 2016.

[13] Luca Bertoluzzi, Caleb C. Boyd, Nicholas Rolston, Jixian Xu, Rohit Prasanna, Brian C. O’Regan, and Michael D. McGehee. Mobile ion concentration measure- ment and open-access band diagram simulation platform for halide perovskite solar cells. Joule, 1:109–127, January 2020.

87