Skip to content
Jon Drobny edited this page Apr 16, 2025 · 18 revisions

This page is currently under construction. You may suggest additions using the [question] issue tag.

How can sputtering yields or reflection coefficients be calculated from RustBCA or libRustBCA output?

Sputtering yield is defined as the ratio of the number of sputtered atoms to the number of incident ions. In the standalone code, sputtering yields are provided in <name>summary.output and can be calculated manually by dividing the number of particles listed in <name>sputtered.output by the number of incident particles. The reflection coefficient is defined as the number of reflected particles divided by the number of incident particles, and can be calculated in the standalone code in the same way using <name>reflected.output. The energy reflection coefficient is defined by the total energy of all refelected particles divided by the total energy of all incident particles; note that, due to this definition, the average energy of a reflected particle is not E_incident*RE but E_incident*RE/RN.

Partial sputtering yields can be determined by calculating sputtering yields for each species of the material, for example by using Z or m to distinguish them.

When using Python functions like compound_bca_list_py, the common output return value contains all incident and sputtered atoms. Some of these functions provide explicit tags that inform whether a particle is reflected (incident and leaves the material), stopped (incident and doesn't leave the material), or sputtered (non-incident and leaves the material). When these tags are not provided, they can be determined in the following way in Python:

import numpy as np
from libRustBCA import compound_bca_list_py

Z1 = 1
num_incident = 10000

# output: [Z, m (amu), E (eV), x, y, z, (angstrom), ux, uy, uz]
# compund_bca_list_py returns incident as its second argument, but will be ignored for this example
output, _ = compound_bca_list_py(..., [Z1]*num_incident, ...)
output = np.atleast_2d(np.array(output))

# compound_bca_list_py is 1D, with +x into the material and x>0 being inside the material 
Z = output[:, 0]
energy = output[:, 2]
x = output[:, 3]

# Particles have left the material if they are outside the surface with nonzero energy
left_material = np.logical_and(x < 0, energy > 0)

# In this simple example, particles are incident if they have the same Z as the incident species
incident = Z == Z1

# From output, construct boolean arrays that distinguish between sputtered, stopped, and reflected particles
reflected = np.logical_and(left_material, incident)
stopped = np.logical_and(np.logical_not(left_material), incident)
# non-sputtered displaced target atoms are not included in output
sputtered = np.logical_not(incident)

# Bools in Python evaluate to 1 if True and 0 if False
reflection_coefficient = np.sum(reflected) / num_incident 
sputtering_yield = np.sum(sputtered) / num_incident

#These boolean arrays can also be used to index the output array
implanted_x = x[stopped]

More details can be found in the documentation for these functions here.