Repository files navigation

Peritheos

A Python library for thermodynamic equations of state calculations for solid materials.

Built-in EOS evaluation, inversion, bounded robust fitting, and uncertainty statistics are implemented in Rust and exposed through the unchanged Python API. NumPy broadcasting and user-defined EosBase subclasses remain supported. The package includes PEP 561 typing metadata for type checkers and IDEs.

Full model, fitting, units, and development documentation is available at peritheos.readthedocs.io. Rust users can start with the workflow-oriented Rust API guide and the runnable examples in the unified Rust crate. Release history is recorded in the changelog.

Features

  • Room temperature equations of state (EOS) implementations
    • Birch-Murnaghan
    • Murnaghan
    • Natural strain (orders 2-4)
    • Modified Tait
    • Vinet
    • Holzapfel
  • Thermal equations of state (EOS) implementations
    • Mie-Gruneisen-Debye
    • Mie-Gruneisen-Einstein
    • Linear thermal pressure
    • Holland-Powell thermal modified Tait
    • Multi-oscillator Gruneisen thermal pressure
  • P-V and P-V-T parameter fitting with covariance and diagnostics
  • Joint reference-isotherm and thermal fitting with cross-covariance
  • Correlated observation errors and robust least-squares losses
  • Reproducible fit summaries and versioned JSON export
  • EOS prediction uncertainty from fitted covariance or published parameter errors
  • Thermoelastic derivatives, heat capacities, and vibrational potentials
  • Versioned material and EOS-record catalog with explicit literature provenance, calibration/data envelopes, extrapolation enabled by default, inversion, and measurement/parameter uncertainty
  • A Peritheos-owned .eosmat schema and 116-material/161-record EOS library with optional diffraction structure, stable identifiers, and Dioptas 0.10 storage-read compatibility
  • Recursive pressure-scale normalization across Au, Pt, KCl, ruby R1, and diamond Raman standards with source-documented cross-calibration edges
  • Native wheels for supported CPython releases on Linux, macOS, and Windows

Unit conventions

  • Public pressure and bulk-modulus values are in GPa.
  • Temperatures are in K.
  • Birch-Murnaghan, Murnaghan, modified Tait, and Vinet accept any consistent volume unit.
  • Holzapfel and energy-based thermal EOS implementations require molar volume in J bar^-1 mol^-1, which is equivalent to cm^3/mol divided by 10.
  • The volume-independent linear thermal-pressure correction uses the same volume convention as its reference isotherm.

Installation

pip install peritheos

The latest development version can instead be installed directly from GitHub:

pip install git+https://github.com/CPrescher/peritheos.git

Development and other source installations compile the private native extension and therefore require a Rust toolchain compatible with Rust 1.83 or newer. Published PyPI wheels do not require Rust.

Usage

Materials and EOS records

Materials group one or more literature-specific EOS records. The calculation API uses GPa, K, and conventional unit-cell volumes in angstrom cubed. Each EOS record carries its primary reference, parameter provenance, validity range, and uncertainty assumptions.

fromperitheosimportget_materialmgo=get_material("mgo_b1")
tange=mgo.get_eos_record("mgo_b1_tange_2009_vinet")
pressure=tange.pressure(volume=60.0, temperature=2000.0)
recovered_volume=tange.volume(pressure, temperature=2000.0)
prediction=tange.pressure_with_uncertainty(
volume=60.0,
temperature=2000.0,
volume_sigma=0.02,
temperature_sigma=20.0,
)
# Sokolova markers use the same cell-volume API although their composed EOS# works internally with molar volume.gold=get_material("au_fcc").get_eos_record("au_fcc_sokolova_2013")
hot_pressure=gold.pressure(volume=55.0, temperature=2000.0)

See Pressure standards for EOS records commonly used in that application, and Dioptas and .eosmat for the shared material library. The .eosmat schema reference defines its fields, equation discriminators, defaults, units, and compatibility rules.

Room-temperature equations of state

Third-order Birch-Murnaghan equation of state:

fromperitheos.eos.rtimportBM3# V0 may use any volume unit for a room-temperature EOS; K0 is in GPa here.eos=BM3(V0=50, K0=130, K0_prime=4.3)
# Calculate pressure and bulk modulus at a given volume.pressure=eos.pressure(V=40)
bulk_modulus=eos.bulk_modulus(V=40)
# Invert the EOS to calculate volume at a given pressure.volume=eos.volume(P=pressure)
print(f"Pressure: {pressure} GPa")
print(f"Bulk modulus: {bulk_modulus} GPa")
print(f"Recovered volume: {volume}")

Thermal equations of state

Mie-Gruneisen-Debye and Mie-Gruneisen-Einstein models can wrap any of the room-temperature equations of state:

fromperitheos.eos.rtimportBM3fromperitheos.eos.thermalimportMieGruneisenDebye# Thermal models require molar volume in J bar^-1 mol^-1.rt_eos=BM3(V0=1.0, K0=160.0, K0_prime=4.0)
eos=MieGruneisenDebye(
rt_eos=rt_eos,
Tr=300.0,
theta0=800.0,
gamma0=1.5,
q=1.0,
n=2,
)
pressure=eos.pressure(V=0.9, T=2000.0)
volume=eos.volume(P=pressure, T=2000.0)
temperature=eos.temperature(P=pressure, V=0.9)
# Predict the hot volume and total pressure when a DAC retains 25% of the# reference-relative thermal pressure above a 40 GPa cold pressure.cold_pressure=40.0hot_temperature=2000.0heated_volume=eos.volume_with_dac_confinement(
cold_pressure,
hot_temperature,
f_dac=0.25,
)
thermal_increment=eos.thermal_pressure_increment(heated_volume, hot_temperature)
heated_pressure=cold_pressure+0.25*thermal_increment# Infer temperature from volumes measured before and during DAC heating.ambient_volume=0.80000heated_volume=0.80001temperature_with_dac=eos.temperature_from_volumes(
V_ambient=ambient_volume,
V_heated=heated_volume,
f_dac=0.25,
)
ambient_pressure=eos.rt_eos.pressure(ambient_volume)
heated_pressure_from_pair=ambient_pressure+eos.dac_thermal_pressure(
heated_volume,
temperature_with_dac,
0.25,
)

Both DAC methods use the empirical f_dac * thermal_pressure_increment confinement term and require 0 <= f_dac < 1; report and sensitivity-test the assumed fraction.

Multi-oscillator thermal EOS with a freely chosen reference isotherm

fromperitheos.eos.rt.holzapfelimportHolzapfelfromperitheos.eos.thermalimportMultiOscillatorGruneisenThermalEOS# Diamond parameters from Sokolova et al. 2016.# The thermal model requires molar volume in J bar^-1 (= [cm^3/mol] / 10),# pressure parameters in GPa, and temperatures in K.V0=0.3414K0=441.5K0_prime=3.9# pressure derivative of bulk modulus at reference volumeQE1o=1561# first Einstein characteristic temperaturemE1=2.436# first Einstein numberQE2o=684# second Einstein characteristic temperaturemE2=0.564# second Einstein numberdelta=-0.506# additive normalizing constant for the Gruneisen parametert=1.085# generalized Gruneisen parametera_0=0# intrinsic anharmonicity parameterm=0# anharmonic analogue of the Grüneisen parametere_0=0# free electrons parameterg=0# electronic analogue of the Grüneisen parametern=1# number of atoms in the formula unitz=6# atomic number of the formula unitTr=298.15# in K - Reference temperature# Initialize the Holzapfel EOSholzapfel=Holzapfel(V0=V0, K0=K0, K0_prime=K0_prime, n=n, Z=z)
# Compose the thermal correction with the source's Holzapfel isotherm.eos=MultiOscillatorGruneisenThermalEOS(
rt_eos=holzapfel,
Tr=Tr,
QE1o=QE1o,
mE1=mE1,
QE2o=QE2o,
mE2=mE2,
delta=delta,
t=t,
a_0=a_0,
m=m,
g=g,
e_0=e_0,
n=n,
)
# Calculate the thermal pressure at a given volume and temperatureV=V0*0.8T=3000# in Kthermal_pressure=eos.thermal_pressure(V, T)
rt_pressure=holzapfel.pressure(V)
pressure=eos.pressure(V, T)
recovered_volume=eos.volume(pressure, T)
recovered_temperature=eos.temperature(pressure, V)
print(f"Thermal pressure: {thermal_pressure} GPa")
print(f"RT pressure: {rt_pressure} GPa")
print(f"Total pressure: {pressure} GPa")
print(f"Recovered volume: {recovered_volume} J bar^-1")
print(f"Recovered temperature: {recovered_temperature} K")

The equation class is named for its mechanism, not a paper. The validated Sokolova et al. parameterizations remain available through author/year catalog identifiers such as diamond_sokolova_2013; replacing the reference isotherm creates a new user-composed model and does not inherit that validation claim.

Citation and support

Use the repository's CITATION.cff to cite Peritheos and cite the original publication for each EOS used. Reproducible bugs and numerical discrepancies can be reported through GitHub Issues. See SUPPORT.md for the information needed to investigate a result.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

