sample_builder

sample_builder module.

This Python package provides tools for the generation and handling of samples of random alloys. The generated samples can be fed into the slater_koster model to then compute properties of the devices.

===========

Basic usage

To generate a random alloy sample with the sample_builder two steps are necessary. First, a probability distribution for the various alloy species has to be constructed; only then the actual random sample can be built. The generation of the probability distribution is performed via the methods generateModulationX with X the type of the desired modulation, e.g. uniform, linear, sinusoidal etc... Each of these methods will take as an input the positions of the sites making up the system. These can be generated in any way: for example, if we are using an sk_builder object, these can be calculated via the method SlaterKosterModel.get_positions(). Each modulation-generating method will also take as input the different attributes of the specific modulation, e.g. the direction of a sinusoidal modulation or its wavelength. Once the probability modulation has been generated, the actual sample can the be created starting from it. The following code sums up the steps described so far for the particular case of a ternary alloy where the first species has linear modulation increasing from 10% to 90% along the x axis of the system.

from sample_builder import generateModulationLinear, generateSample

# initialize sk_builder object named skm
# ....

# get the positions for the initialized system
positions = skm.get_positions()

# create linear modulation of species 0 (first one)
modulation = generateModulationLinear(
    positions=positions,
    direction=[1, 0, 0],
    selectedSpecies=0,
    NSpecies=3,
    startValue=0.1,  # starting concentration of 10% for selected species
    stopValue=0.9,
)

# generate sample from the probability modulation
sample = generateSample(modulation)

More complex modulations and combination of modulations can also be achieved. For more information please refer to the examples provided in this repository.

Copyright © 2022-2025 HQS Quantum Simulations GmbH. All Rights Reserved.