Interaction#

The interaction module contains functions for generating interaction matrices.

anisotropy(dx, dy, dz)[source]#

Easy axes components.

Parameters:
dx, dy, dz2d array

Separation distance vector.

Returns:
uxx, uyy, uzz, uyz, uxz, uxy2d array

Components of easy axes.

atom_pairs_distance(rx, ry, rz, nu, nv, nw, n_atm, A, tol=0.001)[source]#

Atom pairs.

Parameters:
rx, ry, rz1d array

Atomic positions.

nu, nv, nwint

Supercell size.

n_atmint

Number of unit cell atoms.

A2d array, 3x3

Real space crystal axis to Cartesian transformation matrix.

tolfloat, optional

Tolerance of distances for unique pairs. Default is 1e-3.

Returns:
dx, dy, dz1d array

Separation distance vector.

i, j1d array, int

Coordinate pairs.

inverse1d array, int

Indices of the unique pair distances array that reconstruct all pairs.

bonds(pair_info, u, v, w, A, tol=0.001)[source]#

Generate bond pairs.

Parameters:
pair_infodict

Pair information for constructing bonds.

u, v, w1d array

Fractional coordinates.

atm1d array, str

Atoms, ions, or isotopes.

A2d array, 3x3

Real space crystal axis to Cartesian transformation matrix.

tolfloat, optional

Tolerance of distances for unique pairs. The default is 1e-3.

Returns:
dx, dy, dz2d array

Separation distance vector.

img_i, img_j, img_k2d array, int

Indices of cell-pairs.

atm_ind2d array, int

Indices of atom-pairs.

pair_inv2d array, int

Indices of inverse-pairs.

pair_ind2d array, int

Indices of bond-pairs.

pair_trans2d array, int

Indices of transpose-pairs.

charge_charge_matrix(rx, ry, rz, nu, nv, nw, n_atm, A, B, R, tol=0.001)[source]#

Charge-charge matrix.

Parameters:
rx, ry, rz1d array

Atomic positions.

nu, nv, nwint

Supercell size.

n_atmint

Number of unit cell atoms.

A2d array, 3x3

Real space crystal axis to Cartesian transformation matrix.

B2d array, 3x3

Reciprocal-space crystal axis to Cartesian transformation matrix.

R2d array, 3x3

Rotation matrix between real and reciprocal-space Cartesian axes.

tolfloat, optional

Tolerance of distances for unique pairs. Default is 1e-3.

Returns:
Qij1d array

Charge-charge matrix. Array of size n*(n+1)//2.

charge_dipole_matrix(rx, ry, rz, nu, nv, nw, n_atm, A, B, R, tol=0.001)[source]#

Charge-dipole matrix.

Parameters:
rx, ry, rz1d array

Atomic positions.

nu, nv, nwint

Supercell size.

n_atmint

Number of unit cell atoms.

A2d array, 3x3

Real space crystal axis to Cartesian transformation matrix.

B2d array, 3x3

Reciprocal-space crystal axis to Cartesian transformation matrix.

R2d array, 3x3

Rotation matrix between real and reciprocal-space Cartesian axes.

tolfloat, optional

Tolerance of distances for unique pairs. Default is 1e-3.

Returns:
Qijk2d array

Charge-dipole matrix. Array of shape n*(n+1)//2 x3.

dipole_dipole_matrix(rx, ry, rz, nu, nv, nw, n_atm, A, B, R, tol=0.001)[source]#

Dipole-dipole matrix.

Parameters:
rx, ry, rz1d array

Atomic positions.

nu, nv, nwint

Supercell size.

n_atmint

Number of unit cell atoms.

A2d array, 3x3

Real space crystal axis to Cartesian transformation matrix.

B2d array, 3x3

Reciprocal-space crystal axis to Cartesian transformation matrix.

R2d array, 3x3

Rotation matrix between real and reciprocal-space Cartesian axes.

tolfloat, optional

Tolerance of distances for unique pairs. Default is 1e-3.

Returns:
Qijkl2d array,

Dipole-dipole matrix. Array of shape n*(n+1)//2 x6.

pairs(u, v, w, atm, A, extend=False)[source]#

Generate pairs.

Parameters:
u, v, w1d array

Fractional coordinates.

atm1d array, str

Atoms, ions, or isotopes.

A2d array, 3x3

Real space crystal axis to Cartesian transformation matrix.

extendbool, optional

Extend beyond one unit cell. The default is False.

Returns:
pair_infodict

Pair information for constructing bonds.

spatial_wavevector(nu, nv, nw, n_atm, B, R)[source]#

Spatial wavevector.

Parameters:
nu, nv, nwint

Supercell size.

n_atmint

Number of unit cell atoms.

B2d array, 3x3

Reciprocal-space crystal axis to Cartesian transformation matrix.

R2d array, 3x3

Rotation matrix between real and reciprocal-space Cartesian axes.

Returns:
Gx, Gy, Gz1d array

Wavevector components.