## Interface

### Alternates - iterator for quantum numbers

ExtendedKronigPennyMatrix.AlternatesType
Alternates(nmax)

is an iterator to generate the series $\{0, 1, -1, 2, -2, \ldots \}$ up to nmax as an ordering of quantum numbers.

collect(Alternates(0)) => [0]
collect(Alternates(1)) => [0, 1, -1]
collect(Alternates(2)) => [0, 1, -1, 2, -2]
Base.iterateFunction
Base.iterate(alt::Alternates, state::Int = 1)

### E10 - the ground state energy

ExtendedKronigPennyMatrix.get_E10Function
get_E10(a; me=1)

calculates the ground state energy $E_{1}^{(0)}$.

$$$E_{1}^{(0)} = \dfrac{\pi^2\hbar^2}{2ma^2}$$$
• a : system length
• me : electron mass

This function handles physical quantities with Unitful package.

• If a is dimensionless, suppose that a is in nm unit.

• Otherwise, a must have a dimension of length L.
• If me is dimensionless, suppose that me is an effective mass with respect to electron rest mass.

• Otherwise, me must have a dimension of mass M.
• The resultant enegy value is repesented in eV.

### Potential

ExtendedKronigPennyMatrix.PotentialType
Potential

is an abstraction of potential including

• potential height, and/or
• other parameters depending on specific potential.

A subtype of Potential is expected to possess following methods:

• get_potential(<:Potential)
• returns a function to evaluate potential value as a position.

### Model

ExtendedKronigPennyMatrix.ModelType
struct Model{P<:Potential}

is an abstraction of model including following fields:

• potential : concrete Potential
• Ka : wavenumber multiplied by a, period
• nmax : maximum of quantum numbers
• mmax : size of Hamiltonian matrix
• qnum : iterator of quantum numbers
• hnm : hamiltonian matrix

A concrete subtype of model is expected to possess following methods:

• constuctMatrix(model::Model{P})
ExtendedKronigPennyMatrix.ModelType
function Model(pot::Potential,Ka::Float64,nmax::Int64=60)

is a constructor of Kronig-Penny model, and defines other fields: qnum, nmax, and hnm

• Mandantory parameters:

• pot : potential
• Ka : wavenumber multiplied by a, period
• Optional parameters:

• nmax : maximum of quantum numbers

## Finite Square Well

ExtendedKronigPennyMatrix.FiniteSquareWellType
struct FiniteSquareWell(v0, ρ)

holds parameters of finite square well potential.

Fields

• v0 : potential height in units of $E_{1}^{(0)}$
• ρ : barrier width in units of period $a$, where $0 < \rho = \dfrac{b}{a} < 1$
• Note that a position $x$ is expressed in units of $a$ throughout this package.

The constructor FiniteSquareWell(v0, ρ) confirms that 0 ≤ ρ ≤ 1, otherwise throws an error.

ExtendedKronigPennyMatrix.get_potentialMethod
get_potential(::FiniteSquareWell)

returns a function $v$ to evaluate potential $v(x)$ as a position $x$, such that:

\begin{aligned} v(x) & = \begin{cases} v_{0} & \text{inside well, i.e.,} \dfrac{1-\rho}{2} \le \dfrac{x}{a} \le \dfrac{1+\rho}{2}, \\ 0 & \text{outside well}\end{cases} \\ v(x+a) &= v(x) \end{aligned}
• Note that a position $x$ is expressed in units of $a$ throughout this package.
ExtendedKronigPennyMatrix.constuctMatrixMethod
constuctMatrix(model::Model{FiniteSquareWell})

computes and fills Hamiltonian matrix fields hnm in model with finite square well.

$$$h_{nm} = \begin{cases} \left(2n + \dfrac{Ka}{\pi}\right)^{2} + v_{0} (1-\rho) & \text{for}\; n = m\;\text{(diagonal elements)} \\ v_{0} \dfrac{(-1)^{m-n+1}}{\pi} \dfrac{\sin \pi(m-n)\rho}{m-n} & \text{for}\; n \neq m\;\text{(off-diagonal elements)}\end{cases}$$$

## Simple Harmonic Oscillator

ExtendedKronigPennyMatrix.get_potentialMethod
get_potential(::SimpleHarmonicOscillator)

