Dichalcogenides

Python analysis code for dichalcogenide systems.

Considered unstable and in development until version 1.0.0 is released.

This documentation covers the module API and usage. For basic installation and development instructions, refer to README hosted with the source on GitHub.

Contents

Parameters

class parameters.Parameters(path=None)

Collection of parameters.

New instances may optionally be passed a path to a YAML file. See load_file().

parameters = Parameters()
parameters.add_parameter('warp speed', 9.0)
parameters.get_value('warp speed') #=> 9.0

parameters.set_value('warp speed', 10.0)
parameters.get_value('warp speed') #=> 10.0
add_parameter(name, value, meta=None)

Add a parameter to the parameter list.

Parameters:
  • name (str) – New parameter’s name.
  • value (float) – New parameter’s value.
  • meta (dict) – New parameter’s meta property.
get(name)

Get a parameter object by name.

Parameters:name (str) – Name of the parameter object.
Returns:The parameter.
Return type:Parameter
get_meta(name)

Get the metadata of a parameter by name.

Returns:Parameter metadata.
Return type:dict
get_value(name)

Get the value of a parameter by name.

Returns:Parameter value.
Return type:Parameter
load_file(path)

Load a YAML file with parameter data and other metadata.

Parameters:path (str) – Path to YAML file.

The data in the YAML file is used to set the properties for the instance. The YAML file must contain a parameters key. It may optionally include any keys defined in property_keys.

# data.yml
---
name: Shield frequencies
parameters:
  - name: a
    value: 24.50
  - name: β
    value: 42.10
    meta:
      phase_inverted: true
parameters = Parameters('data.yml')
parameters.name #=> 'Shield frequencies'
parameters.get_value('a') #=> 24.50
parameters.get_meta('β')['phase_inverted'] #=> true
name

The name of this parameter set.

Returns:Parameter set name.
Return type:str
Default:None
static parameter_list(data)

Create a list of parameter objects from a dict.

Parameters:data (dict) – Dictionary to convert to parameter list.
Returns:Parameter list.
Return type:dict
parameters

The list of Parameter objects.

Returns:Parameter list.
Return type:dict
Default:[]
property_keys

Keys to load as class properties when loading from file.

Returns:Key names.
Return type:dict
Default:['name']
set_value(name, value)

Set the value of a parameter by name.

Parameters:
  • name (str) – Parameter name.
  • value (float) – Parameter value.
class parameters.parameter.Parameter(name, value)

Defines a parameter with a name and a value.

Must provide a name and value. Parameters have a generic metadata property stored as a dictionary.

parameter = Parameter('warp speed', 9.0, {'max': 10.0})
parameter.name #=> 'warp speed'
parameter.value #=> 9.0
parameter.meta['max'] #=> 10.0
meta

The metadata of this parameter.

Returns:Parameter metadata.
Return type:dict
Default:{}
name

The name of this parameter.

Returns:Parameter name.
Return type:str
value

The value of this parameter.

Returns:Parameter name.
Return type:float

Model

class model.Model(material=<model.material.Material object>, system=<model.system.System object>, root='')

Combines material properties with system parameters.

If, on instantiation, model or system is a string, the associated object will be created from the YAML file, e.g.,

Model('mos2', 'default', 'data')

will load the YAML files at data/mos2.yml and data/default.yml. See parameters.Parameters.load_file().

material

The associated Material object.

Returns:The material.
Return type:Material
material_parameter(name)

Get the value of a material parameter by name.

Parameters:name (str) – Material name.
Returns:The value.
Return type:float
system

The associated System object.

Returns:The system.
Return type:System
system_parameter(name)

Get the value of a system parameter by name.

Parameters:name (str) – System name.
Returns:The value.
Return type:float
class model.Material(path=None)

Material specific parameters.

Inherits from parameters.Parameters.

class model.System(path=None)

System specific parameters.

Inherits from parameters.Parameters.

Dichalcogenide

class dichalcogenide.Dichalcogenide(material=<dichalcogenides.model.material.Material object>, system=<dichalcogenides.model.system.System object>, root='')

Model for a dichalcogenide.

Inherits from model.Model.

at

Product of the lattice constant and hopping energy.

Returns:\(at\)
Return type:float
Δ

Valance band conduction band energy splitting.

Returns:\(Δ\)
Return type:float
λ

Half the valence band spin splitting.

