# Introduction to Polarization Calculations

## Spontaneous Polarization

Ferroelectrics play a significant role in various technological applications, including tunable capacitors, non-volatile random access memory devices, and electro-optical data storage.  The phenomenon of ferroelectricity often arises due to a structural phase transition from a high-symmetry nonpolar phase to a low-symmetry polar phase as temperature decreases, leading to the spontaneous emergence of polarization.&#x20;

Ferroelectrics exhibit a distinctive hysteresis loop in the polarization versus electric field curve.&#x20;

The spontaneous polarization can be experimentally determined by taking half of the change in polarization at zero external fields.&#x20;

The spontaneous polarization of a material is not directly observable. Instead, it is determined by measuring the change in polarization between two stable configurations of the material.

Following the modern theory of polarization, the polarization, P, of a crystal is defined as,&#x20;

$$
P= P\_0 + \sum\_{i \in {{\rm a,b,c}}} n\_i \frac{eR\_i}{\Omega}
$$

where *e* is the charge of the electron, ni is an integer, **Ri** is a primitive lattice vector, and **Ω** is the unit cell volume. The second term on the right-hand side of the equation is the quantum of polarization,  $$eR\_{i}/\Omega$$, a consequence of translation symmetry.&#x20;

Only differences in the computed polarization on the “same branch” are physically meaningful, so one needs a polar structure and a non-polar reference structure in order to perform the polarization calculations.&#x20;

The following section describes how to compute spontaneous polarization values using density functional theory and the modern theory of polarization

## Getting Polar and non-Polar structure

To compute the spontaneous polarization using the berry phase method implemented in VASP. &#x20;

1: Relax the polar structure using VASP.&#x20;

2: Create an anti-polar structure from the relaxed polar structure.

3: One can use [vtst scripts](https://theory.cm.utexas.edu/vtsttools/) to create several images in between these two endpoints, for example for AlN wurtzite structure, the interpolation path is such that the middle image looks like hexagonal boron nitride. &#x20;

<figure><img src="/files/rZbRQO71p0tKeiYJ6Rk4" alt="" width="375"><figcaption><p>schematic representation of polar, non-polar and anti-polar structure </p></figcaption></figure>

use nebmake.pl script to create 10 images between the polar and anti-polar endpoints with the following command line

```
nebmake.pl POSCAR_polar POSCAR_anti-polar 10 
```

4: Use these images to calculate the value of spontaneous polarization. Use the flags LCALPOL = .TRUE. and DIPOL = 0.5 0.5 0.5 .&#x20;

```
ISYM = 0
NSW = 0
ISTART = 0
SYSTEM = AlN
PREC = Accurate
LCALCPOL = .TRUE.
DIPOL = 0.5 0.5 0.5
LORBIT = 10
ADDGRID = .TRUE.
IBRION = -1
ISMEAR = 0
LWAVE = .TRUE.
SIGMA = 0.01
ALGO = Normal
```

5: After completing this step collect all the POSCAR and OUTCAR files in a directory with proper indexing. e.g POSCAR-00 .... POSCAR-10, OUTCAR-00....OUTCAR-10

to get the polarization branch use [pymatgen utility](https://pymatgen.org/)&#x20;

If you are working with many Python packages, it is generally recommended you create a separate environment for each of your packages. For example:

```
conda create --name my_pymatgen python
source activate my_pymatgen  # OSX or Linux
activate my_pymatgen  # Windows
```

Now using pymatgen utility you can extract the spontaneous polarization values from the POSCAR and OUTCAR files collected in step 5.&#x20;

```
from pymatgen.core.structure import Structure
from pymatgen.analysis.ferroelectricity.polarization import Polarization, calc_ionic, zval_dict_from_potcar, get_total_ionic_dipole
from pymatgen.io.vasp.inputs import Poscar, Potcar
from pymatgen.io.vasp.outputs import Outcar

num_structs = 10
poscars = [Structure.from_file("POSCAR-" + str(i)) for i in range(num_structs)]
outcars = [Outcar("OUTCAR-" + str(i)) for i in range(num_structs)]
potcar=Potcar.from_file("POTCAR")
for i in range(num_structs):
    outcars[i].zval_dict = zval_dict_from_potcar(potcar)


pol_from_out_struct_method = Polarization.from_outcars_and_structures(outcars,poscars,
    calc_ionic_from_zval = True)
print(pol_from_out_struct_method.get_same_branch_polarization_data(convert_to_muC_per_cm2=True))
~                                                                                                    

```

The spontaneous polarization can be calculated by using the formula&#x20;

$$
P\_{S} = 0.5\*(P\_{polar} - P\_{anti-polar})
$$

<figure><img src="/files/TGlS4nxzIQ3WHXiqfhTO" alt="" width="375"><figcaption><p>Polarization curves for AlN along the <span class="math">𝑐̂ </span> direction versus distortion from the polar to non-polar  to anti-polar structure.  </p></figcaption></figure>

<figure><img src="/files/yXsYbVwD0Xv8dbHw1W5X" alt="" width="375"><figcaption><p>the static energy barrier for the polar to anti-polar switching.  The middle point (non-polar)  is halfway between polar and anti-polar structures. </p></figcaption></figure>

The relative energy per formula shows the switching barrier from polar to anti-polar structures assuming a smooth homogeneous switching from polar to anti-polar structure via non-polar h-BN type intermediate. In order to get a proper switching barrier one needs to do ss-NEB calculations. One can find this useful [tutorial](/3dmaterialslab-tutorials/dynamics-in-crystalline-solids/tutorial-on-using-nudged-elastic-band-neb-method.md) on how to  perform ss-NEB calculations&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://3d-materials-lab.gitbook.io/3dmaterialslab-tutorials/polarization/introduction-to-polarization-calculations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
