Interaction matrix

Charge_charge

Generate charge_charge interaction matrix.

class charge_charge.Charge_charge(n1, n2, nz, lattice)[source]

Charge_charge inherits the Supercell class, it first initializes the supercell it works on.

Parameters:
  • n1 – Number of unit cells along the first Bravais vector of ‘lattice’.
  • n2 – Number of unit cells along the second Bravais vector of ‘lattice’.
  • nz – Number of unit cells along the third Bravais vector of ‘lattice’.
  • lattice – The lattice of the unit cell, not the supercell.
generate_charge_matrix()[source]

This is the core of the interaction matrix calculation. ‘cc_set_parameters’ and ‘cc_sum_over_k’ are defined in ‘ewald_cc.cpp’ using PyBind11.

‘cc_sum_over_k’ is to sum over the k space, the long range part.

Returns:nothing.
write_charge_matrix(fn)[source]

Write the calculated interaction matrix to a netcdf file for later us.

Parameters:fn – The name of the netcdf file.
Returns:Nothing.

Dipole_dipole and others

Generate dipole-dipole, charge-dipole, and charge-displacement matrices. The structure of these programs are similar to that of charge-charge.

class dipole_dipole.Dip_dip(n1, n2, nz, lattice)[source]

The parameters are similar to that of ‘charge-charge’.

class charge_dipole.Charge_dipole(n1, n2, nz, lattice)[source]
Generate charge-dipole interaction matrix. The parameters are similar to that of ‘charge-charge’.

Note

To avoid the directly ovelap between charges and dipoles, charges had been shift by (0.5,0.5,0.5) (relative coordinate) with respect to the origin of each unit cell, where the dipole stays. Therefore, the indexing in the generated ‘netcdf’ matrix is different from the others.

class charge_displacement.Charge_displacement(n1, n2, nz, lattice)[source]
The parameters are similar to that of ‘charge-charge’.

Note

Reuse “ewald_dd.cpp” because of the similarity.