4. Phonon and dielectric properties of AlAs#

Here we compute in automated fashion the phonon and dielectric properties of AlAs using aiida-vibroscopy.

Let’s get started!

Hide cell content
from local_module import load_temp_profile

# If you download this file, you can run it with your own profile.
# Put these lines instead:
# from aiida import load_profile
# load_profile()
data = load_temp_profile(
    name="polar-tutorial",
    add_computer=True,
    add_pw_code=True,
    add_phonopy_code=True,
    add_sssp=True,
)
/opt/conda/lib/python3.8/site-packages/paramiko/transport.py:219: CryptographyDeprecationWarning: Blowfish has been deprecated
  "class": algorithms.Blowfish,

4.1. Importing the structure from COD#

Let’s import the silicon structure from the COD database via AiiDA.

from aiida.plugins import DbImporterFactory

CodDbImporter = DbImporterFactory('cod')

cod = CodDbImporter()
results = cod.query(id='1540257') # AlAs 1540257
structure = results[0].get_aiida_structure() # it has 8 atoms

4.2. The HarmonicWorkChain#

For polar materials, the non-analytical constants (NAC), i.e. Born effective charges and dielectric tensors, must be accounted when interpolating the phonon band structure. Moreover in AlAs, since it is non-centrosymmetric, a non zero \(\chi^{(2)}\) is present.

Let’s import the WorkChain and run it! We use the get_builder_from_protocol to get a prefilled builder with all inputs. These inputs should be considered not as converged parameters, but as a good starting point. You may also need to tweak some parameters, e.g. add magnetization etc., depending on your case.

from aiida.orm import List
from aiida.plugins import WorkflowFactory
from aiida.engine import run_get_node

from aiida_vibroscopy.common.properties import PhononProperty

HarmonicWorkChain = WorkflowFactory("vibroscopy.phonons.harmonic")

builder = HarmonicWorkChain.get_builder_from_protocol(
    pw_code=data.pw_code,
    structure=structure,
    protocol="fast",
    phonopy_code=data.phonopy_code,
    phonon_property=PhononProperty.BANDS,
)
builder.phonon.supercell_matrix = List([1,1,1]) # this can be 2,2,2, but we save some time JUST FOR THE TUTORIAL
builder.dielectric.property = "raman" # this way it will compute also third order derivatives

