HILA
Loading...
Searching...
No Matches
Datatypes

List of datatypes offered by HILA

Standard types

The following types are the standard types supported by hila, also denoted by S.

  • int
  • int64_t
  • float
  • double
  • (long double?)

Basic types

Here n,m \( \in \mathbb{N}\), S is any standard type, and T includes S and Complex<S>. C++ or C standard complex types should not be used (not AVX vectorizable).

Special types

Parity :

enum with values EVEN, ODD, ALL; refers to parity of the site. Parity of site (x,y,z,t) is even if (x+y+z+t) is even, odd otherwise.

Direction:

Conceptually a unit vector with values ±e_x, ±e_y, ±e_z, ±e_t (if NDIM==4). Implemented as an enum class. Can be used to index arrays of size NDIM.

CoordinateVector:

Acts as a Coordinate Vector for indexing Field. All Vector algebra is well defined, since CoordinateVector inherits from Vector which inherits from Matrix

NOTE: See CoordinateVector_t

Example of CoordinateVector and Direction usage:

Defining a CoordinateVector and Direction:

Direction d = e_x
Direction
Enumerator for direction that assigns integer to direction to be interpreted as unit vector.
Definition coordinates.h:34

Direction objects act as unit vectors when cast to CoordinateVector. Additionally algebra acts as defined according to vector algebra:

v = d; // v = [1,0,0,0]
v += e_y - 3*d; // v = [-2,1,0,0]

CoordinateVectors can be assigned with initializer list, where indices of list are aligned with CoordinateVector dimensions. Unit vector form with Direction's is also given:

v = {0,1,-1,0}; // v = [0,1,-1,0]
v = e_y - e_z; // equivalent to {0,1,-1,0}

Simple operations like a dot product are defined:

int i = v.dot({1,2,3,4}); // dot product of 2 vectors, evaluates to -1

Since Direction is an enum it can be casted to int, but int cannot be assigned to it

int j = d; // ok
d = j; // ERROR: cannot assign int to Direction

The ++d operator is also defined for Direction where it increase the direction in order \( \{e_x,e_y,e_z,e_t\} \). While –d operator is not defined

++d; // e_x -> e_y
is_up_dir(d); // true if d is along positive x,y,z,t-dir.

These are only some of the examples of what the CoordinateVector and Direction objects are capable of. For all definitions see coordinates.h, CoordinateVector and Direction pages.