Entropy Parameter#

The entropy parameter \(s_s\) provides a robust method for distinguishing solid and liquid atoms. It is based on the pair entropy and uses a Gaussian-smoothed local density.

Key features:

  • Lower values indicate more crystalline environments

  • Higher values indicate disordered / liquid environments

  • Can be averaged over neighbors for improved classification

import pyscal
from pyscal.structures import make_crystal
from ase.io import read
import numpy as np

Basic Usage#

The entropy parameter requires neighbors to be found first. Key parameters:

  • rm (required): cutoff distance for integration

  • sigma: Gaussian broadening (default: 0.2)

  • average: compute neighbor-averaged entropy (default: False)

# Perfect FCC crystal - low entropy
fcc = make_crystal("fcc", lattice_constant=3.6, repetitions=(4, 4, 4))
pyscal.find_neighbors(fcc, method="cutoff", cutoff=0)

s = pyscal.entropy(fcc, rm=3.0, sigma=0.2, average=True)
print(f"Perfect FCC: entropy mean = {s.mean():.4f}, std = {s.std():.6f}")
Perfect FCC: entropy mean = -0.5612, std = 0.000000

Solid vs Liquid#

The entropy parameter is particularly useful for configurations containing both solid and liquid atoms.

# Compare crystalline structures
fcc = make_crystal("fcc", lattice_constant=3.6, repetitions=(4, 4, 4))
bcc = make_crystal("bcc", lattice_constant=2.87, repetitions=(4, 4, 4))

for name, s_atoms in [("FCC", fcc), ("BCC", bcc)]:
    pyscal.find_neighbors(s_atoms, method="cutoff", cutoff=0)
    s = pyscal.entropy(s_atoms, rm=3.0, sigma=0.2, average=True)
    print(f"{name}: entropy mean = {s.mean():.4f}")
FCC: entropy mean = -0.5612
BCC: entropy mean = -0.4400

Parameters#

Parameter

Description

Typical Value

rm

Cutoff for the entropy integral

3.0

sigma

Width of Gaussian smoothing

0.2

average

Average over neighbor shell

True (recommended)

local

Use local density instead of global

False

Stored Results#

Results are stored in atoms.arrays["pyscal_entropy"] (or pyscal_average_entropy when averaged).

print(f"Stored keys: {[k for k in fcc.arrays if 'entropy' in k]}")
Stored keys: ['pyscal_entropy', 'pyscal_average_entropy']