Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Dielectric 5.4.4 (#946)
* Bug fix for NPT DiffusionAnalyzer The DiffusionAnalyzer from_structures method calculates the Cartesian displacements using c_disp = [np.dot(d, m) for d, m in zip(f_disp, l)] f_disp has dimensions [site, time step, axis] l has dimensions [time step, axis, axis] this means the lattice used for calculating the Cartesian displacements is selected based on site number, not on time step. Displacements calculated for NPT simulations therefore contained errors (equivalent to assuming NVT, and then taking a different lattice for each site). This commit fixes this, by replacing the calculation of c_disp with c_disp = [] for i in f_disp: c_disp.append([np.dot(d, m) for d, m in zip(i, l[1:])]) The new calculation also addresses an off-by-one error, where the displacement at time step t was calculated using the lattice at time step t-1. * Alternate dielectric function parsing: vasp 5.4.4 VASP 5.4.4 calculates the frequency dependent dielectric response in two ways, using a "density-density" response function, and using a "velocity-velocity" response function (see the comments in linear_optics.F in the vasp source code). The latter is marked in OUTCAR as current-current (2nd set in vasprun.xml), but is not labelled in vasprun.xml. This commit addresses an issue where the second unlabelled dielectric function would overwrite the first. #940 For consistency with older versions of vasp, the "density-density" linear response function is read into self.dielectric. The "velocity-velocity" linear response function (described as "current-current" in OUTCAR) is read into self.other_dielectric['current-current']. This commit includes a test that if vasprun.xml contains a second unlabelled set of dielectric repsonse data, this is read into self.other_dielectric['current-current']. If a third unlablled set of dielectric data is present in the vasprun.xml, a NotImplementedError is raise (also tested). * Reimplemented dielectric function parser Update to pull request #946 The first unlabelled dielectric function data in vasprun.xml is read into self.dielectric_data['density']. If there is a second unlabelled dielectric function data set, this is read into self.dielectric_data['velocity']. self.dielectric now maps to self.dielectric_data['density'] for consistency with previous behaviour under old VASP versions.
- Loading branch information