Skip to content

Commit

Permalink
[ENH] Add Robles-Bartolotti and Gunnarsson-Lundqvist electronegativit…
Browse files Browse the repository at this point in the history
…ies (#208)

* fetch new electronegativities

* add electronegativity scales

* update data docs

* update readme

* update electronegativity docs page

* update electronegativity plotting function

* fix img file name
  • Loading branch information
lmmentel authored Nov 11, 2024
1 parent d8a82ef commit c36bdb7
Show file tree
Hide file tree
Showing 11 changed files with 327 additions and 222 deletions.
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,20 @@ important entries are listed:

### Electronegativity scales

- Allen
- Allred & Rochow
- Cottrell & Sutton
- Ghosh
- Gordy
- Li & Xue
- Nagle
- Martynov & Batsanov
- Miedema
- Mulliken
- Pauling
- Sanderson
- Allen
- Allred & Rochow
- Cottrell & Sutton
- Ghosh
- Gordy
- Gunnarsson-Lundqvist
- Li & Xue
- Nagle
- Martynov & Batsanov
- Miedema
- Mulliken
- Pauling
- Robles-Bartolotti
- Sanderson

### Descriptive properties

Expand Down
29 changes: 29 additions & 0 deletions alembic/versions/55a636dde7bf_add_gl_and_rb_electronegativities.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""add GL and RB electronegativities
Revision ID: 55a636dde7bf
Revises: db2973cd13af
Create Date: 2024-11-10 21:39:28.836892
"""

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

from alembic import op
import sqlalchemy as sa


def upgrade():

op.add_column("elements", sa.Column("en_gunnarsson_lundqvist", sa.Float))
op.add_column("elements", sa.Column("en_robles_bartolotti", sa.Float))


def downgrade():

with op.batch_alter_table("elements") as batch_op:
batch_op.drop_column("en_gunnarsson_lundqvist")
batch_op.drop_column("en_robles_bartolotti")
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_robles_bartolotti.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
418 changes: 211 additions & 207 deletions docs/source/data.rst

Large diffs are not rendered by default.

38 changes: 37 additions & 1 deletion docs/source/electronegativity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ appropriate formulas. The following scales are stored:

- :ref:`Allen <allen_en>`
- :ref:`Ghosh <ghosh_en>`
- :ref:`Gunnarsson-Lundqvist <gunnarsson_lundqvist_en>`
- :ref:`Miedema <miedema_en>`
- :ref:`Pauling <pauling_en>`
- :ref:`Robles-Bartolotti <robles_bartolotti_en>`

Moreover there are electronegativity scales that can be computed from their
Moreover, there are electronegativity scales that can be computed from their
respective definition and the atomic properties available in :ref:`mendeleev <mendeleev>`:

- :ref:`Allred-Rochow <allred-rochow_en>`
Expand Down Expand Up @@ -181,6 +183,23 @@ Graph
:alt: Gordy's electronegativity scale
:align: center

.. _gunnarsson_lundqvist_en:

Gunnarsson-Lundqvist
====================

The electronegativities calculated by Robles and Bartolotti :cite:`RoblesBartolotti1984` used a spin polarized
density functional theory. Here the values using the Gunnarsson-Lundqvist :cite:`GunnarssonLundqvist1979`
approximation to the exchange-correlation functional are tabulated.

Graph
-----

.. image:: _static/img/en_gunnarsson_lundqvist.png
:width: 100%
:alt: Gunnarsson-Lundqvist's electronegativity scale
:align: center

.. _li_xue_en:

Li and Xue
Expand Down Expand Up @@ -349,6 +368,23 @@ Graph
:alt: Pauling's electronegativity scale
:align: center

.. _robles_bartolotti_en:

Robles-Bartolotti
=================

The electronegativities calculated by Robles and Bartolotti :cite:`RoblesBartolotti1984` used a spin polarized
density functional theory. Here the values using the :math:`X_{\alpha}` approximation to the exchange-correlation
functional are tabulated.

Graph
-----

.. image:: _static/img/en_robles_bartolotti.png
:width: 100%
:alt: Robles-Bartolotti's electronegativity scale
:align: center

.. _sanderson_en:

Sanderson
Expand Down
26 changes: 26 additions & 0 deletions docs/source/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -898,4 +898,30 @@ @book{deboer1988cohesion
place = {Netherlands},
publisher = {North-Holland},
year = {1988}
}
@article{GunnarssonLundqvist1979,
title = {Descriptions of exchange and correlation effects in inhomogeneous electron systems},
author = {Gunnarsson, O. and Jonson, M. and Lundqvist, B. I.},
journal = {Phys. Rev. B},
volume = {20},
issue = {8},
pages = {3136--3164},
numpages = {0},
year = {1979},
month = {Oct},
publisher = {American Physical Society},
doi = {10.1103/PhysRevB.20.3136},
url = {https://link.aps.org/doi/10.1103/PhysRevB.20.3136}
}
@article{RoblesBartolotti1984,
author = {Robles, Juvencio and Bartolotti, Libero J.},
title = {Electronegativities, electron affinities, ionization potentials, and hardnesses of the elements within spin polarized density functional theory},
journal = {Journal of the American Chemical Society},
volume = {106},
number = {13},
pages = {3723-3727},
year = {1984},
doi = {10.1021/ja00325a003},
url = {https://doi.org/10.1021/ja00325a003},
eprint = {https://doi.org/10.1021/ja00325a003}
}
Binary file modified mendeleev/elements.db
Binary file not shown.
4 changes: 3 additions & 1 deletion mendeleev/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ def fetch_electronegativities(scales: List[str] = None) -> pd.DataFrame:
Element.atomic_number,
Element.symbol,
Element.covalent_radius_pyykko.label("radius"),
Element.en_pauling.label("Pauling"),
Element.en_allen.label("Allen"),
Element.en_ghosh.label("Ghosh"),
Element.en_gunnarsson_lundqvist.label("Gunnarsson-Lundqvist"),
Element.en_miedema.label("Miedema"),
Element.en_pauling.label("Pauling"),
Element.en_robles_bartolotti.label("Robles-Bartolotti"),
).order_by("atomic_number")
df = pd.read_sql_query(query.statement.compile(dialect=sqlite.dialect()), engine)

Expand Down
4 changes: 4 additions & 0 deletions mendeleev/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ class Element(Base):
en_ghosh = Column(Float)
en_miedema = Column(Float)
en_pauling = Column(Float)
en_gunnarsson_lundqvist = Column(Float)
en_robles_bartolotti = Column(Float)
econf = Column("electronic_configuration", String)
evaporation_heat = Column(Float)
fusion_heat = Column(Float)
Expand Down Expand Up @@ -522,12 +524,14 @@ def electronegativity_scales(self, name: str = None) -> Union[Callable, List[str
"cottrell-sutton": self.electronegativity_cottrell_sutton,
"ghosh": self.electronegativity_ghosh,
"gordy": self.electronegativity_gordy,
"gunnarsson-lundqvist": self.en_gunnarsson_lundqvist,
"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,
"robles-bartolotti": self.en_robles_bartolotti,
"sanderson": self.electronegativity_sanderson,
}

Expand Down
4 changes: 3 additions & 1 deletion mendeleev/vis/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,15 @@ def plot_scale(data: pd.DataFrame, scale: str):
data: DataFrame with the electronegativity data, obtained from :func:`fetch.fetch_electronegativities`
scale: Electronegativity scale to plot
"""
scale_name = "-".join(map(str.capitalize, scale.strip("en_").split("_")))
fig = px.scatter(
data,
y=scale,
template="plotly_white",
height=600,
width=1400,
text="symbol",
title=f"{scale}'s Electronegativity",
title=f"{scale_name}'s Electronegativity",
)
fig.update_traces(
textposition="top center",
Expand All @@ -188,4 +189,5 @@ def plot_scale(data: pd.DataFrame, scale: str):
)
fig.update_layout(font={"size": 12})
fig.update_xaxes(title_text="Atomic Number", zeroline=False, range=[0, 119])
fig.update_yaxes(title_text=f"{scale_name}")
return fig

0 comments on commit c36bdb7

Please sign in to comment.