3.4. Class Lattice#

class py_alf.Lattice(*args, force_python_init=False)#

Finite size Bravais lattice object, mirroring ALF’s Lattice type.

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 vectors defining periodic boundary conditions.

a1, a2: 2d primitive vectors.

force_python_initbool, default=False

Force the usage of Python version of the initialization. Default behavior is to first try compiled Fortran and fall back to Python if that fails.

Attributes:
L1, L2arrays of floats

2d vectors defining periodic boundary conditions in real space.

a1, a2arrays of floats

2d primitive vectors in real space.

BZ1, BZ2arrays of floats

2d vectors defining periodic boundary conditions in k space.

b1, b2arrays of floats

2d primitive vectors in k space.

Nint

Number of unit cells

rarray of floats, shape=(N, 2)

Real-space coordinates.

karray of floats, shape=(N, 2)

K-space coordinates.

b1_perparray, shape=(2,)
b2_perparray, shape=(2,)
Lint
listrarray of ints, shape=(N, 2)

r[i] = listr[i, 0]*a1 + listr[i, 1]*a2

listkarray of ints, shape=(N, 2)

k[i] = listk[i, 0]*a1 + listk[i, 1]*b2

invlistrarray of ints, shape=(2*L+1, 2*L+1)
invlistkarray of ints, shape=(2*L+1, 2*L+1)
nnlistrarray of ints, shape=(N, 3, 3)
nnlistkarray of ints, shape=(N, 3, 3)
imjarray of ints, shape=(N, N)
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.

\(\phantom{\xi}\)