ebisim.elements module¶
This module most notably implements the Element class, which serves as the main container for physical data going into the ebisim computations.
Besides that, there are some small helper functions to translate certain element properties, which may offer convenience to the user.
- class ebisim.elements.Element(z, symbol, name, a, ip, e_cfg, e_bind, rr_z_eff, rr_n_0_eff, dr_cs, dr_e_res, dr_strength, ei_lotz_a, ei_lotz_b, ei_lotz_c, n=None, kT=None, cx=True)[source]¶
Bases:
tuple
The Element class is one of the main data structures in ebisim. Virtually any function relies on information provided in this data structure. The leading fields of the underlying tuple contain physcial properties, whereas the n kT and cx fields are optional and only required for advanced simulations.
Instead of populating the fields manually, the user should choose one of the factory functions that meets their needs best.
For basic simulations and cross sections calculations only the physical / chemical properties of and element are needed. In these cases use the generic get() method to create instances of this class.
Advanced simulations require additional information about the initial particle densities, temperature and participation in charge exchange. The user will likely want to chose between the get_ions() and get_gas() methods, which offer a convenient interface for generating this data based on simple parameters. If these functions are not flexible enough, the get() method can be used to populate the required fields manually.
This class is derived from collections.namedtuple which facilitates use with numba-compiled functions.
See also
ebisim.elements.Element.get
,ebisim.elements.Element.get_ions
,ebisim.elements.Element.get_gas
Create new instance of Element(z, symbol, name, a, ip, e_cfg, e_bind, rr_z_eff, rr_n_0_eff, dr_cs, dr_e_res, dr_strength, ei_lotz_a, ei_lotz_b, ei_lotz_c, n, kT, cx)
- Parameters
z (int) –
symbol (str) –
name (str) –
a (float) –
ip (float) –
e_cfg (ndarray) –
e_bind (ndarray) –
rr_z_eff (ndarray) –
rr_n_0_eff (ndarray) –
dr_cs (ndarray) –
dr_e_res (ndarray) –
dr_strength (ndarray) –
ei_lotz_a (ndarray) –
ei_lotz_b (ndarray) –
ei_lotz_c (ndarray) –
n (Optional[ndarray]) –
kT (Optional[ndarray]) –
cx (bool) –
- classmethod as_element(element)[source]¶
If element is already an instance of Element it is returned. If element is a string or int identyfying an element an appropriate Element instance is returned.
- count(value, /)¶
Return number of occurrences of value.
- classmethod get(element_id, a=None, n=None, kT=None, cx=True)[source]¶
Factory method to create instances of the Element class.
- Parameters
element_id (Union[str, int]) – The full name, abbreviated symbol, or proton number of the element of interest.
a (Optional[float]) – If provided sets the mass number of the Element object otherwise a reasonable value is chosen automatically.
n (Optional[ndarray]) – <1/m> Only needed for advanced simulations! Array holding the initial ion line densities of each charge state. If provided, has to be an array of length Z+1, where Z is the nuclear charge.
kT (Optional[ndarray]) – <eV> Only needed for advanced simulations! Array holding the initial ion line densities of each charge state. If provided, has to be an array of length Z+1, where Z is the nuclear charge.
cx (bool) – Only needed for advanced simulations! Boolean flag determining whether the neutral particles of this element contribute to charge exchange with ions.
- Returns
An instance of Element with the user-supplied and generated data.
- Raises
ValueError – If the Element could not be identified or a meaningless mass number is provided.
ValueError – If the passed arrays for n or kT have the wrong shape.
- Return type
- classmethod get_gas(element_id, p, r_dt, T=300.0, cx=True, a=None)[source]¶
Factory method for defining a neutral gas injection target. A gas target is a target with constant density in charge state 0.
- Parameters
element_id (Union[str, int]) – The full name, abbreviated symbol, or proton number of the element of interest.
p (float) – <mbar> Gas pressure.
r_dt (float) – <m> Drift tube radius, required to compute linear density from volumetric density.
T (float) – <K> Gas temperature, by default 300 K (approx. room temperature)
cx (bool) – Boolean flag determining whether the neutral particles of this element contribute to charge exchange with ions.
a (Optional[float]) – If provided sets the mass number of the Element object otherwise a reasonable value is chosen automatically.
- Returns
Element instance with automatically populated n and kT fields.
- Raises
ValueError – If the density resulting from the pressure and temperature is smaller than the internal minimal value.
- Return type
- classmethod get_ions(element_id, nl, kT=10.0, q=1, cx=True, a=None)[source]¶
Factory method for defining a pulsed ion injection target. An ion target has a given density in the charge state of choice q.
- Parameters
element_id (Union[str, int]) – The full name, abbreviated symbol, or proton number of the element of interest.
nl (float) – <1/m> Linear density of the initial charge state (ions per unit length).
kT (float) – <eV> Temperature / kinetic energy of the injected ions.
q (int) – Initial charge state.
cx (bool) – Boolean flag determining whether the neutral particles of this element contribute to charge exchange with ions.
a (Optional[float]) – If provided sets the mass number of the Element object otherwise a reasonable value is chosen automatically.
- Returns
Element instance with automatically populated n and kT fields.
- Raises
ValueError – If the requested density is smaller than the internal minimal value.
- Return type
- index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.
- latex_isotope()[source]¶
Returns the isotope as a LaTeX formatted string.
- Returns
str – LaTeX formatted string describing the isotope.
- Return type
str
- property a¶
Mass number / approx. mass in proton masses
- property cx¶
Boolean flag determining whether neutral particles of this target are considered as charge exchange partners.
- property dr_cs¶
Numpy array of charge states for DR cross sections.
- property dr_e_res¶
Numpy array of resonance energies for DR cross sections.
- property dr_strength¶
Numpy array of transition strengths for DR cross sections.
- property e_bind¶
Numpy array of binding energies associated with electron subshells. The index of each row corresponds to the charge state. The columns are the subshells sorted as in (‘1s’, ‘2s’, ‘2p-’, ‘2p+’, ‘3s’, ‘3p-’, ‘3p+’, ‘3d-’, ‘3d+’, ‘4s’, ‘4p-’, ‘4p+’, ‘4d-’, ‘4d+’, ‘4f-’, ‘4f+’, ‘5s’, ‘5p-’, ‘5p+’, ‘5d-’, ‘5d+’, ‘5f-’, ‘5f+’, ‘6s’, ‘6p-’, ‘6p+’, ‘6d-’, ‘6d+’, ‘7s’, ‘7p-‘).
- property e_cfg¶
Numpy array of electron configuration in different charge states. The index of each row corresponds to the charge state. The columns are the subshells sorted as in (‘1s’, ‘2s’, ‘2p-’, ‘2p+’, ‘3s’, ‘3p-’, ‘3p+’, ‘3d-’, ‘3d+’, ‘4s’, ‘4p-’, ‘4p+’, ‘4d-’, ‘4d+’, ‘4f-’, ‘4f+’, ‘5s’, ‘5p-’, ‘5p+’, ‘5d-’, ‘5d+’, ‘5f-’, ‘5f+’, ‘6s’, ‘6p-’, ‘6p+’, ‘6d-’, ‘6d+’, ‘7s’, ‘7p-‘).
- property ei_lotz_a¶
Numpy array of precomputed Lotz factor ‘a’ for each entry of ‘e_cfg’.
- property ei_lotz_b¶
Numpy array of precomputed Lotz factor ‘b’ for each entry of ‘e_cfg’.
- property ei_lotz_c¶
Numpy array of precomputed Lotz factor ‘c’ for each entry of ‘e_cfg’.
- property ip¶
Ionisation potential
- property kT¶
<eV> Array holding the initial temperature of each charge state.
- property n¶
<1/m> Array holding the initial linear density of each charge state.
- property name¶
Element name
- property rr_n_0_eff¶
Numpy array of effective valence shell numbers for RR cross sections.
- property rr_z_eff¶
Numpy array of effective nuclear charges for RR cross sections.
- property symbol¶
Element symbol e.g. H, He, Li
- property z¶
Atomic number
- ebisim.elements.element_identify(element_id)[source]¶
Returns the proton number, name, and element symbol relating to the supplied element_id.
- Parameters
element_id (Union[str, int]) – The proton number, name or symbol of a chemical element.
- Returns
(proton number, name, symbol)
- Raises
ValueError – If the element_id could not be identified or found in the database.
- Return type
Tuple[int, str, str]
- ebisim.elements.element_name(element)[source]¶
Returns the name of the given element.
- Parameters
element (Union[str, int]) – The abbreviated symbol or the proton number of the element.
- Returns
Element name
- Return type
str
- ebisim.elements.element_symbol(element)[source]¶
Returns the abbreviated symbol of the given element.
- Parameters
element (Union[str, int]) – The full name or the proton number of the element.
- Returns
Element symbol
- Return type
str
- ebisim.elements.element_z(element)[source]¶
Returns the proton number of the given element.
- Parameters
element (str) – The full name or the abbreviated symbol of the element.
- Returns
Proton number
- Return type
int
- ebisim.elements.get_element(element_id, a=None)[source]¶
[LEGACY] Factory function to create instances of the Element class.
- Parameters
element_id (str or int) – The full name, abbreviated symbol, or proton number of the element of interest.
a (int or None, optional) – If provided sets the (isotopic) mass number of the Element object otherwise a reasonable value is chosen automatically, by default None.
- Returns
ebisim.elements.Element – An instance of Element with the physical data corresponding to the supplied element_id, and optionally mass number.
- Raises
ValueError – If the Element could not be identified or a meaningless mass number is provided.
- Return type