results, calc = run_get_node(builder)
Hide cell output
08/26/2023 11:56:37 AM <1894121> aiida.engine.processes.functions: [WARNING] function `generate_preprocess_data` has invalid type hints: unsupported operand type(s) for |: 'AbstractNodeMeta' and 'NoneType'
08/26/2023 11:56:37 AM <1894121> aiida.engine.processes.functions: [WARNING] function `generate_phonopy_data` has invalid type hints: unsupported operand type(s) for |: 'AbstractNodeMeta' and 'NoneType'
08/26/2023 11:56:37 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [109|HarmonicWorkChain|run_phonon]: submitting `PhononWorkChain` <PK=115>
08/26/2023 11:56:38 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [109|HarmonicWorkChain|run_dielectric]: submitting `DielectricWorkChain` <PK=119>
08/26/2023 11:56:39 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [119|DielectricWorkChain|run_base_scf]: launching base scf PwBaseWorkChain<132>
08/26/2023 11:56:39 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [132|PwBaseWorkChain|run_process]: launching PwCalculation<136> iteration #1
08/26/2023 11:56:39 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [115|PhononWorkChain|run_base_supercell]: launching base supercell scf PwBaseWorkChain<141>
08/26/2023 11:56:40 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [141|PwBaseWorkChain|run_process]: launching PwCalculation<144> iteration #1
08/26/2023 11:56:54 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [132|PwBaseWorkChain|results]: work chain completed after 1 iterations
08/26/2023 11:56:54 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [132|PwBaseWorkChain|on_terminated]: remote folders will not be cleaned
08/26/2023 11:56:54 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [141|PwBaseWorkChain|results]: work chain completed after 1 iterations
08/26/2023 11:56:54 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [141|PwBaseWorkChain|on_terminated]: remote folders will not be cleaned
08/26/2023 11:56:55 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [119|DielectricWorkChain|run_nscf]: launching base scf PwBaseWorkChain<158>
08/26/2023 11:56:56 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [115|PhononWorkChain|run_forces]: submitting `PwBaseWorkChain` <PK=162> with supercell n.o 1
08/26/2023 11:56:57 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [115|PhononWorkChain|run_forces]: submitting `PwBaseWorkChain` <PK=164> with supercell n.o 2
08/26/2023 11:56:58 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [158|PwBaseWorkChain|run_process]: launching PwCalculation<167> iteration #1
08/26/2023 11:56:58 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [162|PwBaseWorkChain|run_process]: launching PwCalculation<170> iteration #1
08/26/2023 11:56:58 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [164|PwBaseWorkChain|run_process]: launching PwCalculation<173> iteration #1
08/26/2023 11:57:13 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [158|PwBaseWorkChain|results]: work chain completed after 1 iterations
08/26/2023 11:57:13 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [158|PwBaseWorkChain|on_terminated]: remote folders will not be cleaned
08/26/2023 11:57:14 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [119|DielectricWorkChain|run_null_field_scfs]: launching PwBaseWorkChain<189> with null electric field 0
08/26/2023 11:57:15 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [119|DielectricWorkChain|run_null_field_scfs]: launching PwBaseWorkChain<190> with null electric field 1
08/26/2023 11:57:16 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [189|PwBaseWorkChain|run_process]: launching PwCalculation<193> iteration #1
08/26/2023 11:57:16 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [190|PwBaseWorkChain|run_process]: launching PwCalculation<196> iteration #1
08/26/2023 11:57:23 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [162|PwBaseWorkChain|results]: work chain completed after 1 iterations
08/26/2023 11:57:23 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [162|PwBaseWorkChain|on_terminated]: cleaned remote folders of calculations: 170
08/26/2023 11:57:23 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [164|PwBaseWorkChain|results]: work chain completed after 1 iterations
08/26/2023 11:57:23 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [164|PwBaseWorkChain|on_terminated]: cleaned remote folders of calculations: 173
08/26/2023 11:57:25 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [115|PhononWorkChain|on_terminated]: cleaned remote folders of calculations: 144 170 173
08/26/2023 11:57:38 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [189|PwBaseWorkChain|results]: work chain completed after 1 iterations
08/26/2023 11:57:38 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [189|PwBaseWorkChain|on_terminated]: remote folders will not be cleaned
08/26/2023 11:57:41 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [190|PwBaseWorkChain|results]: work chain completed after 1 iterations
08/26/2023 11:57:41 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [190|PwBaseWorkChain|on_terminated]: remote folders will not be cleaned
08/26/2023 11:57:42 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [119|DielectricWorkChain|run_electric_field_scfs]: launching PwBaseWorkChain<220> with electric field index 2 and sign 1.0 iteration #0
08/26/2023 11:57:43 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [119|DielectricWorkChain|run_electric_field_scfs]: launching PwBaseWorkChain<223> with electric field index 3 and sign 1.0 iteration #0
08/26/2023 11:57:45 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [220|PwBaseWorkChain|run_process]: launching PwCalculation<226> iteration #1
08/26/2023 11:57:45 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [223|PwBaseWorkChain|run_process]: launching PwCalculation<229> iteration #1
08/26/2023 11:58:06 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [220|PwBaseWorkChain|results]: work chain completed after 1 iterations
08/26/2023 11:58:07 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [220|PwBaseWorkChain|on_terminated]: remote folders will not be cleaned
08/26/2023 11:58:12 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [223|PwBaseWorkChain|results]: work chain completed after 1 iterations
08/26/2023 11:58:12 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [223|PwBaseWorkChain|on_terminated]: remote folders will not be cleaned
08/26/2023 11:58:13 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [119|DielectricWorkChain|run_electric_field_scfs]: launching PwBaseWorkChain<242> with electric field index 2 and sign 1.0 iteration #1
08/26/2023 11:58:14 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [119|DielectricWorkChain|run_electric_field_scfs]: launching PwBaseWorkChain<245> with electric field index 3 and sign 1.0 iteration #1
08/26/2023 11:58:15 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [242|PwBaseWorkChain|run_process]: launching PwCalculation<248> iteration #1
08/26/2023 11:58:16 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [245|PwBaseWorkChain|run_process]: launching PwCalculation<251> iteration #1
08/26/2023 11:58:43 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [242|PwBaseWorkChain|results]: work chain completed after 1 iterations
08/26/2023 11:58:43 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [242|PwBaseWorkChain|on_terminated]: remote folders will not be cleaned
08/26/2023 11:58:46 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [245|PwBaseWorkChain|results]: work chain completed after 1 iterations
08/26/2023 11:58:46 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [245|PwBaseWorkChain|on_terminated]: remote folders will not be cleaned
08/26/2023 11:58:47 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [119|DielectricWorkChain|run_numerical_derivatives]: launching NumericalDerivativesWorkChain<269> for computing numerical derivatives.
/aiida-plugins/aiida-vibroscopy/src/aiida_vibroscopy/calculations/symmetry.py:163: UserWarning: Symmetry of dChi/dr tensors is largely broken. 
The max difference is:
12.88765439365443
  warnings.warn('\n'.join(lines))
