3.7 KiB
LPSI Iodide–PS4 Sharing Analysis
Overview
This repository contains a Python script for analyzing the local environment of iodide ions in Li3PS4–LiI glass systems from LAMMPS trajectory files.
The script classifies each iodine atom based on how many nearby sulfur atoms belong to neighboring PS4 units. In particular, it counts whether an iodine atom is associated with PS4 units through edge-sharing-like or corner-sharing-like configurations.
The analysis is intended for LPSI compositions such as:
- 050Li3PS4-050LiI
- 060Li3PS4-040LiI
- 070Li3PS4-030LiI
- 080Li3PS4-020LiI
Repository contents
This repository manages the following files:
-
calc_share.pyorcalc_share.py* - Python script for the analysis.
-
050Li3PS4-050LiI_thin100.lammpstrj - LAMMPS trajectory file.
-
060Li3PS4-040LiI_thin100.lammpstrj - LAMMPS trajectory file.
-
070Li3PS4-030LiI_thin100.lammpstrj - LAMMPS trajectory file.
-
080Li3PS4-020LiI_thin100.lammpstrj - LAMMPS trajectory file.
-
README.org - This document.
-
.gitignore - Git ignore settings.
Analysis method
For each timestep in the trajectory, the script performs the following procedure.
- Read the atomic coordinates of P, S, and I atoms from a LAMMPS trajectory file.
- Assign each S atom to the nearest P atom, thereby identifying the corresponding PS4 unit.
- For each I atom, search for S atoms within a cutoff distance.
- Count how many S atoms belonging to the same PS4 unit are found around the I atom.
- Classify the local environment of each I atom using the number of edge-like and corner-like contacts.
In the current script, the I–S cutoff distance is set to:
I_S_CUTOFF = 4.7
If an iodine atom has two nearby S atoms belonging to the same PS4 unit, this is counted as an edge-like contact. If it has one nearby S atom belonging to a PS4 unit, this is counted as a corner-like contact.
The final output is a LaTeX table summarizing the fraction of each local environment for each composition.
Requirements
The script requires Python 3 and the following Python packages:
- numpy
- pandas
These can be installed using pip:
pip install numpy pandas
Usage
Run the script in the directory containing the target .lammpstrj files.
For example:
python calc_share.py -i "*_thin100.lammpstrj"
or, if the script filename is calc_share_v2.py:
python calc_share_v2.py -i "*_thin100.lammpstrj"
By default, the output LaTeX table is saved as:
summary_table.tex
The output filename can be changed using the -o option:
python calc_share.py -i "*_thin100.lammpstrj" -o summary_table.tex
Output
The script generates a LaTeX table in which each row corresponds to an iodine local environment label, such as:
edge_0_corner_1
edge_1_corner_0
edge_1_corner_2
Each column corresponds to a composition.
The values are given as percentages.
Values smaller than or equal to 1% are shown as trace.
Notes
The current implementation assumes that the LAMMPS trajectory files have a fixed format compatible with the parser in calc_share.py. In particular, the script assumes that atomic species labels such as P, S, and I are included in the atom data section.
The periodic boundary condition is treated using the minimum-image convention based on the box lengths.
If the trajectory format is changed, the parsing part of the script may need to be modified.
Example
python calc_share.py -i "*.lammpstrj" -o summary_table.tex
This command analyzes all .lammpstrj files in the current directory and writes the summarized result to summary_table.tex.