Class Lattice
Class Lattice¶
- class py_alf.Lattice(*args, init_version=1)¶
Finite size Bravais lattice object.
- Parameters
- *argsdict, tuple, or list
if dict: {‘L1’: L1, ‘L2’: L2, ‘a1’: a1, ‘a2’: a2}.
if tuple or list: [L1, L2, a1, a2].
L1, L2: 2d vector defining periodic boundary conditions.
a1, a2: 2d primitive vectors.
- init_versionint, default=1
init_version=0 uses compiled Fortran, which is faster but not supported right now.
- fourier_K_to_R(X)¶
Fourier transform from k to r space.
Last index of input has to run over all lattice points in k space.
Last index of output runs over all lattice points in r space.
- fourier_R_to_K(X)¶
Fourier transform from r to k space.
Last index of input has to run over all lattice points in r space.
Last index of output runs over all lattice points in k space.
- k_to_n(k)¶
Map vector in k space to integer running over all lattice points.
- periodic_boundary_k(k)¶
Apply periodic boundary conditions on vector in k space.
- periodic_boundary_r(r)¶
Apply periodic boundary conditions on vector in r space.
- plot_k(data)¶
Plot data in k space.
- Parameters
- dataiterable
Index corresponds to coordinates.
- plot_r(data)¶
Plot data in r space.
- Parameters
- dataiterable
Index corresponds to coordinates.
- r_to_n(r)¶
Map vector in r space to integer running over all lattice points.
- rotate(n, theta)¶
Rotate vector in k space.
- Parameters
- nint
Index corresponding to input vector.
- thetafloat
Angle of rotation.
- Returns
- int
Index corresponding to output vector.