/aiida-plugins/aiida-vibroscopy/src/aiida_vibroscopy/calculations/symmetry.py:163: UserWarning: Symmetry of dChi/dr tensors is largely broken. 
The max difference is:
117.75652293854249
  warnings.warn('\n'.join(lines))
/aiida-plugins/aiida-vibroscopy/src/aiida_vibroscopy/calculations/symmetry.py:163: UserWarning: Symmetry of dChi/dr tensors is largely broken. 
The max difference is:
153.75196663153494
  warnings.warn('\n'.join(lines))
08/26/2023 11:58:51 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [119|DielectricWorkChain|on_terminated]: cleaned remote folders of calculations: 136 167 193 196 226 229 248 251
08/26/2023 11:58:54 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [109|HarmonicWorkChain|run_phonopy]: submitting `PhonopyCalculation` <PK=299>
08/26/2023 11:58:59 AM <1894121> aiida.orm.nodes.process.workflow.workchain.WorkChainNode: [REPORT] [109|HarmonicWorkChain|on_terminated]: cleaned remote folders of calculations: 144 170 173 136 167 193 196 226 229 248 251 299

As we computed the phonon dispersion, we can easily plot it as follows:

calc.outputs.output_phonopy.phonon_bands.show_mpl()
_images/c3701d24fa6516c88083926331cca6fdec1893d18a5b81aae67cd715bc7a72b0.png

Hurray! We obtained the LO-TO splitting at the \(\Gamma\) point!

4.3. Born charges, dielectric, non-linear optical susceptibility and Raman tensors#

We finally can explore all the electric field related derivatives for this material.

vibro = calc.outputs.vibrational_data.numerical_accuracy_4
print("The Born effective charges: ", "\n", vibro.born_charges.round(5))
The Born effective charges:  
 [[[ 2.14436  0.      -0.     ]
  [ 0.       2.14436 -0.     ]
  [-0.      -0.       2.14436]]

 [[-2.14436 -0.       0.     ]
  [ 0.      -2.14436  0.     ]
  [ 0.       0.      -2.14436]]]
print("The dielectric tensor: ", "\n", vibro.dielectric.round(5))
The dielectric tensor:  
 [[ 8.38413 -0.      -0.     ]
 [ 0.       8.38413  0.     ]
 [-0.      -0.       8.38413]]
print("The non-linear optical susceptibility tensor (pm/V): ", "\n", vibro.nlo_susceptibility.round(5))
The non-linear optical susceptibility tensor (pm/V):  
 [[[-0.       0.       0.     ]
  [ 0.       0.      42.46219]
  [ 0.      42.46219  0.     ]]

 [[ 0.       0.      42.46219]
  [ 0.       0.       0.     ]
  [42.46219  0.       0.     ]]

 [[ 0.      42.46219  0.     ]
  [42.46219  0.       0.     ]
  [ 0.       0.       0.     ]]]
vol = vibro.get_unitcell().get_cell_volume()
print("The Raman tensors (Angstrom^2): ", "\n", vibro.raman_tensors.round(5)*vol)
The Raman tensors (Angstrom^2):  
 [[[[ 0.         -0.         -0.        ]
   [-0.         -0.         -6.38522341]
   [-0.         -6.38522341 -0.        ]]

  [[-0.         -0.         -6.38522341]
   [-0.         -0.          0.        ]
   [-6.38522341  0.         -0.        ]]

  [[-0.         -6.38522341 -0.        ]
   [-6.38522341 -0.         -0.        ]
   [-0.         -0.         -0.        ]]]


 [[[-0.         -0.          0.        ]
   [-0.          0.          6.38522341]
   [ 0.          6.38522341  0.        ]]

  [[ 0.         -0.          6.38522341]
   [-0.         -0.         -0.        ]
   [ 6.38522341 -0.          0.        ]]

  [[ 0.          6.38522341  0.        ]
   [ 6.38522341 -0.          0.        ]
   [ 0.          0.          0.        ]]]]

4.4. Comparison with experiments#

Here the comparison with experiments. (have a look at I. Souza et al., Phys. Rev. Lett., 89, 11 (2002) and references therein)

print("Dielectric: ", "\n", "DFT: ", vibro.dielectric.round(1)[0,0], "\tExperiment: 9.6")
Dielectric:  
 DFT:  8.4 	Experiment: 9.6