Peritheos

A Python library for thermodynamic equations of state calculations for solid materials.

Built-in EOS evaluation, inversion, bounded robust fitting, and uncertainty statistics are implemented in Rust and exposed through the unchanged Python API. NumPy broadcasting and user-defined EosBase subclasses remain supported. The package includes PEP 561 typing metadata for type checkers and IDEs.

Full model, fitting, units, and development documentation is available at peritheos.readthedocs.io. Rust users can start with the workflow-oriented Rust API guide and the runnable examples in the unified Rust crate. Release history is recorded in the changelog.

Features

  • Room temperature equations of state (EOS) implementations
    • Birch-Murnaghan
    • Murnaghan
    • Natural strain (orders 2-4)
    • Modified Tait
    • Vinet
    • Holzapfel
  • Thermal equations of state (EOS) implementations
    • Mie-Gruneisen-Debye
    • Mie-Gruneisen-Einstein
    • Linear thermal pressure
    • Holland-Powell thermal modified Tait
    • Multi-oscillator Gruneisen thermal pressure
  • P-V and P-V-T parameter fitting with covariance and diagnostics
  • Joint reference-isotherm and thermal fitting with cross-covariance
  • Correlated observation errors and robust least-squares losses
  • Reproducible fit summaries and versioned JSON export
  • EOS prediction uncertainty from fitted covariance or published parameter errors
  • Thermoelastic derivatives, heat capacities, and vibrational potentials
  • Versioned material and EOS-record catalog with explicit literature provenance, calibration/data envelopes, extrapolation enabled by default, inversion, and measurement/parameter uncertainty
  • A Peritheos-owned .eosmat schema and 116-material/161-record EOS library with optional diffraction structure, stable identifiers, and Dioptas 0.10 storage-read compatibility
  • Recursive pressure-scale normalization across Au, Pt, KCl, ruby R1, and diamond Raman standards with source-documented cross-calibration edges
  • Native wheels for supported CPython releases on Linux, macOS, and Windows

Unit conventions

  • Public pressure and bulk-modulus values are in GPa.
  • Temperatures are in K.
  • Birch-Murnaghan, Murnaghan, modified Tait, and Vinet accept any consistent volume unit.
  • Holzapfel and energy-based thermal EOS implementations require molar volume in J bar^-1 mol^-1, which is equivalent to cm^3/mol divided by 10.
  • The volume-independent linear thermal-pressure correction uses the same volume convention as its reference isotherm.

Installation

pip install peritheos

The latest development version can instead be installed directly from GitHub:

pip install git+https://github.com/CPrescher/peritheos.git

Development and other source installations compile the private native extension and therefore require a Rust toolchain compatible with Rust 1.83 or newer. Published PyPI wheels do not require Rust.

Usage

Materials and EOS records

Materials group one or more literature-specific EOS records. The calculation API uses GPa, K, and conventional unit-cell volumes in angstrom cubed. Each EOS record carries its primary reference, parameter provenance, validity range, and uncertainty assumptions.

fromperitheosimportget_materialmgo=get_material("mgo_b1")
tange=mgo.get_eos_record("mgo_b1_tange_2009_vinet")
pressure=tange.pressure(volume=60.0, temperature=2000.0)
recovered_volume=tange.volume(pressure, temperature=2000.0)
prediction=tange.pressure_with_uncertainty(
volume=60.0,
temperature=2000.0,
volume_sigma=0.02,
temperature_sigma=20.0,
)
# Sokolova markers use the same cell-volume API although their composed EOS# works internally with molar volume.gold=get_material("au_fcc").get_eos_record("au_fcc_sokolova_2013")
hot_pressure=gold.pressure(volume=55.0, temperature=2000.0)

See Pressure standards for EOS records commonly used in that application, and Dioptas and .eosmat for the shared material library. The .eosmat schema reference defines its fields, equation discriminators, defaults, units, and compatibility rules.

Room-temperature equations of state

Third-order Birch-Murnaghan equation of state:

fromperitheos.eos.rtimportBM3# V0 may use any volume unit for a room-temperature EOS; K0 is in GPa here.eos=BM3(V0=50, K0=130, K0_prime=4.3)
# Calculate pressure and bulk modulus at a given volume.pressure=eos.pressure(V=40)
bulk_modulus=eos.bulk_modulus(V=40)
# Invert the EOS to calculate volume at a given pressure.volume=eos.volume(P=pressure)
print(f"Pressure: {pressure} GPa")
print(f"Bulk modulus: {bulk_modulus} GPa")
print(f"Recovered volume: {volume}")

Thermal equations of state

Mie-Gruneisen-Debye and Mie-Gruneisen-Einstein models can wrap any of the room-temperature equations of state:

fromperitheos.eos.rtimportBM3fromperitheos.eos.thermalimportMieGruneisenDebye# Thermal models require molar volume in J bar^-1 mol^-1.rt_eos=BM3(V0=1.0, K0=160.0, K0_prime=4.0)
eos=MieGruneisenDebye(
rt_eos=rt_eos,
Tr=300.0,
theta0=800.0,
gamma0=1.5,
q=1.0,
n=2,
)
pressure=eos.pressure(V=0.9, T=2000.0)
volume=eos.volume(P=pressure, T=2000.0)
temperature=eos.temperature(P=pressure, V=0.9)
# Predict the hot volume and total pressure when a DAC retains 25% of the# reference-relative thermal pressure above a 40 GPa cold pressure.cold_pressure=40.0hot_temperature=2000.0heated_volume=eos.volume_with_dac_confinement(
cold_pressure,
hot_temperature,
f_dac=0.25,
)
thermal_increment=eos.thermal_pressure_increment(heated_volume, hot_temperature)
heated_pressure=cold_pressure+0.25*thermal_increment# Infer temperature from volumes measured before and during DAC heating.ambient_volume=0.80000heated_volume=0.80001temperature_with_dac=eos.temperature_from_volumes(
V_ambient=ambient_volume,
V_heated=heated_volume,
f_dac=0.25,
)
ambient_pressure=eos.rt_eos.pressure(ambient_volume)
heated_pressure_from_pair=ambient_pressure+eos.dac_thermal_pressure(
heated_volume,
temperature_with_dac,
0.25,
)

Both DAC methods use the empirical f_dac * thermal_pressure_increment confinement term and require 0 <= f_dac < 1; report and sensitivity-test the assumed fraction.

Multi-oscillator thermal EOS with a freely chosen reference isotherm

fromperitheos.eos.rt.holzapfelimportHolzapfelfromperitheos.eos.thermalimportMultiOscillatorGruneisenThermalEOS# Diamond parameters from Sokolova et al. 2016.# The thermal model requires molar volume in J bar^-1 (= [cm^3/mol] / 10),# pressure parameters in GPa, and temperatures in K.V0=0.3414K0=441.5K0_prime=3.9# pressure derivative of bulk modulus at reference volumeQE1o=1561# first Einstein characteristic temperaturemE1=2.436# first Einstein numberQE2o=684# second Einstein characteristic temperaturemE2=0.564# second Einstein numberdelta=-0.506# additive normalizing constant for the Gruneisen parametert=1.085# generalized Gruneisen parametera_0=0# intrinsic anharmonicity parameterm=0# anharmonic analogue of the Grüneisen parametere_0=0# free electrons parameterg=0# electronic analogue of the Grüneisen parametern=1# number of atoms in the formula unitz=6# atomic number of the formula unitTr=298.15# in K - Reference temperature# Initialize the Holzapfel EOSholzapfel=Holzapfel(V0=V0, K0=K0, K0_prime=K0_prime, n=n, Z=z)
# Compose the thermal correction with the source's Holzapfel isotherm.eos=MultiOscillatorGruneisenThermalEOS(
rt_eos=holzapfel,
Tr=Tr,
QE1o=QE1o,
mE1=mE1,
QE2o=QE2o,
mE2=mE2,
delta=delta,
t=t,
a_0=a_0,
m=m,
g=g,
e_0=e_0,
n=n,
)
# Calculate the thermal pressure at a given volume and temperatureV=V0*0.8T=3000# in Kthermal_pressure=eos.thermal_pressure(V, T)
rt_pressure=holzapfel.pressure(V)
pressure=eos.pressure(V, T)
recovered_volume=eos.volume(pressure, T)
recovered_temperature=eos.temperature(pressure, V)
print(f"Thermal pressure: {thermal_pressure} GPa")
print(f"RT pressure: {rt_pressure} GPa")
print(f"Total pressure: {pressure} GPa")
print(f"Recovered volume: {recovered_volume} J bar^-1")
print(f"Recovered temperature: {recovered_temperature} K")

The equation class is named for its mechanism, not a paper. The validated Sokolova et al. parameterizations remain available through author/year catalog identifiers such as diamond_sokolova_2013; replacing the reference isotherm creates a new user-composed model and does not inherit that validation claim.

Citation and support

Use the repository's CITATION.cff to cite Peritheos and cite the original publication for each EOS used. Reproducible bugs and numerical discrepancies can be reported through GitHub Issues. See SUPPORT.md for the information needed to investigate a result.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Peritheos