returns a function $v$ to evaluate potential $v(x)$ as a position $x$, such that:

\begin{aligned} v(x) & = \dfrac{1}{2}m {\omega}^{2} a^{2} \left(\dfrac{x}{a}-\dfrac{1}{2}\right)^2 = \dfrac{\pi^2}{4} v_{0}^2 E_{1}^{(0)} \left(\dfrac{x}{a}-\dfrac{1}{2}\right)^2, \quad 0 \le \dfrac{x}{a} \le 1 \\ v(x+a) &= v(x) \end{aligned}
• Note that a position $x$ is expressed in units of $a$ throughout this package.
ExtendedKronigPennyMatrix.constuctMatrixMethod
constuctMatrix(model::Model{SimpleHarmonicOscillator})

computes and fills Hamiltonian matrix fields hnm in model with finite square well.

$$$h_{nm} = \begin{cases} \left(2n + \dfrac{Ka}{\pi}\right)^{2} + v_{0}^{2} \dfrac{\pi^2}{48} & \text{for}\; n = m\;\text{(diagonal elements)} \\ \dfrac{v_{0}^2}{8} \dfrac{(-1)^{m-n}}{(m-n)^{2}} & \text{for}\; n \neq m\;\text{(off-diagonal elements)}\end{cases}$$$

## Inverted Harmonic Oscillator

ExtendedKronigPennyMatrix.get_potentialMethod
get_potential(::InvertedHarmonicOscillator)

returns a function $v$ to evaluate potential $v(x)$ as a position $x$, such that:

\begin{aligned} v(x) & = \begin{cases} -\dfrac{1}{2}m {\omega}^{2} a^{2} \left[ \left(\dfrac{x}{a}\right)^2 - \dfrac{1}{4} \right] & 0 \le \dfrac{x}{a} \le \dfrac{1}{2} \\ -\dfrac{1}{2}m {\omega}^{2} a^{2} \left[ \left(\dfrac{x}{a}-1\right)^2 - \dfrac{1}{4} \right] & \dfrac{1}{2} \le \dfrac{x}{a} \le 1 \end{cases} \\ v(x+a) &= v(x) \end{aligned}
• Note that a position $x$ is expressed in units of $a$ throughout this package.
ExtendedKronigPennyMatrix.constuctMatrixMethod
constuctMatrix(model::Model{InvertedHarmonicOscillator})

computes and fills Hamiltonian matrix fields hnm in model with finite square well.

$$$h_{nm} = \begin{cases} \left(2n + \dfrac{Ka}{\pi}\right)^{2} + v_{0}^{2} \dfrac{\pi^2}{24} & \text{for}\; n = m\;\text{(diagonal elements)} \\ - \dfrac{v_{0}^2}{8} \dfrac{(-1)^{m-n}}{(m-n)^{2}} & \text{for}\; n \neq m\;\text{(off-diagonal elements)}\end{cases}$$$

## LinearWell

ExtendedKronigPennyMatrix.get_potentialMethod
get_potential(::LinearWell)

returns a function $v$ to evaluate potential $v(x)$ as a position $x$, such that:

\begin{aligned} v(x) & = \begin{cases} 2A \left( \dfrac{1}{2} - \dfrac{x}{a} \right) & 0 \le \dfrac{x}{a} \le \dfrac{1}{2} \\ 2A \left( \dfrac{x}{a} - \dfrac{1}{2} \right) & \dfrac{1}{2} \le \dfrac{x}{a} \le 1 \end{cases} \\ v(x+a) &= v(x) \end{aligned}
• Note that a position $x$ is expressed in units of $a$ throughout this package.
ExtendedKronigPennyMatrix.constuctMatrixMethod
constuctMatrix(model::Model{LinearWell})

computes and fills Hamiltonian matrix fields hnm in model with finite square well.

$$$h_{nm} = \begin{cases} \left(2n + \dfrac{Ka}{\pi}\right)^{2} + \dfrac{A}{2} & \text{for}\; n = m\;\text{(diagonal elements)} \\ \dfrac{-A}{\pi^2 (m-n)^{2}} \left[ 1-(-1)^{m-n}\right] & \text{for}\; n \neq m\;\text{(off-diagonal elements)}\end{cases}$$$