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_readPoscarParserbacked 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_energywith 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()
Custom ZPE locator
By default ZPE/TdS is looked for under s1/zpe/OUTCAR, but you can customize. If your ZPE runs live elsewhere (e.g. in step1_zpe), pass your own locator:
def my_zpe_locator(wd: Path, step: str) -> Path:
return wd / f"{step}_zpe" / "OUTCAR"
edfts, zpes, tdss = OutcarParser.auto_read(
workdir, steps, calc_tds=True,
zpe_locator=my_zpe_locator
)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ec_toolkit-0.1.1.tar.gz.
File metadata
- Download URL: ec_toolkit-0.1.1.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e9ef85f244d830fda18ab95b910accc391149fae7167ffba7189888e0c044b4
|
|
| MD5 |
0b10ce5abc5d371326914891624009bb
|
|
| BLAKE2b-256 |
fca3fcdee634a52b0cd09803fec92506e47d6609682e5387977c5bcef77cdda4
|
File details
Details for the file ec_toolkit-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ec_toolkit-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f440920ac1b1f4b35d9515cadc2e66f7d2f88fb3d20e87cd943638b44dfb232
|
|
| MD5 |
a2c2972d2cd96354fbceccaa8706c03f
|
|
| BLAKE2b-256 |
4c913c8e8295191401c553e30f6108359c7d8c26305ccc4e783f0f9480be30bf
|