A Python library for thermodynamic equations of state calculations for solid materials.

Built-in EOS evaluation, inversion, bounded robust fitting, and uncertainty statistics are implemented in Rust and exposed through the unchanged Python API. NumPy broadcasting and user-defined EosBase subclasses remain supported. The package includes PEP 561 typing metadata for type checkers and IDEs.

Full model, fitting, units, and development documentation is available at peritheos.readthedocs.io. Rust users can start with the workflow-oriented Rust API guide and the runnable examples in the unified Rust crate. Release history is recorded in the changelog.

Features

  • Room temperature equations of state (EOS) implementations
    • Birch-Murnaghan
    • Murnaghan
    • Natural strain (orders 2-4)
    • Modified Tait
    • Vinet
    • Holzapfel
  • Thermal equations of state (EOS) implementations
    • Mie-Gruneisen-Debye
    • Mie-Gruneisen-Einstein
    • Linear thermal pressure
    • Holland-Powell thermal modified Tait
    • Multi-oscillator Gruneisen thermal pressure
  • P-V and P-V-T parameter fitting with covariance and diagnostics
  • Joint reference-isotherm and thermal fitting with cross-covariance
  • Correlated observation errors and robust least-squares losses
  • Reproducible fit summaries and versioned JSON export
  • EOS prediction uncertainty from fitted covariance or published parameter errors
  • Thermoelastic derivatives, heat capacities, and vibrational potentials
  • Versioned material and EOS-record catalog with explicit literature provenance, calibration/data envelopes, extrapolation enabled by default, inversion, and measurement/parameter uncertainty
  • A Peritheos-owned .eosmat schema and 116-material/161-record EOS library with optional diffraction structure, stable identifiers, and Dioptas 0.10 storage-read compatibility
  • Recursive pressure-scale normalization across Au, Pt, KCl, ruby R1, and diamond Raman standards with source-documented cross-calibration edges
  • Native wheels for supported CPython releases on Linux, macOS, and Windows

Unit conventions

  • Public pressure and bulk-modulus values are in GPa.
  • Temperatures are in K.
  • Birch-Murnaghan, Murnaghan, modified Tait, and Vinet accept any consistent volume unit.
  • Holzapfel and energy-based thermal EOS implementations require molar volume in J bar^-1 mol^-1, which is equivalent to cm^3/mol divided by 10.
  • The volume-independent linear thermal-pressure correction uses the same volume convention as its reference isotherm.

Installation

pip install peritheos

The latest development version can instead be installed directly from GitHub:

pip install git+https://github.com/CPrescher/peritheos.git

Development and other source installations compile the private native extension and therefore require a Rust toolchain compatible with Rust 1.83 or newer. Published PyPI wheels do not require Rust.

Usage

Materials and EOS records

Materials group one or more literature-specific EOS records. The calculation API uses GPa, K, and conventional unit-cell volumes in angstrom cubed. Each EOS record carries its primary reference, parameter provenance, validity range, and uncertainty assumptions.

fromperitheosimportget_materialmgo=get_material("mgo_b1")
tange=mgo.get_eos_record("mgo_b1_tange_2009_vinet")
pressure=tange.pressure(volume=60.0, temperature=2000.0)
recovered_volume=tange.volume(pressure, temperature=2000.0)
prediction=tange.pressure_with_uncertainty(
volume=60.0,
temperature=2000.0,
volume_sigma=0.02,
temperature_sigma=20.0,
)
# Sokolova markers use the same cell-volume API although their composed EOS# works internally with molar volume.gold=get_material("au_fcc").get_eos_record("au_fcc_sokolova_2013")
hot_pressure=gold.pressure(volume=55.0, temperature=2000.0)

See Pressure standards for EOS records commonly used in that application, and Dioptas and .eosmat for the shared material library. The .eosmat schema reference defines its fields, equation discriminators, defaults, units, and compatibility rules.

Room-temperature equations of state

Third-order Birch-Murnaghan equation of state:

fromperitheos.eos.rtimportBM3# V0 may use any volume unit for a room-temperature EOS; K0 is in GPa here.eos=BM3(V0=50, K0=130, K0_prime=4.3)
# Calculate pressure and bulk modulus at a given volume.pressure=eos.pressure(V=40)
bulk_modulus=eos.bulk_modulus(V=40)
# Invert the EOS to calculate volume at a given pressure.volume=eos.volume(P=pressure)
print(f"Pressure: {pressure} GPa")
print(f"Bulk modulus: {bulk_modulus} GPa")
print(f"Recovered volume: {volume}")

Thermal equations of state

Mie-Gruneisen-Debye and Mie-Gruneisen-Einstein models can wrap any of the room-temperature equations of state:

fromperitheos.eos.rtimportBM3fromperitheos.eos.thermalimportMieGruneisenDebye# Thermal models require molar volume in J bar^-1 mol^-1.rt_eos=BM3(V0=1.0, K0=160.0, K0_prime=4.0)
eos=MieGruneisenDebye(
rt_eos=rt_eos,
Tr=300.0,
theta0=800.0,
gamma0=1.5,
q=1.0,
n=2,
)
pressure=eos.pressure(V=0.9, T=2000.0)
volume=eos.volume(P=pressure, T=2000.0)
temperature=eos.temperature(P=pressure, V=0.9)
# Predict the hot volume and total pressure when a DAC retains 25% of the# reference-relative thermal pressure above a 40 GPa cold pressure.cold_pressure=40.0hot_temperature=2000.0heated_volume=eos.volume_with_dac_confinement(
cold_pressure,
hot_temperature,
f_dac=0.25,
)
thermal_increment=eos.thermal_pressure_increment(heated_volume, hot_temperature)
heated_pressure=cold_pressure+0.25*thermal_increment# Infer temperature from volumes measured before and during DAC heating.ambient_volume=0.80000heated_volume=0.80001temperature_with_dac=eos.temperature_from_volumes(
V_ambient=ambient_volume,
V_heated=heated_volume,
f_dac=0.25,
)
ambient_pressure=eos.rt_eos.pressure(ambient_volume)
heated_pressure_from_pair=ambient_pressure+eos.dac_thermal_pressure(
heated_volume,
temperature_with_dac,
0.25,
)

Both DAC methods use the empirical f_dac * thermal_pressure_increment confinement term and require 0 <= f_dac < 1; report and sensitivity-test the assumed fraction.

Multi-oscillator thermal EOS with a freely chosen reference isotherm

fromperitheos.eos.rt.holzapfelimportHolzapfelfromperitheos.eos.thermalimportMultiOscillatorGruneisenThermalEOS# Diamond parameters from Sokolova et al. 2016.# The thermal model requires molar volume in J bar^-1 (= [cm^3/mol] / 10),# pressure parameters in GPa, and temperatures in K.V0=0.3414K0=441.5K0_prime=3.9# pressure derivative of bulk modulus at reference volumeQE1o=1561# first Einstein characteristic temperaturemE1=2.436# first Einstein numberQE2o=684# second Einstein characteristic temperaturemE2=0.564# second Einstein numberdelta=-0.506# additive normalizing constant for the Gruneisen parametert=1.085# generalized Gruneisen parametera_0=0# intrinsic anharmonicity parameterm=0# anharmonic analogue of the Grüneisen parametere_0=0# free electrons parameterg=0# electronic analogue of the Grüneisen parametern=1# number of atoms in the formula unitz=6# atomic number of the formula unitTr=298.15# in K - Reference temperature# Initialize the Holzapfel EOSholzapfel=Holzapfel(V0=V0, K0=K0, K0_prime=K0_prime, n=n, Z=z)
# Compose the thermal correction with the source's Holzapfel isotherm.eos=MultiOscillatorGruneisenThermalEOS(
rt_eos=holzapfel,
Tr=Tr,
QE1o=QE1o,
mE1=mE1,
QE2o=QE2o,
mE2=mE2,
delta=delta,
t=t,
a_0=a_0,
m=m,
g=g,
e_0=e_0,
n=n,
)
# Calculate the thermal pressure at a given volume and temperatureV=V0*0.8T=3000# in Kthermal_pressure=eos.thermal_pressure(V, T)
rt_pressure=holzapfel.pressure(V)
pressure=eos.pressure(V, T)
recovered_volume=eos.volume(pressure, T)
recovered_temperature=eos.temperature(pressure, V)
print(f"Thermal pressure: {thermal_pressure} GPa")
print(f"RT pressure: {rt_pressure} GPa")
print(f"Total pressure: {pressure} GPa")
print(f"Recovered volume: {recovered_volume} J bar^-1")
print(f"Recovered temperature: {recovered_temperature} K")

The equation class is named for its mechanism, not a paper. The validated Sokolova et al. parameterizations remain available through author/year catalog identifiers such as diamond_sokolova_2013; replacing the reference isotherm creates a new user-composed model and does not inherit that validation claim.

Citation and support

Use the repository's CITATION.cff to cite Peritheos and cite the original publication for each EOS used. Reproducible bugs and numerical discrepancies can be reported through GitHub Issues. See SUPPORT.md for the information needed to investigate a result.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Peritheos

