device_builder.utils.confinement

Helper functions for quantum dots and wells.

Useful function concerning the calculation of finite well and harmonic confinement states.

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

def get_alpha(energy: float, well_depth: float, effective_mass: float) -> float:

Get decay constant for quantum well wave function.

Returns alpha, i.e., the decay rate in exp[+/- alpha x], for the wave function of a quantum well in the classically forbidden region, given the energy and the depth of the well.

NOTE: Only well defined for well_depth > energy.

Arguments:
  • energy (float): Energy in eV.
  • well_depth (float): Well depth in eV.
  • effective_mass (float): Effective mass of oscillator in units of rest mass of an electron.
Returns:

float: decay constant in 1 / Angstrom.

def get_k(energy: float, effective_mass: float) -> float:

Get wave vector for quantum well wave function.

Returns k, i.e., the wave vector cos[k x], for the wave function of a quantum well inside the well, given the energy.

NOTE: Only well defined for energy > 0.

Arguments:
  • energy (float): Energy in eV.
  • well_depth (float): Well depth in eV.
  • effective_mass (float): Effective mass of oscillator in units of rest mass of an electron.
Returns:

float: wave vector in 1 / Angstrom.

def get_energy_from_well_depth_and_width( well_depth: float, well_width: float, effective_mass: float, max_iter: int) -> float:

Solve for energy of quantum well.

Arguments:
  • well_depth (float): Well depth in eV.
  • well_width (float): Well width in Angstrom.
  • effective_mass (float): Effective mass of oscillator in units of rest mass of an electron.
  • max_iter (int): Maximum number of steps for solving characteristic equation.
Raises:
  • RuntimeError: If characteristic function cannot be bracketed in max_iter steps.
Returns:

float: Ground state energy of quantum well in eV.

def get_force_constant_from_level_spacing(level_spacing: float, effective_mass: float = 1.0) -> float:

Get force constant from level spacing and effective mass.

The force constant, k, implies a quadratic term, +1/2 * k * x^2, in the Hamiltonian, where x is the displacement.

Arguments:
  • level_spacing (float): Level spacing (hbar omega) of harmonic oscillator in eV.
  • effective_mass (float, optional): Effective mass of oscillator in units of rest mass of an electron. Defaults to 1.0.
Returns:

float: Force constant in eV / Angstrom^2.

def get_characteristic_length_from_level_spacing(level_spacing: float, effective_mass: float = 1.0) -> float:

Get characteristic length from level spacing and effective mass.

The characteristic length is defined as the distance between the classical turning points of the ground state of the harmonic oscillator.

Arguments:
  • level_spacing (float): Level spacing (hbar omega) of harmonic oscillator in eV.
  • effective_mass (float, optional): Effective mass of oscillator in units of rest mass of an electron. Defaults to 1.0.
Returns:

float: Characteristic length in Angstrom.

def get_harmonic_oscillator_wave_function( level_spacing: float, effective_mass: float = 1.0) -> Callable[[numpy.ndarray], numpy.ndarray]:

Function generator for harmonic oscillator wave function.

Arguments:
  • level_spacing (float): Defines level spacing of harmonic oscillator in eV.
  • effective_mass (float, optional): Effective mass of the oscillating particle. Defaults to 1.0.
Returns:

Callable[[np.ndarray], np.ndarray]: Function returning oscillator wave function evaluated at input positions.