Skip to content

Commit

Permalink
[ENH] Add Miedema's scale of electronegativity (#204)
Browse files Browse the repository at this point in the history
* add miedema electronegativity

* update reference

* add docs on Miedema electronegativity

* add plots of eletronegativities

* add function for plotting en scales
  • Loading branch information
lmmentel authored Nov 6, 2024
1 parent 91aaec7 commit 6e014a0
Show file tree
Hide file tree
Showing 19 changed files with 207 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""add miedema electronegativity volume and density
Revision ID: db2973cd13af
Revises: abff1959e2ec
Create Date: 2024-11-05 22:29:32.441355
"""

# revision identifiers, used by Alembic.
revision = 'db2973cd13af'
down_revision = 'abff1959e2ec'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():

op.add_column("elements", sa.Column("en_miedema", sa.Float))
op.add_column("elements", sa.Column("miedema_molar_volume", sa.Float))
op.add_column("elements", sa.Column("miedema_electron_density", sa.Float))


def downgrade():

with op.batch_alter_table("elements") as batch_op:
batch_op.drop_column("en_miedema")
batch_op.drop_column("miedema_molar_volume")
batch_op.drop_column("miedema_electron_density")
Binary file added docs/source/_static/img/en_allen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/img/en_allred-rochow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/img/en_cottrell-sutton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/img/en_ghosh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/img/en_gordy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/img/en_martynov-batsanov.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/img/en_miedema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/img/en_mulliken.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/img/en_nagle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/img/en_pauling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/img/en_sanderson.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/source/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ The following data are currently available:
+-----------------------------------------+----------------------------------------------------------------------+----------------+--------------+------------------------------------------------+
| ``electrophilicity`` | Parr's electrophilicity index | | computed | :cite:`Parr1999` |
+-----------------------------------------+----------------------------------------------------------------------+----------------+--------------+------------------------------------------------+
| ``en_miedema`` | Miedema's scale of Electronegativity | V | stored | :cite:`deboer1988cohesion,ZHANG201658` |
+-----------------------------------------+----------------------------------------------------------------------+----------------+--------------+------------------------------------------------+
| ``evaporation_heat`` | Evaporation heat | kJ/mol | stored | |
+-----------------------------------------+----------------------------------------------------------------------+----------------+--------------+------------------------------------------------+
| ``fusion_heat`` | Fusion heat | kJ/mol | stored | |
Expand Down Expand Up @@ -147,6 +149,10 @@ The following data are currently available:
+-----------------------------------------+----------------------------------------------------------------------+----------------+--------------+------------------------------------------------+
| ``metallic_radius`` | Single-bond metallic radius | pm | stored | :cite:`kyleandlaby` |
+-----------------------------------------+----------------------------------------------------------------------+----------------+--------------+------------------------------------------------+
| ``miedema_electron_density`` | Electron density parameter from a model by Miedema | | stored | :cite:`deboer1988cohesion,ZHANG201658` |
+-----------------------------------------+----------------------------------------------------------------------+----------------+--------------+------------------------------------------------+
| ``miedema_molar_volume`` | Molar volume parameter from a model by Miedema | cm^3 | stored | :cite:`deboer1988cohesion,ZHANG201658` |
+-----------------------------------------+----------------------------------------------------------------------+----------------+--------------+------------------------------------------------+
| ``molar_heat_capacity`` | Molar heat capacity @ 25 C, 1 bar | J/mol/K | stored | :cite:`haynes2014crc` |
+-----------------------------------------+----------------------------------------------------------------------+----------------+--------------+------------------------------------------------+
| ``molcas_gv_color`` | Element color in MOCAS GV convention as HEX codes. | | stored | :cite:`molcas-colors` |
Expand Down
114 changes: 114 additions & 0 deletions docs/source/electronegativity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ appropriate formulas. The following scales are stored:

- :ref:`Allen <allen_en>`
- :ref:`Ghosh <ghosh_en>`
- :ref:`Miedema <miedema_en>`
- :ref:`Pauling <pauling_en>`

Moreover there are electronegativity scales that can be computed from their
Expand Down Expand Up @@ -61,6 +62,15 @@ Example::
>>> Si.electronegativity('allen')
11.33

Graph
-----

.. image:: _static/img/en_allen.png
:width: 100%
:alt: Allen's electronegativity scale
:align: center


.. _allred-rochow_en:

Allred and Rochow
Expand All @@ -81,6 +91,14 @@ Example::
>>> Si.electronegativity('allred-rochow')
0.00028240190249702736

Graph
-----

.. image:: _static/img/en_allred-rochow.png
:width: 100%
:alt: Allred and Rochow's electronegativity scale
:align: center

.. _cottrell-sutton_en:

Cottrell and Sutton
Expand All @@ -100,6 +118,14 @@ Example::
>>> Si.electronegativity('cottrell-sutton')
0.18099342720014772

Graph
-----

.. image:: _static/img/en_cottrell-sutton.png
:width: 100%
:alt: Cottrell and Sutton's electronegativity scale
:align: center

.. _ghosh_en:

Ghosh
Expand All @@ -119,6 +145,13 @@ Example::
>>> Si.en_ghosh
0.178503

Graph
-----

.. image:: _static/img/en_ghosh.png
:width: 100%
:alt: Ghosh's electronegativity scale
:align: center

.. _gordy_en:

Expand All @@ -140,6 +173,14 @@ Example::
>>> Si.electronegativity('gordy')
0.03275862068965517

Graph
-----

.. image:: _static/img/en_gordy.png
:width: 100%
:alt: Gordy's electronegativity scale
:align: center

.. _li_xue_en:

Li and Xue
Expand Down Expand Up @@ -186,6 +227,47 @@ Example::
>>> Si.electronegativity(scale='martynov-batsanov')
5.0777041564076963

Graph
-----

.. image:: _static/img/en_martynov-batsanov.png
:width: 100%
:alt: Martynov and Batsanov's electronegativity scale
:align: center

.. _miedema_en:

Miedema
=======

Miedema et. al. :cite:`deboer1988cohesion,ZHANG201658` devised a semi-empirical
theory that could predict formation enthalpies and other
basic properties of various alloys. It is based on estimating quantitatively the enthalpy
(energy) effects when bringing dissimilar elements into
contact, which will change the electron density at the so-called
Wigner-Seitz cell boundary, and would tend to shift their electron densities
due to an electronegativity difference.

The enthalpy can be estimated with three critical parameters,
i.e. the electronegativity difference :math:`\Delta\phi` (defined as :math:`\phi_A - \phi_B`),
the electron-density discontinuity :math:`\Delta n^{1/3}_{WS}`, which is the difference in the
:math:`n_{WS}` - the electron density based on the volume of Wigner-Seitz atomic cells :math:`V_{m}`.

Atomic electronegativities :math:`\phi` are empirical parameters in this model and are tabulated in ``mendeleev``.

Example::

>>> Si.en_miedema
4.7

Graph
-----

.. image:: _static/img/en_miedema.png
:width: 100%
:alt: Miedema's electronegativity scale
:align: center

.. _mulliken_en:

Mulliken
Expand All @@ -205,6 +287,14 @@ Example::
>>> Si.electronegativity('mulliken')
4.0758415

Graph
-----

.. image:: _static/img/en_mulliken.png
:width: 100%
:alt: Mulliken's electronegativity scale
:align: center

.. _nagle_en:

Nagle
Expand All @@ -221,6 +311,14 @@ Example::
>>> Si.electronegativity('nagle')
0.47505611644667534

Graph
-----

.. image:: _static/img/en_nagle.png
:width: 100%
:alt: Nagle's electronegativity scale
:align: center

.. _pauling_en:

Pauling
Expand All @@ -243,6 +341,14 @@ Example::
>>> Si.electronegativity('pauling')
1.9

Graph
-----

.. image:: _static/img/en_pauling.png
:width: 100%
:alt: Pauling's electronegativity scale
:align: center

.. _sanderson_en:

Sanderson
Expand All @@ -266,6 +372,14 @@ Example::
>>> Si.electronegativity()
0.3468157872145231

Graph
-----

.. image:: _static/img/en_sanderson.png
:width: 100%
:alt: Sanderson's electronegativity scale
:align: center


Fetching all electronegativities
================================
Expand Down
18 changes: 18 additions & 0 deletions docs/source/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -880,4 +880,22 @@ @misc{ionization_energies
howpublished = {{NIST Atomic Spectra Database (ver. 5.11), [Online]. Available: {\tt{https://physics.nist.gov/asd}} [2024, August 17]. National Institute of Standards and Technology, Gaithersburg, MD.}},
year = {2023},
note = {Accessed: 2015-04-13}
}
@article{ZHANG201658,
title = {Miedema Calculator: A thermodynamic platform for predicting formation enthalpies of alloys within framework of Miedema’s Theory},
journal = {Computer Physics Communications},
volume = {209},
pages = {58-69},
year = {2016},
issn = {0010-4655},
doi = {https://doi.org/10.1016/j.cpc.2016.08.013},
url = {https://www.sciencedirect.com/science/article/pii/S0010465516302430},
author = {R.F. Zhang and S.H. Zhang and Z.J. He and J. Jing and S.H. Sheng}
}
@book{deboer1988cohesion,
title = {Cohesion in metals. Transition metal alloys},
author = {De Boer, Frank R and Mattens, W and Boom, R and Miedema, AR and Niessen, AK},
place = {Netherlands},
publisher = {North-Holland},
year = {1988}
}
Binary file modified mendeleev/elements.db
Binary file not shown.
1 change: 1 addition & 0 deletions mendeleev/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def fetch_electronegativities(scales: List[str] = None) -> pd.DataFrame:
Element.en_pauling.label("Pauling"),
Element.en_allen.label("Allen"),
Element.en_ghosh.label("Ghosh"),
Element.en_miedema.label("Miedema"),
).order_by("atomic_number")
df = pd.read_sql_query(query.statement.compile(dialect=sqlite.dialect()), engine)

Expand Down
13 changes: 10 additions & 3 deletions mendeleev/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ class Element(Base):
electron_affinity (float): Electron affinity in eV
electrophilicity (float): Parr's electrophilicity index
econf (str): Ground state electron configuration
en_allen (float): ELectronegativity by Allen
en_ghosh (float): Electronegativity by Ghosh
en_miedema (float): Electronegativity by Miedema
en_pauling (float): Electronegativity by Pauling
evaporation_heat (float): Evaporation heat in kJ/mol
fusion_heat (float): Fusion heat in kJ/mol
gas_basicity (float): Gas basicity
Expand Down Expand Up @@ -144,8 +148,7 @@ class Element(Base):
vdw_radius_uff (float): Van der Waals radius from the UFF in pm
vdw_radius_mm3 (float): Van der Waals radius from MM3 in pm
oxistates (list): Oxidation states
ionenergies (dict): Ionization energies in eV parsed from
http://physics.nist.gov/cgi-bin/ASD/ie.pl on April 13, 2015
ionenergies (dict): Ionization energies in eV
"""

