科研 Skill

状态方程拟合

eos-fitting

Covers equation-of-state fitting from DFT/ML-potential energy-volume data: Birch-Murnaghan, Vinet, and Murnaghan forms. Use when fitting an EOS to compression data.

发布者 Codar安全审核通过v0.1.0更新于 2026-11-18

SKILL.md

EOS Fitting

Description

This skill covers equation-of-state (EOS) fitting for crystalline materials from DFT or ML-potential calculations: generating energy-volume datasets via fixed-volume DFT relaxations, fitting Birch-Murnaghan, Vinet, and Murnaghan EOS forms, extracting equilibrium volume V₀, ground-state energy E₀, bulk modulus B₀, and pressure derivative B'₀, quantifying fitting uncertainty via bootstrap resampling, detecting outliers and phase-transition contamination, and comparing DFT versus MLP EOS for potential validation. Invoke this skill when extracting mechanical properties of crystalline materials, validating an ML potential against DFT ground-state properties, or generating reference EOS data for a materials database.

Domain Context

The equation of state relates the total energy (or pressure) of a crystal to its volume at fixed composition and temperature. For a DFT EOS at 0 K, the energy-volume curve E(V) is the Born-Oppenheimer ground-state total energy as a function of isotropic compression and dilation of the unit cell, with atomic positions and cell shape (but not volume) optimized at each volume. The EOS encodes the two most important bulk mechanical properties: the equilibrium volume V₀ and the isothermal bulk modulus B₀ = −V (∂P/∂V)_T = V (∂²E/∂V²)_T.

Several physical and numerical constraints govern EOS accuracy:

  • Pulay stress. Plane-wave DFT has an incomplete basis set at finite ENCUT. When the cell volume changes, the number and character of plane waves changes discontinuously, introducing a systematic error in the Hellmann-Feynman stress tensor. For a fixed ENCUT, the computed stress at a strained volume is systematically too small (tensile) relative to the true DFT stress. This shifts the apparent equilibrium volume. Pulay stress is reduced by increasing ENCUT to ≥ 1.3 × ENMAX (VASP) or verifying that residual stress from a static single-point is < 1 kbar after relaxation at the converged ENCUT.
  • Isotropic vs. anisotropic strain. The simplest EOS applies to isotropic (hydrostatic) volume change: all lattice vectors scaled uniformly by a factor η = (V/V₀)^{1/3}. For anisotropic crystals (tetragonal, orthorhombic, monoclinic, triclinic), isotropic scaling distorts the equilibrium shape. A more accurate protocol scales the volume while simultaneously optimizing the cell shape at each volume (ISIF=4 in VASP). The resulting EOS characterizes the ground-state energy as a function of volume at the optimal shape for each volume, not at a fixed metric tensor.
  • ISIF settings for fixed-volume relaxations. ISIF controls which degrees of freedom are relaxed in VASP: ISIF=2 (ions only, fixed cell), ISIF=4 (ions + cell shape, fixed volume), ISIF=3 (ions + cell shape + volume, full optimization). For EOS generation, ISIF=4 is the correct setting: it relaxes the internal structure and cell shape but keeps the volume fixed. Using ISIF=2 introduces shape-stress artifacts for non-cubic crystals. Using ISIF=3 would allow the volume to relax to equilibrium rather than to the target value.
  • Volume range and density. A typical EOS fit uses 7–15 volume points spanning ±5–15% of the equilibrium volume. Too narrow a range (±3%) underdetermines the curvature and gives an unreliable B'₀. Too wide a range (> ±20%) risks entering a different structural phase or a high-pressure regime where the 3rd-order Birch-Murnaghan EOS is invalid. For soft materials (polymorphs, molecular crystals, or materials with shallow E-V curves), even ±10% may cross a transition.
  • Magnetic state consistency. For magnetic materials (Fe, Ni, Co, Mn oxides, rare-earth intermetallics), the magnetic ground state may change with volume. A ferromagnetic ground state at equilibrium may become antiferromagnetic or paramagnetic at large compressions. If this transition occurs within the fitting range, the E-V curve has a kink and no single EOS form fits the entire range. The spin state must be monitored at each volume and the fit range restricted to a single-phase, single-spin-state region.

