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. Seeload_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:
-
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 inproperty_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
-
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
-
-
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
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
orsystem
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
anddata/default.yml
. Seeparameters.Parameters.load_file()
.
-
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
.
-
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: Returns: \(E^n_{τ σ} (k)\)
Return type:
-
-
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
-
-
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:
-
Superconductor¶
-
class
superconductor.
Superconductor
(model, energy=None)¶ Superconductor.
Uses upper valence band energies by default.
-
Δ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
.-
Δk
¶ The superconducting parameter \(Δ_\mathbf{k}\) as a function of the energy \(E\).
Returns: \(Δ(E)\) Return type: func
-
About¶
Contributing¶
Please submit and comment on bug reports and feature requests.
To submit a patch:
- Fork it (https://github.com/razor-x/dichalcogenides/fork).
- Create your feature branch (
git checkout -b my-new-feature
). - Make changes.
- Commit your changes (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin my-new-feature
). - 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.