qtcad.atoms.rough_surface module

Generator of random rough surfaces to model realistic atomic heterointerfaces.

class RoughSurface(hurst: float = 0.3, mean: float = 0.0, rms: float = 1e-10, lmin: float = 1e-10, lmax: float = 1e-07, m: int = 14, log_sampling: bool = True, rng_seed: int = None)

Bases: RoughSurface

Random and isotropic rough planar surface with a fractal character used to model rough atomic heterointerfaces.

Attributes:
  • hurst (float) – Hurst exponent \(H\) of the rough surface; the fractal dimension of the rough surface is given by \(3-H\).

  • mean (float) – Mean height of the rough surface.

  • rms (float) – Root-mean-square deviation of the rough surface relative to its mean height.

  • lmin (float) – Minimal sampled wavelength for the elementary waves whose sum defines the rough surface; should be on the order of the interatomic distance.

  • lmax (float) – Maximal sampled wavelength for the elementary waves whose sum defines the rough surface; set by experimental fabrication processes such as chemical-mechanical planarization.

  • k (Numpy.ndarray) – Matrix whose rows are the Cartesian coordinates of the sampled wavevectors.

  • amplit (Numpy.ndarray) – Vector of random amplitudes for each sampled wavevector.

  • phi (Numpy.ndarray) – Vector of random phases for each sampled wavevector.

__init__(hurst: float = 0.3, mean: float = 0.0, rms: float = 1e-10, lmin: float = 1e-10, lmax: float = 1e-07, m: int = 14, log_sampling: bool = True, rng_seed: int = None) None
Parameters:
  • hurst (float, optional) – Hurst exponent \(H\) of the rough surface; the fractal dimension of the rough surface is given by \(3-H\). Default: 0.3.

  • mean (float, optional) – Mean height of the rough surface. Default: 0.0.

  • rms (float, optional) – Root-mean-square deviation of the rough surface relative to its mean height. Default: 1e-10.

  • lmin (float, optional) – Minimal sampled wavelength for the elementary waves whose sum defines the rough surface; should be on the order of the interatomic distance or less. Default: 1e-10.

  • lmax (float, optional) – Maximal sampled wavelength for the elementary waves whose sum defines the rough surface; set by experimental fabrication processes such as chemical-mechanical planarization. Default: 1e-7.

  • m (int, optional) – Parameter controlling the number of sampled wavevectors, which is approximately A * 2**m, where A is a constant that depends on lmin and lmax. Default: 14.

  • log_sampling (bool, optional) – If True, wavevectors are sampled such that the logarithm of their norm is uniformly distributed. If False, wavevectors are sampled such that their norm is uniformly distributed, which may lead to poor sampling of long-wavelength modes if m is too small. Default: True.

  • rng_seed (int, optional) – Seed for the random number generator used to construct the random rough surface. If None, the seed is set from fresh, unpredictable entropy from the operating system. Default: None.

plot(x: ndarray, y: ndarray, type: str = '2D', path: str = None, show_figure: bool = True) ndarray

Plot the rough surface.

Parameters:
  • x (Numpy.ndarray) – Vector of \(x\) positions at which the height of the rough surface is to be plotted.

  • y (Numpy.ndarray) – Vector of \(y\) positions at which the height of the rough surface is to be plotted.

  • type (str, optional) – Type of plot to be produced; “2D” for a 2D contour plot and “3D” for a 3D surface plot. Default: “2D”.

  • path (str, optional) – Path in which the plot is saved in .png format. If None, no file is saved. Default: None.

  • show_figure (bool, optional) – Whether the plot is shown. Default: True.

Returns:

Numpy.ndarray – Matrix of the height of the rough surface at the specified positions in the meshgrid format.

save(path: str, verbose: bool = True) None

Save the rough surface to a file.

Parameters:
  • path (str) – Path to the file in which to save the rough surface; all file extensions are accepted.

  • verbose (bool, optional) – Whether messages regarding the file path and size are printed. Default: True.

load(path: str) RoughSurface

Load a rough surface from a file.

Parameters:

path (str) – Path to the file from which to load the rough surface.

Returns:

RoughSurface – Rough surface loaded from the file.