A Python library for thermodynamic equations of state calculations for solid materials.

Built-in EOS evaluation, inversion, bounded robust fitting, and uncertainty statistics are implemented in Rust and exposed through the unchanged Python API. NumPy broadcasting and user-defined EosBase subclasses remain supported. The package includes PEP 561 typing metadata for type checkers and IDEs.

Full model, fitting, units, and development documentation is available at peritheos.readthedocs.io. Rust users can start with the workflow-oriented Rust API guide and the runnable examples in the unified Rust crate. Release history is recorded in the changelog.

Features

  • Room temperature equations of state (EOS) implementations
    • Birch-Murnaghan
    • Murnaghan
    • Natural strain (orders 2-4)
    • Modified Tait
    • Vinet
    • Holzapfel
  • Thermal equations of state (EOS) implementations
    • Mie-Gruneisen-Debye
    • Mie-Gruneisen-Einstein
    • Linear thermal pressure
    • Holland-Powell thermal modified Tait
    • Multi-oscillator Gruneisen thermal pressure
  • P-V and P-V-T parameter fitting with covariance and diagnostics
  • Joint reference-isotherm and thermal fitting with cross-covariance
  • Correlated observation errors and robust least-squares losses
  • Reproducible fit summaries and versioned JSON export
  • EOS prediction uncertainty from fitted covariance or published parameter errors
  • Thermoelastic derivatives, heat capacities, and vibrational potentials
  • Versioned material and EOS-record catalog with explicit literature provenance, calibration/data envelopes, extrapolation enabled by default, inversion, and measurement/parameter uncertainty
  • A Peritheos-owned .eosmat schema and 116-material/161-record EOS library with optional diffraction structure, stable identifiers, and Dioptas 0.10 storage-read compatibility
  • Recursive pressure-scale normalization across Au, Pt, KCl, ruby R1, and diamond Raman standards with source-documented cross-calibration edges
  • Native wheels for supported CPython releases on Linux, macOS, and Windows

Unit conventions

  • Public pressure and bulk-modulus values are in GPa.
  • Temperatures are in K.
  • Birch-Murnaghan, Murnaghan, modified Tait, and Vinet accept any consistent volume unit.
  • Holzapfel and energy-based thermal EOS implementations require molar volume in J bar^-1 mol^-1, which is equivalent to cm^3/mol divided by 10.
  • The volume-independent linear thermal-pressure correction uses the same volume convention as its reference isotherm.

Installation

pip install peritheos

The latest development version can instead be installed directly from GitHub:

pip install git+https://github.com/CPrescher/peritheos.git

Development and other source installations compile the private native extension and therefore require a Rust toolchain compatible with Rust 1.83 or newer. Published PyPI wheels do not require Rust.

Usage

Materials and EOS records

Materials group one or more literature-specific EOS records. The calculation API uses GPa, K, and conventional unit-cell volumes in angstrom cubed. Each EOS record carries its primary reference, parameter provenance, validity range, and uncertainty assumptions.

fromperitheosimportget_materialmgo=get_material("mgo_b1")
tange=mgo.get_eos_record("mgo_b1_tange_2009_vinet")
pressure=tange.pressure(volume=60.0, temperature=2000.0)
recovered_volume=tange.volume(pressure, temperature=2000.0)
prediction=tange.pressure_with_uncertainty(
volume=60.0,
temperature=2000.0,
volume_sigma=0.02,
temperature_sigma=20.0,
)
# Sokolova markers use the same cell-volume API although their composed EOS# works internally with molar volume.gold=get_material("au_fcc").get_eos_record("au_fcc_sokolova_2013")
hot_pressure=gold.pressure(volume=55.0, temperature=2000.0)

See Pressure standards for EOS records commonly used in that application, and Dioptas and .eosmat for the shared material library. The .eosmat schema reference defines its fields, equation discriminators, defaults, units, and compatibility rules.

Room-temperature equations of state

Third-order Birch-Murnaghan equation of state:

fromperitheos.eos.rtimportBM3# V0 may use any volume unit for a room-temperature EOS; K0 is in GPa here.eos=BM3(V0=50, K0=130, K0_prime=4.3)
# Calculate pressure and bulk modulus at a given volume.pressure=eos.pressure(V=40)
bulk_modulus=eos.bulk_modulus(V=40)
# Invert the EOS to calculate volume at a given pressure.volume=eos.volume(P=pressure)
print(f"Pressure: {pressure} GPa")
print(f"Bulk modulus: {bulk_modulus} GPa")
print(f"Recovered volume: {volume}")

Thermal equations of state

Mie-Gruneisen-Debye and Mie-Gruneisen-Einstein models can wrap any of the room-temperature equations of state:

fromperitheos.eos.rtimportBM3fromperitheos.eos.thermalimportMieGruneisenDebye# Thermal models require molar volume in J bar^-1 mol^-1.rt_eos=BM3(V0=1.0, K0=160.0, K0_prime=4.0)
eos=MieGruneisenDebye(
rt_eos=rt_eos,
Tr=300.0,
theta0=800.0,
gamma0=1.5,
q=1.0,
n=2,
)
pressure=eos.pressure(V=0.9, T=2000.0)
volume=eos.volume(P=pressure, T=2000.0)
temperature=eos.temperature(P=pressure, V=0.9)
# Predict the hot volume and total pressure when a DAC retains 25% of the# reference-relative thermal pressure above a 40 GPa cold pressure.cold_pressure=40.0hot_temperature=2000.0heated_volume=eos.volume_with_dac_confinement(
cold_pressure,
hot_temperature,
f_dac=0.25,
)
thermal_increment=eos.thermal_pressure_increment(heated_volume, hot_temperature)
heated_pressure=cold_pressure+0.25*thermal_increment# Infer temperature from volumes measured before and during DAC heating.ambient_volume=0.80000heated_volume=0.80001temperature_with_dac=eos.temperature_from_volumes(
V_ambient=ambient_volume,
V_heated=heated_volume,
f_dac=0.25,
)
ambient_pressure=eos.rt_eos.pressure(ambient_volume)
heated_pressure_from_pair=ambient_pressure+eos.dac_thermal_pressure(
heated_volume,
temperature_with_dac,
0.25,
)

Both DAC methods use the empirical f_dac * thermal_pressure_increment confinement term and require 0 <= f_dac < 1; report and sensitivity-test the assumed fraction.

Multi-oscillator thermal EOS with a freely chosen reference isotherm

fromperitheos.eos.rt.holzapfelimportHolzapfelfromperitheos.eos.thermalimportMultiOscillatorGruneisenThermalEOS# Diamond parameters from Sokolova et al. 2016.# The thermal model requires molar volume in J bar^-1 (= [cm^3/mol] / 10),# pressure parameters in GPa, and temperatures in K.V0=0.3414K0=441.5K0_prime=3.9# pressure derivative of bulk modulus at reference volumeQE1o=1561# first Einstein characteristic temperaturemE1=2.436# first Einstein numberQE2o=684# second Einstein characteristic temperaturemE2=0.564# second Einstein numberdelta=-0.506# additive normalizing constant for the Gruneisen parametert=1.085# generalized Gruneisen parametera_0=0# intrinsic anharmonicity parameterm=0# anharmonic analogue of the Grüneisen parametere_0=0# free electrons parameterg=0# electronic analogue of the Grüneisen parametern=1# number of atoms in the formula unitz=6# atomic number of the formula unitTr=298.15# in K - Reference temperature# Initialize the Holzapfel EOSholzapfel=Holzapfel(V0=V0, K0=K0, K0_prime=K0_prime, n=n, Z=z)
# Compose the thermal correction with the source's Holzapfel isotherm.eos=MultiOscillatorGruneisenThermalEOS(
rt_eos=holzapfel,
Tr=Tr,
QE1o=QE1o,
mE1=mE1,
QE2o=QE2o,
mE2=mE2,
delta=delta,
t=t,
a_0=a_0,
m=m,
g=g,
e_0=e_0,
n=n,
)
# Calculate the thermal pressure at a given volume and temperatureV=V0*0.8T=3000# in Kthermal_pressure=eos.thermal_pressure(V, T)
rt_pressure=holzapfel.pressure(V)
pressure=eos.pressure(V, T)
recovered_volume=eos.volume(pressure, T)
recovered_temperature=eos.temperature(pressure, V)
print(f"Thermal pressure: {thermal_pressure} GPa")
print(f"RT pressure: {rt_pressure} GPa")
print(f"Total pressure: {pressure} GPa")
print(f"Recovered volume: {recovered_volume} J bar^-1")
print(f"Recovered temperature: {recovered_temperature} K")

The equation class is named for its mechanism, not a paper. The validated Sokolova et al. parameterizations remain available through author/year catalog identifiers such as diamond_sokolova_2013; replacing the reference isotherm creates a new user-composed model and does not inherit that validation claim.

Citation and support

Use the repository's CITATION.cff to cite Peritheos and cite the original publication for each EOS used. Reproducible bugs and numerical discrepancies can be reported through GitHub Issues. See SUPPORT.md for the information needed to investigate a result.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

