Skip to content

Commit

Permalink
Merge pull request #83 from bjmorgan/units
Browse files Browse the repository at this point in the history
  • Loading branch information
arm61 authored Nov 6, 2024
2 parents 804b16f + d2ab148 commit 09a33ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
17 changes: 9 additions & 8 deletions docs/source/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

- What are the units being used in `kinisi`?

> After `kinisi` reads in a file, the units are modified such that distances are in **angstrom** and time
> in **picoseconds** (these are the standard units for length and time in
> [MDAnalysis objects](https://docs.mdanalysis.org/1.1.1/documentation_pages/units.html), while for VASP
> we internally convert from femtoseconds to picoseconds on parsing), this means that time objects in
> the `parser_params` should use in the input unit (i.e. femtoseconds VASP objects or picoseconds for MDAnalysis objects).
> The `msd` attribute are in units of **squared-angstrom** and the `dt` attribute are in units of **picoseconds**.
> The diffusion or jump-diffusion coefficient has units of **squared-centimetre per second** and the conductivity is
> The output units for MSD-type object in `kinisi` always have distances in **angstrom** and time in **picoseconds**
> (these are the standard units for length and time in
> [`MDAnalysis`](https://docs.mdanalysis.org/1.1.1/documentation_pages/units.html)). The diffusion or
> jump-diffusion coefficient has units of **squared-centimetre per second** and the conductivity is
> **millisiemens per centimetre** (these were chosen as they are common units for these
> parameters, see [this issue](https://github.com/bjmorgan/kinisi/issues/65#issuecomment-2138777775) for
> more discussion).
> more discussion). However, the input units (i.e., the `time_step` argument that is given) depend on the parser
> that is being used, for `Universe` and `ASE` objects, the input unit of time is **picoseconds** but for
> `Pymatgen` objects (i.e., `from_file`, `from_Xdatcar` and `from_pymatgen`) the input time unit is
> **femtoseconds**. It is planned that this (confusing) inconsistancy will be addressed in a future point
> release of `kinisi`.
- I have been using `kinisi` in my research and would like to cite the package, how should I do this?

Expand Down
3 changes: 2 additions & 1 deletion kinisi/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ class PymatgenParser(Parser):
:param structures: Structures ordered in sequence of run.
:param specie: Specie to calculate diffusivity for as a String, e.g. :py:attr:`'Li'`.
:param time_step: Time step, in picoseconds, between steps in trajectory.
:param time_step: Time step, in femtoseconds, between steps in trajectory.
:param step_skip: Sampling freqency of the trajectory (time_step is multiplied by this number to get the real
time between output from the simulation file).
:param sub_sample_traj: Multiple of the :py:attr:`time_step` to sub sample at. Optional, defaults
Expand Down Expand Up @@ -434,6 +434,7 @@ def __init__(self,
memory_limit=memory_limit,
progress=progress)
self._volume = structure.volume
warnings.warn("UserWarning: Be aware that the expected input unit for 'time_step' is femtoseconds, not picoseconds.")
self.delta_t *= 1e-3

@staticmethod
Expand Down

0 comments on commit 09a33ba

Please sign in to comment.