Files
lpsi-li-nearest-anion-analysis/Readme.org
T
佐久間 美波 d4c6a44e65 add trajectory file
2026-09-19 19:40:53 +09:00

3.7 KiB

Nearest P/I Environment Analysis for Li₃PS₄–LiI Glasses

Overview

This repository contains a Python program for analyzing the local environments of Li⁺ ions in Li₃PS₄–LiI glass trajectories.

For each Li⁺ ion, the program calculates the distances to the nearest P atom and I⁻ ion under periodic boundary conditions. It then determines whether the Li⁺ ion is closer to P or I⁻.

The following two quantities are calculated for each composition:

  • The P fraction in the entire system: P / (P + I)
  • The fraction of Li⁺ ions whose nearest center is P: NLi-near-P / NLi

The second quantity is calculated for each molecular-dynamics step and then averaged over all steps.

Target System

The target system is Li₃PS₄–LiI glass.

The following compositions are included in this repository:

  • 90Li₃PS₄–10LiI
  • 80Li₃PS₄–20LiI
  • 70Li₃PS₄–30LiI
  • 60Li₃PS₄–40LiI
  • 50Li₃PS₄–50LiI

Analysis Procedure

For each molecular-dynamics step, the program performs the following operations:

  1. Read the coordinates of Li⁺, P, S, and I⁻.
  2. Calculate all Li⁺–P distances under periodic boundary conditions.
  3. Calculate all Li⁺–I⁻ distances under periodic boundary conditions.
  4. Identify the nearest P atom and I⁻ ion for each Li⁺ ion.
  5. Classify each Li⁺ ion according to whether P or I⁻ is closer.
  6. Calculate the fraction of Li⁺ ions whose nearest center is P.
  7. Average the fraction over all simulation steps.

The minimum-image convention is used to calculate distances under periodic boundary conditions.

Requirements

  • Python 3
  • NumPy
  • Matplotlib

The required Python packages can be installed using:

pip install numpy matplotlib

Repository Contents

.
├── calc_share.py
├── 050Li3PS4-050LiI_thin100.lammpstrj
├── 060Li3PS4-040LiI_thin100.lammpstrj
├── 070Li3PS4-030LiI_thin100.lammpstrj
├── 080Li3PS4-020LiI_thin100.lammpstrj
├── 090Li3PS4-010LiI_thin100.lammpstrj
├── Readme.org
└── .gitignore

Usage

Run the program by specifying one or more trajectory files with the -i option:

python calc_share.py -i \
  080Li3PS4-020LiI_thin100.lammpstrj \
  070Li3PS4-030LiI_thin100.lammpstrj \
  060Li3PS4-040LiI_thin100.lammpstrj \
  050Li3PS4-050LiI_thin100.lammpstrj

A wildcard can also be used:

python calc_share.py -i *.lammpstrj

Output

The program generates a plot containing the following quantities:

  • Blue line: P / (P + I) in the entire system
  • Green line: fraction of Li⁺ ions whose nearest center is P, averaged over all simulation steps

The plot is saved as:

voronoi_count_diff.pdf

Expected Trajectory Format

The current parser assumes a specific LAMMPS trajectory format:

  • Each atom record contains six columns.
  • The third column contains the element name: Li, P, S, or I.
  • The fourth to sixth columns contain the atomic coordinates.
  • The simulation cell is orthorhombic.
  • The number and order of header fields are fixed for every frame.

If the trajectory format differs from these assumptions, the data-loading section of calc_share.py must be modified.

Notes

  • Li⁺ ions for which the nearest P and I⁻ distances are exactly equal are excluded from both counts in the current implementation.
  • This analysis is based on nearest-neighbor distances and is not a rigorous Voronoi tessellation.
  • The local P fraction around Li⁺ should be interpreted by comparison with the P / (P + I) fraction in the entire system.
  • The current code assumes that both P and I⁻ are present in every trajectory.