polypy.analysis

Analysis functions

class polypy.analysis.OneDimensionalChargeDensity(histogram_positions, atom_densities, atom_charges, histogram_volume, timesteps)[source]

Bases: object

The polypy.analysis.OneDimensionalChargeDensity class converts one dimensional number densitie into the charge density, electric field and electrostatic potential.

Parameters:
  • histogram_positions (array_like) – Histogram locations.
  • atom_densities (list) – List of histograms.
  • atom_charges (list) – List of atom charges.
  • histogram_volume (float) – Volume of the histograms.
  • timesteps (float) – Simulation timestep.
calculate_charge_density()[source]

Calculates the charge density in one dimension.

Returns:Charge density.
Return type:charge_density (array_like)
calculate_electric_field()[source]

Calculates the electric field.

Returns:Electric field.
Return type:e_field (array_like)
calculate_electrostatic_potential()[source]

Calculates the electrostatic potential.

Returns:Electrostatic potential.
Return type:potential (array_like)
polypy.analysis.conductivity(charge_carriers, volume, diff, temperature, hr)[source]

Calculate the ionic conductivity.

Parameters:
  • charge_carriers (float) – Number of charge carriers.
  • volume (float) – Average cell volume.
  • diff (float) – Diffusion coefficient.
  • temperature (float) – Temperature.
  • hr (float) – Haven ratio.
Returns:

Ionic conductivity.

Return type:

conductivity (float)

polypy.analysis.system_volume(data)[source]

Calculate the volume at each timestep and return a volume as function of time.

Parameters:data (polypy.read.Trajectory) – polypy Trajectory object.
Returns:Volume as a function of timestep. step (array_like): Timestep.
Return type:volume (array_like)
polypy.analysis.two_dimensional_charge_density(atoms_coords, atom_charges, bin_volume, timesteps)[source]

Calculates the charge density in two dimensions.

Parameters:
  • atoms_coords (list) – List of atomic coordinates
  • atom_charges (list) – List of atomic charges
  • bin_volume (float) – Volume of histograms
Returns:

Charge density.

Return type:

charge_density (array_like)