Skip to main content

Electrochemical thermodynamics toolkit for VASP workflows

Project description

EC Toolkit

Electrochemical thermodynamics toolkit for VASP workflows:
– Parse OUTCAR & POSCAR
– Build reaction mechanisms from DFT energies, ZPE, and entropy
– Compute ΔG profiles, overpotentials, & $G_{max}$ – Plot free‐energy diagrams


Features

  • I/O parsers
    • OutcarParser.read_edft, read_zpe_tds, read_converged, auto_read
    • PoscarParser backed by ASE, full support for selective dynamics
  • Data models
    • Compound, ElementaryStep, ReactionIntermediate, Mechanism
  • Thermo analysis
    • compute_delta_g, compute_eta_td, compute_g_max
  • Visualization
    • plot_free_energy with optional η and $G_{max}$ annotations
  • Extensible: CLI entry‐points, custom ZPE locators, caching, and more

Installation

pip install ec_toolkit

Quickstart

from pathlib import Path
import matplotlib.pyplot as plt

from ec_toolkit.io.outcar import OutcarParser
from ec_toolkit.models.classes import Compound, ElementaryStep, ReactionIntermediate, Mechanism
from ec_toolkit.analysis.thermodynamics import compute_delta_g
from ec_toolkit.visualization.plotting import plot_free_energy

# 1) Read energies from VASP runs
workdir = Path("my_vasp_runs")
steps   = ["s1", "s2", "s3"]
edfts, zpes, tdss = OutcarParser.auto_read(
    workdir, steps, calc_tds=True
)

# 2) Wrap as Compounds
compounds = {
    name: Compound(name, {"dft": e, "zpe": z, "tds": t}, converged=True)
    for name, e, z, t in zip(steps, edfts, zpes, tdss)
}

# 3) Define stoichiometry & build ReactionIntermediate
stoich1 = { compounds["s1"]:-1, compounds["s2"]: +1 }
stoich2 = { compounds["s2"]:-1, compounds["s3"]: +1 }

ri1 = ReactionIntermediate(ElementaryStep(stoich1), label="s1→s2", is_electrochemical=True)
ri2 = ReactionIntermediate(ElementaryStep(stoich2), label="s2→s3", is_electrochemical=False)

# 4) Assemble Mechanism & compute ΔG profile
mech = Mechanism([ri1, ri2], eq_pot=1.23)
dg0  = compute_delta_g(mech.dE_array, mech.dZPE_array, mech.dTS_array, mech.el_steps, mech.eq_pot)

# 5) Plot
fig, ax = plt.subplots()
plot_free_energy(dg0, mech.el_steps, mech.labels, eq_pot=mech.eq_pot, annotate_eta=True)
plt.tight_layout()
plt.show()

License

This project is released under the MIT License. See License for details.

Contributors

  • Noel Marks
  • Maksim Sokolov

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ec_toolkit-0.1.0.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ec_toolkit-0.1.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file ec_toolkit-0.1.0.tar.gz.

File metadata

  • Download URL: ec_toolkit-0.1.0.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for ec_toolkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 91f38aace57ba36444e8422322c6a673cb24dc34bd6233959a9aa111202c7a91
MD5 22d0987f735481e27e4e2a2f6030a777
BLAKE2b-256 7cf033bb3dc643ef7ba57732603375a9a1dfdee381f6e19d7fe64831d5bb5873

See more details on using hashes here.

File details

Details for the file ec_toolkit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ec_toolkit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for ec_toolkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 622a363846bb287b4eee05662ec55fa99f8b8f4a8898fc8ac84f04f97ba0134b
MD5 57ec30dcf1c67d9fc8e7c44c6a4b24b7
BLAKE2b-256 e3ff1168339176672340f5c36db11deb128e014b1414024fa5ee4cc3da669f7b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page