Peritheos

A Python library for thermodynamic equations of state calculations for solid materials.

Built-in EOS evaluation, inversion, bounded robust fitting, and uncertainty statistics are implemented in Rust and exposed through the unchanged Python API. NumPy broadcasting and user-defined EosBase subclasses remain supported. The package includes PEP 561 typing metadata for type checkers and IDEs.

Full model, fitting, units, and development documentation is available at peritheos.readthedocs.io. Rust users can start with the workflow-oriented Rust API guide and the runnable examples in the unified Rust crate. Release history is recorded in the changelog.

Features

  • Room temperature equations of state (EOS) implementations
    • Birch-Murnaghan
    • Murnaghan
    • Natural strain (orders 2-4)
    • Modified Tait
    • Vinet
    • Holzapfel
  • Thermal equations of state (EOS) implementations
    • Mie-Gruneisen-Debye
    • Mie-Gruneisen-Einstein
    • Linear thermal pressure
    • Holland-Powell thermal modified Tait
    • Multi-oscillator Gruneisen thermal pressure
  • P-V and P-V-T parameter fitting with covariance and diagnostics
  • Joint reference-isotherm and thermal fitting with cross-covariance
  • Correlated observation errors and robust least-squares losses
  • Reproducible fit summaries and versioned JSON export
  • EOS prediction uncertainty from fitted covariance or published parameter errors
  • Thermoelastic derivatives, heat capacities, and vibrational potentials
  • Versioned material and EOS-record catalog with explicit literature provenance, calibration/data envelopes, extrapolation enabled by default, inversion, and measurement/parameter uncertainty
  • A Peritheos-owned .eosmat schema and 116-material/161-record EOS library with optional diffraction structure, stable identifiers, and Dioptas 0.10 storage-read compatibility
  • Recursive pressure-scale normalization across Au, Pt, KCl, ruby R1, and diamond Raman standards with source-documented cross-calibration edges
  • Native wheels for supported CPython releases on Linux, macOS, and Windows

Unit conventions

  • Public pressure and bulk-modulus values are in GPa.
  • Temperatures are in K.
  • Birch-Murnaghan, Murnaghan, modified Tait, and Vinet accept any consistent volume unit.
  • Holzapfel and energy-based thermal EOS implementations require molar volume in J bar^-1 mol^-1, which is equivalent to cm^3/mol divided by 10.
  • The volume-independent linear thermal-pressure correction uses the same volume convention as its reference isotherm.

Installation

pip install peritheos

The latest development version can instead be installed directly from GitHub:

pip install git+https://github.com/CPrescher/peritheos.git

Development and other source installations compile the private native extension and therefore require a Rust toolchain compatible with Rust 1.83 or newer. Published PyPI wheels do not require Rust.

Usage

Materials and EOS records

Materials group one or more literature-specific EOS records. The calculation API uses GPa, K, and conventional unit-cell volumes in angstrom cubed. Each EOS record carries its primary reference, parameter provenance, validity range, and uncertainty assumptions.

fromperitheosimportget_materialmgo=get_material("mgo_b1")
tange=mgo.get_eos_record("mgo_b1_tange_2009_vinet")
pressure=tange.pressure(volume=60.0, temperature=2000.0)
recovered_volume=tange.volume(pressure, temperature=2000.0)
prediction=tange.pressure_with_uncertainty(
volume=60.0,
temperature=2000.0,
volume_sigma=0.02,
temperature_sigma=20.0,
)
# Sokolova markers use the same cell-volume API although their composed EOS# works internally with molar volume.gold=get_material("au_fcc").get_eos_record("au_fcc_sokolova_2013")
hot_pressure=gold.pressure(volume=55.0, temperature=2000.0)

See Pressure standards for EOS records commonly used in that application, and Dioptas and .eosmat for the shared material library. The .eosmat schema reference defines its fields, equation discriminators, defaults, units, and compatibility rules.

Room-temperature equations of state

Third-order Birch-Murnaghan equation of state:

fromperitheos.eos.rtimportBM3# V0 may use any volume unit for a room-temperature EOS; K0 is in GPa here.eos=BM3(V0=50, K0=130, K0_prime=4.3)
# Calculate pressure and bulk modulus at a given volume.pressure=eos.pressure(V=40)
bulk_modulus=eos.bulk_modulus(V=40)
# Invert the EOS to calculate volume at a given pressure.volume=eos.volume(P=pressure)
print(f"Pressure: {pressure} GPa")
print(f"Bulk modulus: {bulk_modulus} GPa")
print(f"Recovered volume: {volume}")

Thermal equations of state

Mie-Gruneisen-Debye and Mie-Gruneisen-Einstein models can wrap any of the room-temperature equations of state:

fromperitheos.eos.rtimportBM3fromperitheos.eos.thermalimportMieGruneisenDebye# Thermal models require molar volume in J bar^-1 mol^-1.rt_eos=BM3(V0=1.0, K0=160.0, K0_prime=4.0)
eos=MieGruneisenDebye(
rt_eos=rt_eos,
Tr=300.0,
theta0=800.0,
gamma0=1.5,
q=1.0,
n=2,
)
pressure=eos.pressure(V=0.9, T=2000.0)
volume=eos.volume(P=pressure, T=2000.0)
temperature=eos.temperature(P=pressure, V=0.9)
# Predict the hot volume and total pressure when a DAC retains 25% of the# reference-relative thermal pressure above a 40 GPa cold pressure.cold_pressure=40.0hot_temperature=2000.0heated_volume=eos.volume_with_dac_confinement(
cold_pressure,
hot_temperature,
f_dac=0.25,
)
thermal_increment=eos.thermal_pressure_increment(heated_volume, hot_temperature)
heated_pressure=cold_pressure+0.25*thermal_increment# Infer temperature from volumes measured before and during DAC heating.ambient_volume=0.80000heated_volume=0.80001temperature_with_dac=eos.temperature_from_volumes(
V_ambient=ambient_volume,
V_heated=heated_volume,
f_dac=0.25,
)
ambient_pressure=eos.rt_eos.pressure(ambient_volume)
heated_pressure_from_pair=ambient_pressure+eos.dac_thermal_pressure(
heated_volume,
temperature_with_dac,
0.25,
)

Both DAC methods use the empirical f_dac * thermal_pressure_increment confinement term and require 0 <= f_dac < 1; report and sensitivity-test the assumed fraction.

Multi-oscillator thermal EOS with a freely chosen reference isotherm

fromperitheos.eos.rt.holzapfelimportHolzapfelfromperitheos.eos.thermalimportMultiOscillatorGruneisenThermalEOS# Diamond parameters from Sokolova et al. 2016.# The thermal model requires molar volume in J bar^-1 (= [cm^3/mol] / 10),# pressure parameters in GPa, and temperatures in K.V0=0.3414K0=441.5K0_prime=3.9# pressure derivative of bulk modulus at reference volumeQE1o=1561# first Einstein characteristic temperaturemE1=2.436# first Einstein numberQE2o=684# second Einstein characteristic temperaturemE2=0.564# second Einstein numberdelta=-0.506# additive normalizing constant for the Gruneisen parametert=1.085# generalized Gruneisen parametera_0=0# intrinsic anharmonicity parameterm=0# anharmonic analogue of the Grüneisen parametere_0=0# free electrons parameterg=0# electronic analogue of the Grüneisen parametern=1# number of atoms in the formula unitz=6# atomic number of the formula unitTr=298.15# in K - Reference temperature# Initialize the Holzapfel EOSholzapfel=Holzapfel(V0=V0, K0=K0, K0_prime=K0_prime, n=n, Z=z)
# Compose the thermal correction with the source's Holzapfel isotherm.eos=MultiOscillatorGruneisenThermalEOS(
rt_eos=holzapfel,
Tr=Tr,
QE1o=QE1o,
mE1=mE1,
QE2o=QE2o,
mE2=mE2,
delta=delta,
t=t,
a_0=a_0,
m=m,
g=g,
e_0=e_0,
n=n,
)
# Calculate the thermal pressure at a given volume and temperatureV=V0*0.8T=3000# in Kthermal_pressure=eos.thermal_pressure(V, T)
rt_pressure=holzapfel.pressure(V)
pressure=eos.pressure(V, T)
recovered_volume=eos.volume(pressure, T)
recovered_temperature=eos.temperature(pressure, V)
print(f"Thermal pressure: {thermal_pressure} GPa")
print(f"RT pressure: {rt_pressure} GPa")
print(f"Total pressure: {pressure} GPa")
print(f"Recovered volume: {recovered_volume} J bar^-1")
print(f"Recovered temperature: {recovered_temperature} K")

The equation class is named for its mechanism, not a paper. The validated Sokolova et al. parameterizations remain available through author/year catalog identifiers such as diamond_sokolova_2013; replacing the reference isotherm creates a new user-composed model and does not inherit that validation claim.

Citation and support

Use the repository's CITATION.cff to cite Peritheos and cite the original publication for each EOS used. Reproducible bugs and numerical discrepancies can be reported through GitHub Issues. See SUPPORT.md for the information needed to investigate a result.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Peritheos