When to Use This Skill

  • Extracting B₀, V₀, and B'₀ for comparison to experimental EOS data or for benchmarking DFT functionals against known values.
  • Validating ML interatomic potentials (MACE, NequIP, DeePMD): a well-trained MLP must reproduce the DFT EOS to within 0.5% in V₀ and 2–5% in B₀. [EXPERT REVIEW NEEDED]
  • Generating training labels for active learning: E-V curve calculations efficiently sample a range of isotropic strain configurations.
  • Generating reference data for materials databases (Materials Project, AFLOW, OQMD) where EOS parameters are stored alongside other properties.
  • Screening materials under high pressure: the EOS provides the pressure-volume relation P(V) = −(∂E/∂V)_T needed to identify high-pressure phase boundaries.

When Not to Use This Skill

  • For materials with known phase transitions in the strain range of interest. If a material undergoes a structural transition within ±10% of V₀, a single-phase EOS fit will fail. Use constrained optimization on individual structural phases instead, or restrict the fit to a narrower volume range.
  • For anharmonic or soft-mode systems near a phase transition. The EOS parametrizes harmonic-level bulk response. Near a soft-mode instability (ferroelectric transition, structural transformation), the E-V curve is not smooth and EOS fitting is unreliable.
  • For extracting single-crystal elastic constants. The EOS gives only the bulk modulus (isotropic compression response). Independent elastic constants (C₁₁, C₁₂, C₄₄, ...) require finite-strain calculations along symmetry-inequivalent strain modes (see the phonopy-stiffness or vaspkit elastic workflow).
  • For high-temperature thermodynamic EOS. The DFT EOS is a 0 K result. Thermal pressure requires quasi-harmonic phonon calculations (phonopy + DFT-EOS) or MD-based equation of state for high temperatures. A 0 K EOS applied at 1000 K gives the wrong equilibrium volume and bulk modulus.
  • As a substitute for full structural relaxation. The equilibrium volume V₀ from an EOS fit is not the same as the volume from a full ISIF=3 relaxation at the same settings. Both should agree to within 0.5%, but the EOS fit gives additional mechanical information (B₀, B'₀) rather than replacing the primary structural optimization.

Core Concepts

  • Birch-Murnaghan EOS (3rd order, BM3): The standard DFT EOS form derived from finite-strain theory with Birch's Eulerian strain η = [(V₀/V)^(2/3) − 1]/2. E(V) = E₀ + (9V₀B₀/16){[(V₀/V)^(2/3) − 1]³ B'₀ + [(V₀/V)^(2/3) − 1]² [6 − 4(V₀/V)^(2/3)]}. P(V) = (3B₀/2)[(V₀/V)^(7/3) − (V₀/V)^(5/3)]{1 + (3/4)(B'₀ − 4)[(V₀/V)^(2/3) − 1]}. BM3 is the standard choice for DFT EOS of hard materials with B₀ > 50 GPa. [EXPERT REVIEW NEEDED: BM3 can overestimate B'₀ for very soft or compressible materials]
  • Vinet EOS (Universal EOS): P(V) = 3B₀ [(1−x)/x²] exp[η(1−x)], where x = (V/V₀)^{1/3} and η = (3/2)(B'₀ − 1). More accurate than BM3 for strongly compressed materials and for high-pressure fits. Converges correctly to the Thomas-Fermi limit at extreme compression. Often preferred for soft materials and high-pressure experiments.
  • Murnaghan EOS: P(V) = (B₀/B'₀)[(V₀/V)^{B'₀} − 1]. The simplest analytical EOS; valid only for small strains. Systematically overestimates B₀ relative to BM3 for large compressions. Included for comparison and for fitting experimental P-V data with few points.
  • Equilibrium volume V₀: The volume at the minimum of E(V). For cubic systems, V₀/N_atoms is reported in ų/atom or ų/atom. Sensitive to the DFT functional: GGA-PBE typically overestimates V₀ by 1–3% for metals; LDA underestimates by 1–3%. SCAN meta-GGA reduces this systematic error for many materials. [EXPERT REVIEW NEEDED]
  • Bulk modulus B₀: B₀ = V₀ (∂²E/∂V²)|_{V=V₀} in GPa. Typical ranges: soft polymers < 5 GPa; alkali metals 10–40 GPa; transition metals 100–400 GPa; diamond 440 GPa. B₀ is more sensitive to functional and pseudopotential choice than V₀.
  • Pressure derivative B'₀: B'₀ = (∂B/∂P)|_{P=0}. Dimensionless. Typical values: B'₀ ≈ 3–5 for most metals and ceramics. BM3 assumes B'₀ is constant (P-independent), valid only at moderate pressures.
  • ISIF=4 (VASP): Relaxes ion positions and cell shape (angles + a/b/c ratios) at fixed volume. The correct setting for EOS volume scans in non-cubic systems. The stress tensor component along the volume direction is non-zero (equal to the negative pressure at that volume); only the deviatoric (shape) stress is minimized.
  • Pulay stress correction: The residual isotropic stress at the ISIF=4 equilibrium geometry for each volume is a diagnostic: if the Pulay contribution (estimated by comparing stress at ENCUT and 1.3×ENCUT) exceeds 1 kbar, ENCUT must be increased. For EOS purposes, the Pulay stress shifts V₀ systematically and may be partially corrected by using the computed P(V) directly rather than deriving pressure from the EOS fit.
  • Bootstrap uncertainty for EOS parameters: Resampling the E-V data with replacement 1000–10,000 times and refitting the EOS at each resample gives confidence intervals on V₀, B₀, B'₀, and E₀ that capture both numerical noise in the DFT energies and sensitivity to individual outlier points. Bootstrap CI is more reliable than the covariance matrix of the nonlinear least-squares fit when the fit is nonlinear or when the residuals are non-Gaussian.
  • E-V residuals as outlier diagnostic: After fitting, the residuals E_fit(Vᵢ) − Eᵢ should be random noise (< 1 meV/atom) and free of systematic trends. A single large residual (> 5 meV/atom) indicates either: (1) an unconverged SCF at that volume, (2) a magnetic state change at that volume, or (3) a structural relaxation that found a different local minimum. All three require investigation before including that point in the fit.

Key Workflows

Full steps for each part are in references/key-workflows/; open the one you need:

Common Failure Modes

FailureSymptomLikely CauseDiagnosticFix
Too few volume pointsBM3 fit fails or gives B'₀ < 1 or B'₀ > 8; large uncertainty in B₀ from bootstrap; results change when a single point is removedFewer than 7 volume points; undersampled curvature at the minimumBootstrap CI on B₀ is > 10 GPa; remove one point and refit — if B₀ shifts by > 5%, the dataset is under-constrainedUse at least 9–11 volume points for production EOS; 7 is the minimum for a reliable BM3 fit
Volume range too narrowB'₀ is poorly determined; BM3 and Vinet give very different B'₀; polynomial fit overshoots at edges±3% volume range is too small to constrain the quartic E-V behaviorCompare BM3 and Vinet B'₀: if they differ by > 1, the fit range is too smallExtend to ±8–12% for hard materials, ±12–15% for soft materials; verify no phase transition in extended range
Volume range too wide (phase transition inside range)Large residuals at outer volume points; kink in E-V curve; space group changes at high compressionE-V curve crosses a phase-transition boundary; the EOS form assumes a single phasePlot structure space group vs. volume (Workflow 4); large residuals at low-V points indicate high-pressure phaseRestrict fit range to exclude the transition; run separate EOS for each phase
Pulay stress artifactsV₀ from EOS disagrees with ISIF=3 full relaxation by > 1%; B₀ is systematically overestimatedENCUT too low; Pulay stress shifts E-V curve; stress is not zero at ISIF=4 equilibriumCompare residual isotropic stress across volumes (should be < 5 kbar); compute EOS at 1.3×ENCUT and compare V₀Increase ENCUT to ≥ 1.3 × max(ENMAX); verify residual Pulay stress < 1 kbar at each volume
Magnetic state change across volumesE-V curve has a kink; large residual at one or two volume points; magnetic moment drops abruptlyFerromagnetic → antiferromagnetic or non-magnetic transition at some intermediate volumePlot total magnetic moment vs. volume from OUTCAR; a discontinuous jump identifies the transition pointExclude points beyond the magnetic transition; fit each phase separately; or constrain spin state with NUPDOWN
ISIF=2 used instead of ISIF=4E-V curve is smooth but V₀ is wrong by > 1% for non-cubic systems; B₀ is overestimated for anisotropic materialsISIF=2 fixes all cell parameters (lengths and angles); shape is not optimized at each volumeCompare V₀ to ISIF=3 full relaxation; if they disagree by > 0.5%, ISIF was wrongRe-run all volume points with ISIF=4; add a note that results with ISIF=2 are unreliable for non-cubic structures
Unconverged relaxation at an extreme volumeLarge residual at the lowest or highest volume point; OUTCAR shows ionic convergence not reachedForce convergence is harder at highly strained volumes where the initial structure is far from equilibriumCheck vasprun.xml converged_ionic; grep for reached required accuracy in each OUTCARIncrease NSW, tighten EDIFFG from −0.02 to −0.01; restart from a partially relaxed CONTCAR at the problematic volume
Overfitting high-order polynomialA polynomial EOS with degree > 4 fits the E-V data perfectly but gives unphysical B'₀ (< 0 or > 10)High-degree polynomial is flexible enough to fit noise; parameters are not physically interpretableCompute AIC/BIC for different polynomial degrees; compare polynomial B₀ to BM3 and VinetAlways use BM3 or Vinet (physical EOS forms with 4 parameters) rather than free-form polynomial fits; use polynomial only for outlier detection
MLP EOS fails validation without diagnosisΔB₀ > 10% between MLP and DFT; cause is unknown; retraining is begun without identifying the problemTraining set does not contain isotropically compressed or expanded bulk configurations; MLP extrapolates outside training distributionCheck committee uncertainty at each EOS volume with an ensemble MLP; identify which volumes are out of distributionAdd bulk EOS configurations (across the full V range) to the training set via active learning; do not just add data near V₀
Reporting B₀ without uncertaintyPaper states "B₀ = 182 GPa" with no uncertainty; another DFT study reports 178 GPa; both claim 1 meV/atom precisionStatistical uncertainty from fitting not computed; systematic functional dependence not exploredBootstrap CI (Workflow 3) gives fitting uncertainty; functional comparison (PBE vs SCAN vs LDA) gives systematic biasAlways report bootstrap CI on B₀; additionally compare two functionals to bound systematic error; report as "B₀ = 182 ± 3 GPa (BM3, bootstrap)"

Best Practices

  • Always use ISIF=4 (not ISIF=2) for non-cubic systems. ISIF=2 fixes the cell shape, introducing artificial shape stress at strained volumes. For cubic systems, ISIF=2 and ISIF=4 are equivalent (no shape degrees of freedom), but using ISIF=4 consistently avoids errors when the symmetry is unexpectedly broken during relaxation.
  • Set ENCUT ≥ 1.3 × max(ENMAX) to suppress Pulay stress. The standard VASP recommendation is ENCUT ≥ 1.3 × ENMAX of the hardest element. Verify the residual isotropic stress at each volume point (read from OUTCAR) and flag any point with |σ_iso| > 5 kbar for re-calculation at higher ENCUT.
  • Always fit at least two EOS forms (BM3 and Vinet) and compare. If B₀ from BM3 and Vinet disagrees by > 5%, the fitting is not reliable — the data range may be too wide or contain a phase transition. Use the smaller B₀ from the two as a conservative estimate.
  • Compute bootstrap confidence intervals before reporting B₀. The formal curve-fitting covariance underestimates uncertainty because it does not account for the nonlinearity of the fit or the possible presence of mild outliers. Bootstrap resampling with N = 1000–2000 provides a more honest uncertainty estimate.
  • Monitor total magnetic moment as a function of volume for magnetic materials. A discontinuous jump in magnetic moment within the fit range invalidates the EOS. Always plot μ_tot vs. V alongside the E-V curve when ISPIN=2 is used.
  • Use 11 volume points at ±10% for standard materials; reduce to ±6–8% for soft or anharmonic systems. The inner ±5% determines B₀ (curvature at the minimum); the outer ±10% determines B'₀ (asymmetry of the well). For soft materials, the ±10% range may cross a phase transition — use ±6–8% and verify with a space group check.
  • For MLP EOS validation: the acceptance threshold is system-dependent. ΔV₀ < 1% and ΔB₀ < 5% are reasonable targets for a well-trained MLP on a standard metal or ceramic. Molecular crystals, soft matter, and systems with long-range van der Waals interactions have larger intrinsic DFT errors and the MLP–DFT comparison has correspondingly wider tolerances. [EXPERT REVIEW NEEDED]
  • Verify the EOS equilibrium volume against ISIF=3 full relaxation. V₀ from the EOS fit and V₀ from a direct ISIF=3 optimization must agree to within 0.5% at the same ENCUT and k-mesh. A larger discrepancy indicates either a fitting problem or that the initial structure used for the EOS scan was not close to the true equilibrium.

Integration with Other Skills

  • dft-convergence: The EOS is the most sensitive bulk property to Pulay stress and basis-set incompleteness. ENCUT convergence testing from that skill must be completed before generating an EOS dataset; use ENCUT ≥ 1.3 × ENMAX rather than the standard production setting for EOS calculations.
  • vasp-workflow: All VASP input-file conventions (INCAR, KPOINTS, POTCAR hierarchy, grompp → mdrun analogue of grompp → vasp), file-parsing with pymatgen, and job submission patterns from that skill apply directly to EOS job arrays. ISIF=4 is introduced in this skill; ISIF=3 (full relaxation) is the standard covered there.
  • quantum-espresso: Quantum ESPRESSO EOS generation uses calculation = 'relax' with cell_dofree = 'ibrav' to fix volume and optimize shape, analogous to VASP ISIF=4. The EOS fitting Python code (Workflows 2–3) is code-agnostic; it requires only (V, E) arrays.
  • high-throughput-dft: EOS generation across a materials database (e.g., all binary alloys in a composition space) requires the workflow graph (atomate2/jobflow) and database infrastructure from that skill. The per-material EOS calculation described here becomes one node in a larger high-throughput graph.
  • mlp-validation: EOS comparison (ΔV₀, ΔB₀) is a required test in MLP validation. That skill defines the full validation suite (energies, forces, stresses, phonons, EOS); this skill provides the detailed protocol for the EOS component.
  • mace-training: If MLP EOS validation fails (ΔB₀ > 10%), the training set likely lacks isotropically strained bulk configurations. This skill's volume-scan structures (Workflow 1) serve as efficient additional training data; adding them via the active-learning or fine-tuning workflow in that skill improves the MLP bulk modulus prediction.
  • active-learning-mlp: EOS volume points with high committee uncertainty identify the configurations where the MLP extrapolates. Those points are the highest-priority candidates for DFT labeling in an active learning loop. The E-V scan from Workflow 1 can be integrated directly into an active learning workflow to improve bulk property accuracy.
  • scientific-visualization: E-V curve plots, P-V curves, residual histograms, and bootstrap parameter distributions (Workflows 3 and 7) follow the matplotlib patterns from that skill. EOS figures should always show raw data points alongside the fitted curve; never plot only the fitted line.
  • reproducibility-workflow: Every EOS dataset must archive: the input POSCAR, INCAR, KPOINTS, POTCAR (or POTCAR hash), the volume fractions used, all vasprun.xml files, the fitting script with version, and the resulting EOS parameters. That skill provides the DVC and directory-structure framework for this archive.
  • pymatgen-analysis: Pymatgen's Structure.scale_lattice(), Vasprun parser, SpacegroupAnalyzer, and EosSet (in pymatgen-analysis-eos) are used throughout this skill. That skill covers pymatgen API patterns, structure manipulation, and high-throughput data extraction.
  • ase-framework: ASE's EquationOfState class (Workflow 6) and the StrainFilter / ExpCellFilter for fixed-volume relaxation are the primary ASE tools for EOS work. That skill covers ASE calculator interface conventions, trajectory management, and unit conversions.

Key References

  1. Birch, F. (1947). Finite elastic strain of cubic crystals. Physical Review, 71(11), 809–824. https://doi.org/10.1103/PhysRev.71.809
  2. Murnaghan, F. D. (1944). The compressibility of media under extreme pressures. Proceedings of the National Academy of Sciences, 30(9), 244–247. https://doi.org/10.1073/pnas.30.9.244
  3. Vinet, P., Ferrante, J., Rose, J. H., & Smith, J. R. (1987). Compressibility of solids. Journal of Geophysical Research: Solid Earth, 92(B9), 9319–9325. https://doi.org/10.1029/JB092iB09p09319
  4. Haas, P., Tran, F., & Blaha, P. (2009). Calculation of the lattice constant of solids with semilocal functionals. Physical Review B, 79(8), 085104. https://doi.org/10.1103/PhysRevB.79.085104
  5. de Jong, M., Chen, W., Angsten, T., Jain, A., Notestine, R., Gamst, A., et al. (2015). Charting the complete elastic properties of inorganic crystalline compounds. Scientific Data, 2, 150009. https://doi.org/10.1038/sdata.2015.9
  6. Francisco, E., Recio, J. M., Blanco, M. A., & Pendás, A. M. (1998). Quantum-mechanical study of thermodynamic and bonding properties of MgF₂. Journal of Physical Chemistry A, 102(9), 1595–1601. https://doi.org/10.1021/jp972516j
  7. Bahn, S. R. & Jacobsen, K. W. (2002). An object-oriented scripting interface to a legacy electronic structure code. Computing in Science & Engineering, 4(3), 56–66. https://doi.org/10.1109/5992.998641
  8. Lejaeghere, K., Van Speybroeck, V., Van Oost, G., & Cottenier, S. (2014). Error estimates for solid-state density-functional theory predictions: An overview by means of the ground-state elemental crystals. Critical Reviews in Solid State and Materials Sciences, 39(1), 1–24. https://doi.org/10.1080/10408436.2013.772503

示例提示词

帮我用Birch-Murnaghan方程拟合这组能量-体积数据得到体模量。

所属插件

计算材料学:第一性原理与原子模拟面向计算材料研究:DFT 与第一性原理(VASP、Quantum ESPRESSO、CP2K、AiiDA)、缺陷/表面/声子/弹性常数、机器学习势函数训练与验证、分子动力学与增强采样、晶体性质图神经网络与生成模型。

安装该插件会一并获得同领域的 35 个 Skill / MCP。

同插件的其他科研 Skill

常见问题

状态方程拟合能做什么?

Covers equation-of-state fitting from DFT/ML-potential energy-volume data: Birch-Murnaghan, Vinet, and Murnaghan forms. Use when fitting an EOS to compression data。

如何安装状态方程拟合?

在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「状态方程拟合」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。

状态方程拟合需要哪些权限?

该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。

状态方程拟合经过官方审核吗?

是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。