Returns:\(λ\)
Return type:float
class dichalcogenide.Energy(dichalcogenide)

Dichalcogenide properties related to the energy.

Instantiate with a Dichalcogenide instance, e.g.,

energy = Energy(Dichalcogenide('mos2', 'default'))
energy.e(0, 1, 1, 1)
e(k, n, τ, σ)

Band energy.

Parameters:
  • k (float) – Momentum \(k\).
  • n (int) – Band index \(n = ±1\).
  • τ (int) – Valley index \(τ = ±1\).
  • σ (int) – Spin index \(σ = ±1\).
Returns:

\(E^n_{τ σ} (k)\)

Return type:

float

k(e, n, τ, σ)

Inverse energy-momentum relation.

Parameters:
  • e (float) – Energy \(E\).
  • n (int) – Band index \(n = ±1\).
  • τ (int) – Valley index \(τ = ±1\).
  • σ (int) – Spin index \(σ = ±1\).
Returns:

\(k(E)\)

Return type:

float

class dichalcogenide.UpperValenceBand(dichalcogenide)

Dichalcogenide properties related to the upper valence band energy.

For this class, the energy is assumed to be in the upper valence band: \(n = -1\) and \(τ = σ\).

Instantiate with a Dichalcogenide instance, e.g.,

uvb = UpperValenceBand(Dichalcogenide('mos2', 'default'))
uvb.ρ(0)
trig(name)

Trigonometric functions of the energy.

  • sin θ - \(\sin θ(E)\)
  • cos θ - \(\cos θ(E)\)
  • sin^2 θ/2 - \(\sin^2 \frac{θ(E)}{2}\)
  • cos^2 θ/2 - \(\cos^2 \frac{θ(E)}{2}\)
Parameters:name (str) – One of the above function names.
Returns:Corresponding function of the energy \(E\).
Return type:function
Δμ

Chemical potential offset.

The distance of the chemical potential from the top of the upper valence band.

Returns:\(Δμ\)
Return type:float
Default:\(-λ\)
μ

Chemical potential.

Determined by the chemical potential offset.

Returns:\(μ = λ - Δ / 2 + Δμ\)
Return type:float
ξ_bounds

Allowed range for the variable \(ξ = E - μ\).

Returns:\((\left|Δμ\right| - 2 λ, \left|Δμ\right|)\)
Return type:tuple
ρ(e)

Density of states.

Parameters:e (float) – Energy \(E\).
Returns:\(ρ(E) = \left|k'(E) k(E)\right|\)
Return type:float
class dichalcogenide.Optical(dichalcogenide)

Dichalcogenide properties related to optical transitions.

Instantiate with a Dichalcogenide instance, e.g.,

optical = Optical(Dichalcogenide('mos2', 'default'))
p_circular(e, τ, ε)

Matrix element for optical transitions (circular polarization): \(\left|P^{+-}_α \left(E, \mathbf{ϵ_±} \right)\right|^2\).

Transitions are from the upper valance band to the lower conduction band. Given in units of \(\text{GeV}^2\).

Parameters:
  • e (float) – Energy \(E\).
  • τ (int) – Valley index \(τ = ±1\).
  • ϵ (int) – Polarization index \(ϵ = ±1\).

Superconductor

class superconductor.Superconductor(model, energy=None)

Superconductor.

Uses upper valence band energies by default.

model

The model for this superconductor.

Returns:The model.
Return type:Model
Δk

The superconducting parameter \(Δ_\mathbf{k}\) as a function of the energy \(E\).

Returns:\(Δ(E)\)
Return type:func
class superconductor.Induced(model)

Induced superconductor.

Inherits from Superconductor.

Δc

Conduction band coupling constant.

Returns:\(Δ_c\)
Return type:float
Δk

The superconducting parameter \(Δ_\mathbf{k}\) as a function of the energy \(E\).

Returns:\(Δ(E)\)
Return type:func
Δv

Valance band coupling constant.

Returns:\(Δ_v\)
Return type:float

About

Contributing

Please submit and comment on bug reports and feature requests.

To submit a patch:

  1. Fork it (https://github.com/razor-x/dichalcogenides/fork).
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Make changes.
  4. Commit your changes (git commit -am 'Add some feature').
  5. Push to the branch (git push origin my-new-feature).
  6. Create a new Pull Request.

License

This code is licensed under the MIT license.

Warranty

This software is provided “as is” and without any express or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for a particular purpose.

Indices and tables