A Python library for thermodynamic equations of state calculations for solid materials.

Built-in EOS evaluation, inversion, bounded robust fitting, and uncertainty statistics are implemented in Rust and exposed through the unchanged Python API. NumPy broadcasting and user-defined EosBase subclasses remain supported. The package includes PEP 561 typing metadata for type checkers and IDEs.

Full model, fitting, units, and development documentation is available at peritheos.readthedocs.io. Rust users can start with the workflow-oriented Rust API guide and the runnable examples in the unified Rust crate. Release history is recorded in the changelog.

Features

  • Room temperature equations of state (EOS) implementations
    • Birch-Murnaghan
    • Murnaghan
    • Natural strain (orders 2-4)
    • Modified Tait
    • Vinet
    • Holzapfel
  • Thermal equations of state (EOS) implementations
    • Mie-Gruneisen-Debye
    • Mie-Gruneisen-Einstein
    • Linear thermal pressure
    • Holland-Powell thermal modified Tait
    • Multi-oscillator Gruneisen thermal pressure
  • P-V and P-V-T parameter fitting with covariance and diagnostics
  • Joint reference-isotherm and thermal fitting with cross-covariance
  • Correlated observation errors and robust least-squares losses
  • Reproducible fit summaries and versioned JSON export
  • EOS prediction uncertainty from fitted covariance or published parameter errors
  • Thermoelastic derivatives, heat capacities, and vibrational potentials
  • Versioned material and EOS-record catalog with explicit literature provenance, calibration/data envelopes, extrapolation enabled by default, inversion, and measurement/parameter uncertainty
  • A Peritheos-owned .eosmat schema and 116-material/161-record EOS library with optional diffraction structure, stable identifiers, and Dioptas 0.10 storage-read compatibility
  • Recursive pressure-scale normalization across Au, Pt, KCl, ruby R1, and diamond Raman standards with source-documented cross-calibration edges
  • Native wheels for supported CPython releases on Linux, macOS, and Windows

Unit conventions

  • Public pressure and bulk-modulus values are in GPa.
  • Temperatures are in K.
  • Birch-Murnaghan, Murnaghan, modified Tait, and Vinet accept any consistent volume unit.
  • Holzapfel and energy-based thermal EOS implementations require molar volume in J bar^-1 mol^-1, which is equivalent to cm^3/mol divided by 10.
  • The volume-independent linear thermal-pressure correction uses the same volume convention as its reference isotherm.

Installation

pip install peritheos

The latest development version can instead be installed directly from GitHub:

pip install git+https://github.com/CPrescher/peritheos.git

Development and other source installations compile the private native extension and therefore require a Rust toolchain compatible with Rust 1.83 or newer. Published PyPI wheels do not require Rust.

Usage

Materials and EOS records

Materials group one or more literature-specific EOS records. The calculation API uses GPa, K, and conventional unit-cell volumes in angstrom cubed. Each EOS record carries its primary reference, parameter provenance, validity range, and uncertainty assumptions.

fromperitheosimportget_materialmgo=get_material("mgo_b1")
tange=mgo.get_eos_record("mgo_b1_tange_2009_vinet")
pressure=tange.pressure(volume=60.0, temperature=2000.0)
recovered_volume=tange.volume(pressure, temperature=2000.0)
prediction=tange.pressure_with_uncertainty(
volume=60.0,
temperature=2000.0,
volume_sigma=0.02,
temperature_sigma=20.0,
)
# Sokolova markers use the same cell-volume API although their composed EOS# works internally with molar volume.gold=get_material("au_fcc").get_eos_record("au_fcc_sokolova_2013")
hot_pressure=gold.pressure(volume=55.0, temperature=2000.0)

See Pressure standards for EOS records commonly used in that application, and Dioptas and .eosmat for the shared material library. The .eosmat schema reference defines its fields, equation discriminators, defaults, units, and compatibility rules.

Room-temperature equations of state

Third-order Birch-Murnaghan equation of state:

fromperitheos.eos.rtimportBM3# V0 may use any volume unit for a room-temperature EOS; K0 is in GPa here.eos=BM3(V0=50, K0=130, K0_prime=4.3)
# Calculate pressure and bulk modulus at a given volume.pressure=eos.pressure(V=40)
bulk_modulus=eos.bulk_modulus(V=40)
# Invert the EOS to calculate volume at a given pressure.volume=eos.volume(P=pressure)
print(f"Pressure: {pressure} GPa")
print(f"Bulk modulus: {bulk_modulus} GPa")
print(f"Recovered volume: {volume}")

Thermal equations of state

Mie-Gruneisen-Debye and Mie-Gruneisen-Einstein models can wrap any of the room-temperature equations of state:

fromperitheos.eos.rtimportBM3fromperitheos.eos.thermalimportMieGruneisenDebye# Thermal models require molar volume in J bar^-1 mol^-1.rt_eos=BM3(V0=1.0, K0=160.0, K0_prime=4.0)
eos=MieGruneisenDebye(
rt_eos=rt_eos,
Tr=300.0,
theta0=800.0,
gamma0=1.5,
q=1.0,
n=2,
)
pressure=eos.pressure(V=0.9, T=2000.0)
volume=eos.volume(P=pressure, T=2000.0)
temperature=eos.temperature(P=pressure, V=0.9)
# Predict the hot volume and total pressure when a DAC retains 25% of the# reference-relative thermal pressure above a 40 GPa cold pressure.cold_pressure=40.0hot_temperature=2000.0heated_volume=eos.volume_with_dac_confinement(
cold_pressure,
hot_temperature,
f_dac=0.25,
)
thermal_increment=eos.thermal_pressure_increment(heated_volume, hot_temperature)
heated_pressure=cold_pressure+0.25*thermal_increment# Infer temperature from volumes measured before and during DAC heating.ambient_volume=0.80000heated_volume=0.80001temperature_with_dac=eos.temperature_from_volumes(
V_ambient=ambient_volume,
V_heated=heated_volume,
f_dac=0.25,
)
ambient_pressure=eos.rt_eos.pressure(ambient_volume)
heated_pressure_from_pair=ambient_pressure+eos.dac_thermal_pressure(
heated_volume,
temperature_with_dac,
0.25,
)

Both DAC methods use the empirical f_dac * thermal_pressure_increment confinement term and require 0 <= f_dac < 1; report and sensitivity-test the assumed fraction.

Multi-oscillator thermal EOS with a freely chosen reference isotherm

fromperitheos.eos.rt.holzapfelimportHolzapfelfromperitheos.eos.thermalimportMultiOscillatorGruneisenThermalEOS# Diamond parameters from Sokolova et al. 2016.# The thermal model requires molar volume in J bar^-1 (= [cm^3/mol] / 10),# pressure parameters in GPa, and temperatures in K.V0=0.3414K0=441.5K0_prime=3.9# pressure derivative of bulk modulus at reference volumeQE1o=1561# first Einstein characteristic temperaturemE1=2.436# first Einstein numberQE2o=684# second Einstein characteristic temperaturemE2=0.564# second Einstein numberdelta=-0.506# additive normalizing constant for the Gruneisen parametert=1.085# generalized Gruneisen parametera_0=0# intrinsic anharmonicity parameterm=0# anharmonic analogue of the Grüneisen parametere_0=0# free electrons parameterg=0# electronic analogue of the Grüneisen parametern=1# number of atoms in the formula unitz=6# atomic number of the formula unitTr=298.15# in K - Reference temperature# Initialize the Holzapfel EOSholzapfel=Holzapfel(V0=V0, K0=K0, K0_prime=K0_prime, n=n, Z=z)
# Compose the thermal correction with the source's Holzapfel isotherm.eos=MultiOscillatorGruneisenThermalEOS(
rt_eos=holzapfel,
Tr=Tr,
QE1o=QE1o,
mE1=mE1,
QE2o=QE2o,
mE2=mE2,
delta=delta,
t=t,
a_0=a_0,
m=m,
g=g,
e_0=e_0,
n=n,
)
# Calculate the thermal pressure at a given volume and temperatureV=V0*0.8T=3000# in Kthermal_pressure=eos.thermal_pressure(V, T)
rt_pressure=holzapfel.pressure(V)
pressure=eos.pressure(V, T)
recovered_volume=eos.volume(pressure, T)
recovered_temperature=eos.temperature(pressure, V)
print(f"Thermal pressure: {thermal_pressure} GPa")
print(f"RT pressure: {rt_pressure} GPa")
print(f"Total pressure: {pressure} GPa")
print(f"Recovered volume: {recovered_volume} J bar^-1")
print(f"Recovered temperature: {recovered_temperature} K")

The equation class is named for its mechanism, not a paper. The validated Sokolova et al. parameterizations remain available through author/year catalog identifiers such as diamond_sokolova_2013; replacing the reference isotherm creates a new user-composed model and does not inherit that validation claim.

Citation and support

Use the repository's CITATION.cff to cite Peritheos and cite the original publication for each EOS used. Reproducible bugs and numerical discrepancies can be reported through GitHub Issues. See SUPPORT.md for the information needed to investigate a result.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Peritheos

