Skip to content

Split energy corrections into structure/composition-dependent terms in entry.energy_adjustments #2730

Closed
@janosh

Description

@janosh

I noticed both the old and 2020 MP energy correction schemes are structure-dependent. Here's an example ComputedStructureEntry that when converted to ComputedEntry each copy corrected with both old and new correction scheme gives 4 different energies.

cse.json.zip

import gzip
import json

from pymatgen.entries.computed_entries import ComputedEntry, ComputedStructureEntry

with gzip.open("cse.json.zip") as f:
    cse = ComputedStructureEntry.from_dict(json.load(f))

cse_mp2020 = cse.copy()
cse_legacy = cse.copy()
ce_mp2020 = ComputedEntry.from_dict(cse.to_dict())
ce_legacy = ce_mp2020.copy()

MaterialsProject2020Compatibility().process_entry(cse_mp2020)
MaterialsProject2020Compatibility().process_entry(ce_mp2020)
MaterialsProjectCompatibility().process_entry(cse_legacy)
MaterialsProjectCompatibility().process_entry(ce_legacy)

print(f"{cse_mp2020.correction=:.4}")
print(f"{ce_mp2020.correction=:.4}")
print(f"{cse_legacy.correction=:.4}")
print(f"{ce_legacy.correction=:.4}")

print(f"{cse_mp2020.energy_adjustments=}\n")
print(f"{ce_mp2020.energy_adjustments=}\n")
print(f"{cse_legacy.energy_adjustments=}\n")
print(f"{ce_legacy.energy_adjustments=}\n")

This script prints

cse_mp2020.correction=-2.312
ce_mp2020.correction=-4.416
cse_legacy.correction=-1.973
ce_legacy.correction=-4.49


cse_mp2020.energy_adjustments=[CompositionEnergyAdjustment:
  Name: MP2020 anion correction (superoxide)
  Value: -0.644 eV
  Uncertainty: 0.030 eV
  Description: Composition-based energy adjustment (-0.161 eV/atom x 4.0 atoms)
  Generated by: MaterialsProject2020Compatibility, CompositionEnergyAdjustment:
  Name: MP2020 GGA/GGA+U mixing correction (Mn)
  Value: -1.668 eV
  Uncertainty: 0.005 eV
  Description: Composition-based energy adjustment (-1.668 eV/atom x 1.0 atoms)
  Generated by: MaterialsProject2020Compatibility]

ce_mp2020.energy_adjustments=[CompositionEnergyAdjustment:
  Name: MP2020 anion correction (oxide)
  Value: -2.748 eV
  Uncertainty: 0.008 eV
  Description: Composition-based energy adjustment (-0.687 eV/atom x 4.0 atoms)
  Generated by: MaterialsProject2020Compatibility, CompositionEnergyAdjustment:
  Name: MP2020 GGA/GGA+U mixing correction (Mn)
  Value: -1.668 eV
  Uncertainty: 0.005 eV
  Description: Composition-based energy adjustment (-1.668 eV/atom x 1.0 atoms)
  Generated by: MaterialsProject2020Compatibility]

cse_legacy.energy_adjustments=[ConstantEnergyAdjustment:
  Name: MP Anion Correction
  Value: -0.292 eV
  Uncertainty: nan eV
  Description: Constant energy adjustment (-0.292 eV)
  Generated by: MaterialsProjectCompatibility, ConstantEnergyAdjustment:
  Name: MP Advanced Correction
  Value: -1.681 eV
  Uncertainty: nan eV
  Description: Constant energy adjustment (-1.681 eV)
  Generated by: MaterialsProjectCompatibility]

ce_legacy.energy_adjustments=[ConstantEnergyAdjustment:
  Name: MP Anion Correction
  Value: -2.809 eV
  Uncertainty: nan eV
  Description: Constant energy adjustment (-2.809 eV)
  Generated by: MaterialsProjectCompatibility, ConstantEnergyAdjustment:
  Name: MP Advanced Correction
  Value: -1.681 eV
  Uncertainty: nan eV
  Description: Constant energy adjustment (-1.681 eV)
  Generated by: MaterialsProjectCompatibility]

Currently the list of energy adjustments only discerns anion corrections from MP advanced corrections.

@rkingsbury @computron Would it be possible to split this further to show structure-dependent corrections and simpler composition-only-corrections separately?

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequest for a new featurequestionQuestions about functionality and design choices

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions