Files
2026-06-29 13:14:45 +09:00

122 lines
3.7 KiB
Org Mode

#+TITLE: LPSI Iodide--PS4 Sharing Analysis
#+AUTHOR:
#+DATE:
* 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.py= or =calc_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.
1. Read the atomic coordinates of P, S, and I atoms from a LAMMPS trajectory file.
2. Assign each S atom to the nearest P atom, thereby identifying the corresponding PS4 unit.
3. For each I atom, search for S atoms within a cutoff distance.
4. Count how many S atoms belonging to the same PS4 unit are found around the I atom.
5. 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:
#+begin_src python
I_S_CUTOFF = 4.7
#+end_src
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:
#+begin_src sh
pip install numpy pandas
#+end_src
* Usage
Run the script in the directory containing the target =.lammpstrj= files.
For example:
#+begin_src sh
python calc_share.py -i "*_thin100.lammpstrj"
#+end_src
or, if the script filename is =calc_share_v2.py=:
#+begin_src sh
python calc_share_v2.py -i "*_thin100.lammpstrj"
#+end_src
By default, the output LaTeX table is saved as:
#+begin_src text
summary_table.tex
#+end_src
The output filename can be changed using the =-o= option:
#+begin_src sh
python calc_share.py -i "*_thin100.lammpstrj" -o summary_table.tex
#+end_src
* Output
The script generates a LaTeX table in which each row corresponds to an iodine local environment label, such as:
#+begin_src text
edge_0_corner_1
edge_1_corner_0
edge_1_corner_2
#+end_src
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
#+begin_src sh
python calc_share.py -i "*.lammpstrj" -o summary_table.tex
#+end_src
This command analyzes all =.lammpstrj= files in the current directory and writes the summarized result to =summary_table.tex=.