A Python library for thermodynamic equations of state calculations for solid materials.

Built-in EOS evaluation, inversion, bounded robust fitting, and uncertainty statistics are implemented in Rust and exposed through the unchanged Python API. NumPy broadcasting and user-defined EosBase subclasses remain supported. The package includes PEP 561 typing metadata for type checkers and IDEs.

Full model, fitting, units, and development documentation is available at peritheos.readthedocs.io. Rust users can start with the workflow-oriented Rust API guide and the runnable examples in the unified Rust crate. Release history is recorded in the changelog.

Features

  • Room temperature equations of state (EOS) implementations
    • Birch-Murnaghan
    • Murnaghan
    • Natural strain (orders 2-4)
    • Modified Tait
    • Vinet
    • Holzapfel
  • Thermal equations of state (EOS) implementations
    • Mie-Gruneisen-Debye
    • Mie-Gruneisen-Einstein
    • Linear thermal pressure
    • Holland-Powell thermal modified Tait
    • Multi-oscillator Gruneisen thermal pressure
  • P-V and P-V-T parameter fitting with covariance and diagnostics
  • Joint reference-isotherm and thermal fitting with cross-covariance
  • Correlated observation errors and robust least-squares losses
  • Reproducible fit summaries and versioned JSON export
  • EOS prediction uncertainty from fitted covariance or published parameter errors
  • Thermoelastic derivatives, heat capacities, and vibrational potentials
  • Versioned material and EOS-record catalog with explicit literature provenance, calibration/data envelopes, extrapolation enabled by default, inversion, and measurement/parameter uncertainty
  • A Peritheos-owned .eosmat schema and 116-material/161-record EOS library with optional diffraction structure, stable identifiers, and Dioptas 0.10 storage-read compatibility
  • Recursive pressure-scale normalization across Au, Pt, KCl, ruby R1, and diamond Raman standards with source-documented cross-calibration edges
  • Native wheels for supported CPython releases on Linux, macOS, and Windows

Unit conventions

  • Public pressure and bulk-modulus values are in GPa.
  • Temperatures are in K.
  • Birch-Murnaghan, Murnaghan, modified Tait, and Vinet accept any consistent volume unit.
  • Holzapfel and energy-based thermal EOS implementations require molar volume in J bar^-1 mol^-1, which is equivalent to cm^3/mol divided by 10.
  • The volume-independent linear thermal-pressure correction uses the same volume convention as its reference isotherm.

Installation

pip install peritheos

The latest development version can instead be installed directly from GitHub:

pip install git+https://github.com/CPrescher/peritheos.git

Development and other source installations compile the private native extension and therefore require a Rust toolchain compatible with Rust 1.83 or newer. Published PyPI wheels do not require Rust.

Usage

Materials and EOS records

Materials group one or more literature-specific EOS records. The calculation API uses GPa, K, and conventional unit-cell volumes in angstrom cubed. Each EOS record carries its primary reference, parameter provenance, validity range, and uncertainty assumptions.

fromperitheosimportget_materialmgo=get_material("mgo_b1")
tange=mgo.get_eos_record("mgo_b1_tange_2009_vinet")
pressure=tange.pressure(volume=60.0, temperature=2000.0)
recovered_volume=tange.volume(pressure, temperature=2000.0)
prediction=tange.pressure_with_uncertainty(
volume=60.0,
temperature=2000.0,
volume_sigma=0.02,
temperature_sigma=20.0,
)
# Sokolova markers use the same cell-volume API although their composed EOS# works internally with molar volume.gold=get_material("au_fcc").get_eos_record("au_fcc_sokolova_2013")
hot_pressure=gold.pressure(volume=55.0, temperature=2000.0)

See Pressure standards for EOS records commonly used in that application, and Dioptas and .eosmat for the shared material library. The .eosmat schema reference defines its fields, equation discriminators, defaults, units, and compatibility rules.

Room-temperature equations of state

Third-order Birch-Murnaghan equation of state:

fromperitheos.eos.rtimportBM3# V0 may use any volume unit for a room-temperature EOS; K0 is in GPa here.eos=BM3(V0=50, K0=130, K0_prime=4.3)
# Calculate pressure and bulk modulus at a given volume.pressure=eos.pressure(V=40)
bulk_modulus=eos.bulk_modulus(V=40)
# Invert the EOS to calculate volume at a given pressure.volume=eos.volume(P=pressure)
print(f"Pressure: {pressure} GPa")
print(f"Bulk modulus: {bulk_modulus} GPa")
print(f"Recovered volume: {volume}")

Thermal equations of state

Mie-Gruneisen-Debye and Mie-Gruneisen-Einstein models can wrap any of the room-temperature equations of state:

fromperitheos.eos.rtimportBM3fromperitheos.eos.thermalimportMieGruneisenDebye# Thermal models require molar volume in J bar^-1 mol^-1.rt_eos=BM3(V0=1.0, K0=160.0, K0_prime=4.0)
eos=MieGruneisenDebye(
rt_eos=rt_eos,
Tr=300.0,
theta0=800.0,
gamma0=1.5,
q=1.0,
n=2,
)
pressure=eos.pressure(V=0.9, T=2000.0)
volume=eos.volume(P=pressure, T=2000.0)
temperature=eos.temperature(P=pressure, V=0.9)
# Predict the hot volume and total pressure when a DAC retains 25% of the# reference-relative thermal pressure above a 40 GPa cold pressure.cold_pressure=40.0hot_temperature=2000.0heated_volume=eos.volume_with_dac_confinement(
cold_pressure,
hot_temperature,
f_dac=0.25,
)
thermal_increment=eos.thermal_pressure_increment(heated_volume, hot_temperature)
heated_pressure=cold_pressure+0.25*thermal_increment# Infer temperature from volumes measured before and during DAC heating.ambient_volume=0.80000heated_volume=0.80001temperature_with_dac=eos.temperature_from_volumes(
V_ambient=ambient_volume,
V_heated=heated_volume,
f_dac=0.25,
)
ambient_pressure=eos.rt_eos.pressure(ambient_volume)
heated_pressure_from_pair=ambient_pressure+eos.dac_thermal_pressure(
heated_volume,
temperature_with_dac,
0.25,
)

Both DAC methods use the empirical f_dac * thermal_pressure_increment confinement term and require 0 <= f_dac < 1; report and sensitivity-test the assumed fraction.

Multi-oscillator thermal EOS with a freely chosen reference isotherm

fromperitheos.eos.rt.holzapfelimportHolzapfelfromperitheos.eos.thermalimportMultiOscillatorGruneisenThermalEOS# Diamond parameters from Sokolova et al. 2016.# The thermal model requires molar volume in J bar^-1 (= [cm^3/mol] / 10),# pressure parameters in GPa, and temperatures in K.V0=0.3414K0=441.5K0_prime=3.9# pressure derivative of bulk modulus at reference volumeQE1o=1561# first Einstein characteristic temperaturemE1=2.436# first Einstein numberQE2o=684# second Einstein characteristic temperaturemE2=0.564# second Einstein numberdelta=-0.506# additive normalizing constant for the Gruneisen parametert=1.085# generalized Gruneisen parametera_0=0# intrinsic anharmonicity parameterm=0# anharmonic analogue of the Grüneisen parametere_0=0# free electrons parameterg=0# electronic analogue of the Grüneisen parametern=1# number of atoms in the formula unitz=6# atomic number of the formula unitTr=298.15# in K - Reference temperature# Initialize the Holzapfel EOSholzapfel=Holzapfel(V0=V0, K0=K0, K0_prime=K0_prime, n=n, Z=z)
# Compose the thermal correction with the source's Holzapfel isotherm.eos=MultiOscillatorGruneisenThermalEOS(
rt_eos=holzapfel,
Tr=Tr,
QE1o=QE1o,
mE1=mE1,
QE2o=QE2o,
mE2=mE2,
delta=delta,
t=t,
a_0=a_0,
m=m,
g=g,
e_0=e_0,
n=n,
)
# Calculate the thermal pressure at a given volume and temperatureV=V0*0.8T=3000# in Kthermal_pressure=eos.thermal_pressure(V, T)
rt_pressure=holzapfel.pressure(V)
pressure=eos.pressure(V, T)
recovered_volume=eos.volume(pressure, T)
recovered_temperature=eos.temperature(pressure, V)
print(f"Thermal pressure: {thermal_pressure} GPa")
print(f"RT pressure: {rt_pressure} GPa")
print(f"Total pressure: {pressure} GPa")
print(f"Recovered volume: {recovered_volume} J bar^-1")
print(f"Recovered temperature: {recovered_temperature} K")

The equation class is named for its mechanism, not a paper. The validated Sokolova et al. parameterizations remain available through author/year catalog identifiers such as diamond_sokolova_2013; replacing the reference isotherm creates a new user-composed model and does not inherit that validation claim.

Citation and support

Use the repository's CITATION.cff to cite Peritheos and cite the original publication for each EOS used. Reproducible bugs and numerical discrepancies can be reported through GitHub Issues. See SUPPORT.md for the information needed to investigate a result.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

