Tutorials
These tutorials will guide you through using py-electrostatic, from basic calculations to advanced applications with machine learning potentials.
Prerequisites
Before starting the tutorials, ensure you have:
Installed py-electrostatic (see Installation)
Basic knowledge of Python and ASE
A structure file with effective charges (we use BaTiO3 as example)
Tutorial Overview
Tutorial 1: Getting Started
Learn the basics:
Loading structures with effective charges
Initializing the calculator
Computing energy and forces
Understanding the output
Tutorial 2: Supercell Calculations
Work with larger systems:
Primitive cell vs supercell concepts
Proper supercell initialization
Energy consistency checks
Atom ordering in supercells
Tutorial 3: Composite Calculator
Combine electrostatics with other potentials:
Why combine short-range and long-range?
Using CompositeCalculator
Example: Harmonic + Electrostatic
Example: ML potential + Electrostatic
Tutorial 4: SSCHA with Electrostatics
Full anharmonic calculation:
Overview of SSCHA method
Using GAP potential with electrostatics
Running finite-temperature structural relaxation
Analyzing results
Example Files
All tutorial examples are available in the docs/examples/ directory:
01_basic_energy_force.py- Basic usage example02_supercell.py- Supercell calculations03_composite.py- Combining potentials04_sscha_electrostatic.py- Full SSCHA calculation
Getting Help
If you encounter issues:
Check the ../user_guide/troubleshooting guide
Review the Parameter Guide guide
Open an issue on GitHub: https://github.com/mesonepigreco/py-electrostatic/issues