__tablename__ = "elements"
Expand Down Expand Up @@ -179,6 +182,7 @@ class Element(Base):
electron_affinity = Column(Float)
en_allen = Column(Float)
en_ghosh = Column(Float)
en_miedema = Column(Float)
en_pauling = Column(Float)
econf = Column("electronic_configuration", String)
evaporation_heat = Column(Float)
Expand All @@ -198,6 +202,8 @@ class Element(Base):
mendeleev_number = Column(Integer)
metallic_radius = Column(Float)
metallic_radius_c12 = Column(Float)
miedema_molar_volume = Column(Float)
miedema_electron_density = Column(Float)
molar_heat_capacity = Column(Float)
molcas_gv_color = Column(String)
name = Column(String)
Expand Down Expand Up @@ -518,6 +524,7 @@ def electronegativity_scales(self, name: str = None) -> Union[Callable, List[str
"gordy": self.electronegativity_gordy,
"li-xue": self.electronegativity_li_xue,
"martynov-batsanov": self.electronegativity_martynov_batsanov,
"miedema": self.en_miedema,
"mulliken": self.electronegativity_mulliken,
"nagle": self.electronegativity_nagle,
"pauling": self.electronegativity_pauling,
Expand Down Expand Up @@ -1248,7 +1255,7 @@ class ScatteringFactor(Base):
.. math::
\mu_a = 2 \cdot r_0 \cdot \lambda \cdot f_2
\\mu_a = 2 \cdot r_0 \cdot \lambda \cdot f_2
where :math:`r_0` is the classical electron radius, and :math:`\lambda` is the wavelength.
Expand Down
27 changes: 27 additions & 0 deletions mendeleev/vis/plotly.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pandas as pd
import plotly.graph_objects as go
import plotly.express as px
from plotly.graph_objs.layout import Shape, Annotation
from pandas.api.types import is_float_dtype

Expand Down Expand Up @@ -162,3 +163,29 @@ def periodic_table_plotly(
)

return fig


def plot_scale(data: pd.DataFrame, scale: str):
"""Plot an electronegativity scale
Args:
data: DataFrame with the electronegativity data, obtained from :func:`fetch.fetch_electronegativities`
scale: Electronegativity scale to plot
"""
fig = px.scatter(
data,
y=scale,
template="plotly_white",
height=600,
width=1400,
text="symbol",
title=f"{scale}'s Electronegativity",
)
fig.update_traces(
textposition="top center",
textfont={"size": 10},
marker={"size": 8, "color": "#0081a7"},
)
fig.update_layout(font={"size": 12})
fig.update_xaxes(title_text="Atomic Number", zeroline=False, range=[0, 119])
return fig

0 comments on commit 6e014a0

Please # to comment.