print("Born charges: ", "\n", "DFT: ", vibro.born_charges.round(2)[0,0,0], "\tExperiment: 2.14")
Born charges:  
 DFT:  2.14 	Experiment: 2.14
print("Non-linear optical susceptibility (pm/V): ", "\n", "DFT: ", vibro.nlo_susceptibility.round(0)[0,1,2], "\tExperiment: 64")
Non-linear optical susceptibility (pm/V):  
 DFT:  42.0 	Experiment: 64

4.4.1. Raman polarizability#

We can also obtain the Raman polarizability tensor, both for the TO and LO modes. We can only compare with other DFT results, cause there are no available experimental data.

Hide cell source
print("TO Raman polarizability tensor (Angstrom^2): ", "\n", "DFT: ", (vibro.raman_tensors[1,0,1,2]*vol).round(2), "\tVeithen et al. (2005): 8.48")
TO Raman polarizability tensor (Angstrom^2):  
 DFT:  6.39 	Veithen et al. (2005): 8.48

4.5. Analysing the workflow#

Many things happened for computing this phonon band structure. Let’s inspect the process tree.

%verdi process status {calc.pk}
HarmonicWorkChain<109> Finished [0] [4:if_(should_run_phonopy)(1:inspect_phonopy)]
    ├── generate_preprocess_data<110> Finished [0]
    ├── PhononWorkChain<115> Finished [0] [7:if_(should_run_phonopy)]
    │   ├── generate_preprocess_data<120> Finished [0]
    │   ├── get_supercell<133> Finished [0]
    │   ├── create_kpoints_from_distance<138> Finished [0]
    │   ├── PwBaseWorkChain<141> Finished [0] [3:results]
    │   │   └── PwCalculation<144> Finished [0]
    │   ├── get_supercells_with_displacements<155> Finished [0]
    │   ├── PwBaseWorkChain<162> Finished [0] [3:results]
    │   │   └── PwCalculation<170> Finished [0]
    │   ├── PwBaseWorkChain<164> Finished [0] [3:results]
    │   │   └── PwCalculation<173> Finished [0]
    │   └── generate_phonopy_data<208> Finished [0]
    ├── DielectricWorkChain<119> Finished [0] [11:results]
    │   ├── create_kpoints_from_distance<121> Finished [0]
    │   ├── create_directional_kpoints<125> Finished [0]
    │   ├── create_directional_kpoints<128> Finished [0]
    │   ├── PwBaseWorkChain<132> Finished [0] [3:results]
    │   │   └── PwCalculation<136> Finished [0]
    │   ├── PwBaseWorkChain<158> Finished [0] [3:results]
    │   │   └── PwCalculation<167> Finished [0]
    │   ├── compute_critical_electric_field<181> Finished [0]
    │   ├── get_accuracy_from_critical_field<183> Finished [0]
    │   ├── get_electric_field_step<185> Finished [0]
    │   ├── PwBaseWorkChain<189> Finished [0] [3:results]
    │   │   └── PwCalculation<193> Finished [0]
    │   ├── PwBaseWorkChain<190> Finished [0] [3:results]
    │   │   └── PwCalculation<196> Finished [0]
    │   ├── PwBaseWorkChain<220> Finished [0] [3:results]
    │   │   └── PwCalculation<226> Finished [0]
    │   ├── PwBaseWorkChain<223> Finished [0] [3:results]
    │   │   └── PwCalculation<229> Finished [0]
    │   ├── PwBaseWorkChain<242> Finished [0] [3:results]
    │   │   └── PwCalculation<248> Finished [0]
    │   ├── PwBaseWorkChain<245> Finished [0] [3:results]
    │   │   └── PwCalculation<251> Finished [0]
    │   ├── subtract_residual_forces<264> Finished [0]
    │   └── NumericalDerivativesWorkChain<269> Finished [0] [None]
    │       ├── generate_preprocess_data<270> Finished [0]
    │       ├── compute_nac_parameters<272> Finished [0]
    │       ├── compute_susceptibility_derivatives<276> Finished [0]
    │       ├── join_tensors<281> Finished [0]
    │       ├── join_tensors<283> Finished [0]
    │       └── join_tensors<285> Finished [0]
    ├── elaborate_tensors<287> Finished [0]
    ├── generate_vibrational_data_from_phonopy<289> Finished [0]
    ├── elaborate_tensors<291> Finished [0]
    ├── generate_vibrational_data_from_phonopy<293> Finished [0]
    ├── elaborate_tensors<295> Finished [0]
    ├── generate_vibrational_data_from_phonopy<297> Finished [0]
    └── PhonopyCalculation<299> Finished [0]