Peritheos

A Python library for thermodynamic equations of state calculations for solid materials.

Built-in EOS evaluation, inversion, bounded robust fitting, and uncertainty statistics are implemented in Rust and exposed through the unchanged Python API. NumPy broadcasting and user-defined EosBase subclasses remain supported. The package includes PEP 561 typing metadata for type checkers and IDEs.

Full model, fitting, units, and development documentation is available at peritheos.readthedocs.io. Rust users can start with the workflow-oriented Rust API guide and the runnable examples in the unified Rust crate. Release history is recorded in the changelog.

Features

  • Room temperature equations of state (EOS) implementations
    • Birch-Murnaghan
    • Murnaghan
    • Natural strain (orders 2-4)
    • Modified Tait
    • Vinet
    • Holzapfel
  • Thermal equations of state (EOS) implementations
    • Mie-Gruneisen-Debye
    • Mie-Gruneisen-Einstein
    • Linear thermal pressure
    • Holland-Powell thermal modified Tait
    • Multi-oscillator Gruneisen thermal pressure
  • P-V and P-V-T parameter fitting with covariance and diagnostics
  • Joint reference-isotherm and thermal fitting with cross-covariance
  • Correlated observation errors and robust least-squares losses
  • Reproducible fit summaries and versioned JSON export
  • EOS prediction uncertainty from fitted covariance or published parameter errors
  • Thermoelastic derivatives, heat capacities, and vibrational potentials
  • Versioned material and EOS-record catalog with explicit literature provenance, calibration/data envelopes, extrapolation enabled by default, inversion, and measurement/parameter uncertainty
  • A Peritheos-owned .eosmat schema and 116-material/161-record EOS library with optional diffraction structure, stable identifiers, and Dioptas 0.10 storage-read compatibility
  • Recursive pressure-scale normalization across Au, Pt, KCl, ruby R1, and diamond Raman standards with source-documented cross-calibration edges
  • Native wheels for supported CPython releases on Linux, macOS, and Windows

Unit conventions

  • Public pressure and bulk-modulus values are in GPa.
  • Temperatures are in K.
  • Birch-Murnaghan, Murnaghan, modified Tait, and Vinet accept any consistent volume unit.
  • Holzapfel and energy-based thermal EOS implementations require molar volume in J bar^-1 mol^-1, which is equivalent to cm^3/mol divided by 10.
  • The volume-independent linear thermal-pressure correction uses the same volume convention as its reference isotherm.

Installation

pip install peritheos

The latest development version can instead be installed directly from GitHub:

pip install git+https://github.com/CPrescher/peritheos.git

Development and other source installations compile the private native extension and therefore require a Rust toolchain compatible with Rust 1.83 or newer. Published PyPI wheels do not require Rust.

Usage

Materials and EOS records

Materials group one or more literature-specific EOS records. The calculation API uses GPa, K, and conventional unit-cell volumes in angstrom cubed. Each EOS record carries its primary reference, parameter provenance, validity range, and uncertainty assumptions.

fromperitheosimportget_materialmgo=get_material("mgo_b1")
tange=mgo.get_eos_record("mgo_b1_tange_2009_vinet")
pressure=tange.pressure(volume=60.0, temperature=2000.0)
recovered_volume=tange.volume(pressure, temperature=2000.0)
prediction=tange.pressure_with_uncertainty(
volume=60.0,
temperature=2000.0,
volume_sigma=0.02,
temperature_sigma=20.0,
)
# Sokolova markers use the same cell-volume API although their composed EOS# works internally with molar volume.gold=get_material("au_fcc").get_eos_record("au_fcc_sokolova_2013")
hot_pressure=gold.pressure(volume=55.0, temperature=2000.0)

See Pressure standards for EOS records commonly used in that application, and Dioptas and .eosmat for the shared material library. The .eosmat schema reference defines its fields, equation discriminators, defaults, units, and compatibility rules.

Room-temperature equations of state

Third-order Birch-Murnaghan equation of state:

fromperitheos.eos.rtimportBM3# V0 may use any volume unit for a room-temperature EOS; K0 is in GPa here.eos=BM3(V0=50, K0=130, K0_prime=4.3)
# Calculate pressure and bulk modulus at a given volume.pressure=eos.pressure(V=40)
bulk_modulus=eos.bulk_modulus(V=40)
# Invert the EOS to calculate volume at a given pressure.volume=eos.volume(P=pressure)
print(f"Pressure: {pressure} GPa")
print(f"Bulk modulus: {bulk_modulus} GPa")
print(f"Recovered volume: {volume}")

Thermal equations of state

Mie-Gruneisen-Debye and Mie-Gruneisen-Einstein models can wrap any of the room-temperature equations of state:

fromperitheos.eos.rtimportBM3fromperitheos.eos.thermalimportMieGruneisenDebye# Thermal models require molar volume in J bar^-1 mol^-1.rt_eos=BM3(V0=1.0, K0=160.0, K0_prime=4.0)
eos=MieGruneisenDebye(
rt_eos=rt_eos,
Tr=300.0,
theta0=800.0,
gamma0=1.5,
q=1.0,
n=2,
)
pressure=eos.pressure(V=0.9, T=2000.0)
volume=eos.volume(P=pressure, T=2000.0)
temperature=eos.temperature(P=pressure, V=0.9)
# Predict the hot volume and total pressure when a DAC retains 25% of the# reference-relative thermal pressure above a 40 GPa cold pressure.cold_pressure=40.0hot_temperature=2000.0heated_volume=eos.volume_with_dac_confinement(
cold_pressure,
hot_temperature,
f_dac=0.25,
)
thermal_increment=eos.thermal_pressure_increment(heated_volume, hot_temperature)
heated_pressure=cold_pressure+0.25*thermal_increment# Infer temperature from volumes measured before and during DAC heating.ambient_volume=0.80000heated_volume=0.80001temperature_with_dac=eos.temperature_from_volumes(
V_ambient=ambient_volume,
V_heated=heated_volume,
f_dac=0.25,
)
ambient_pressure=eos.rt_eos.pressure(ambient_volume)
heated_pressure_from_pair=ambient_pressure+eos.dac_thermal_pressure(
heated_volume,
temperature_with_dac,
0.25,
)

Both DAC methods use the empirical f_dac * thermal_pressure_increment confinement term and require 0 <= f_dac < 1; report and sensitivity-test the assumed fraction.

Multi-oscillator thermal EOS with a freely chosen reference isotherm

fromperitheos.eos.rt.holzapfelimportHolzapfelfromperitheos.eos.thermalimportMultiOscillatorGruneisenThermalEOS# Diamond parameters from Sokolova et al. 2016.# The thermal model requires molar volume in J bar^-1 (= [cm^3/mol] / 10),# pressure parameters in GPa, and temperatures in K.V0=0.3414K0=441.5K0_prime=3.9# pressure derivative of bulk modulus at reference volumeQE1o=1561# first Einstein characteristic temperaturemE1=2.436# first Einstein numberQE2o=684# second Einstein characteristic temperaturemE2=0.564# second Einstein numberdelta=-0.506# additive normalizing constant for the Gruneisen parametert=1.085# generalized Gruneisen parametera_0=0# intrinsic anharmonicity parameterm=0# anharmonic analogue of the Grüneisen parametere_0=0# free electrons parameterg=0# electronic analogue of the Grüneisen parametern=1# number of atoms in the formula unitz=6# atomic number of the formula unitTr=298.15# in K - Reference temperature# Initialize the Holzapfel EOSholzapfel=Holzapfel(V0=V0, K0=K0, K0_prime=K0_prime, n=n, Z=z)
# Compose the thermal correction with the source's Holzapfel isotherm.eos=MultiOscillatorGruneisenThermalEOS(
rt_eos=holzapfel,
Tr=Tr,
QE1o=QE1o,
mE1=mE1,
QE2o=QE2o,
mE2=mE2,
delta=delta,
t=t,
a_0=a_0,
m=m,
g=g,
e_0=e_0,
n=n,
)
# Calculate the thermal pressure at a given volume and temperatureV=V0*0.8T=3000# in Kthermal_pressure=eos.thermal_pressure(V, T)
rt_pressure=holzapfel.pressure(V)
pressure=eos.pressure(V, T)
recovered_volume=eos.volume(pressure, T)
recovered_temperature=eos.temperature(pressure, V)
print(f"Thermal pressure: {thermal_pressure} GPa")
print(f"RT pressure: {rt_pressure} GPa")
print(f"Total pressure: {pressure} GPa")
print(f"Recovered volume: {recovered_volume} J bar^-1")
print(f"Recovered temperature: {recovered_temperature} K")

The equation class is named for its mechanism, not a paper. The validated Sokolova et al. parameterizations remain available through author/year catalog identifiers such as diamond_sokolova_2013; replacing the reference isotherm creates a new user-composed model and does not inherit that validation claim.

Citation and support

Use the repository's CITATION.cff to cite Peritheos and cite the original publication for each EOS used. Reproducible bugs and numerical discrepancies can be reported through GitHub Issues. See SUPPORT.md for the information needed to investigate a result.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages