3D fourier series I wonder how I can write a function $f(\textbf{r})$ as a fourier series, when $f$ is periodic, in the sense that there exists a $ \textbf{T}_i \neq \textbf{0} $ so that $f(\textbf{r} + \textbf{T}_i) = f(\textbf{r})$, for $i = 1,2,3$. Where the vectors $T_i$ are linear independent, but not necessarily perpendicular. 
I find in the literature that this is possible: $f(\textbf{r}) = \sum_{\textbf{G}}n_{\textbf{G}}exp(i\textbf{G}\cdot\textbf{r})$, but it is not clear over what vector $\textbf{G}$ I have to take the sum. It is also not very clear how to obtain the $n_\textbf{G}$. It seems to be really difficult to find a reference that explains this, so I hope someone can clarify this.
 A: The key terms are lattice and dual lattice. You have a lattice $L$ formed by all linear combinations of $T_i$ with integer coefficients: $L=\{a\mathbf T_1+b\mathbf T_2+c\mathbf T_3 : a,b,c\in\mathbb Z\}$. The dual lattice $L^*$ is defined as 
$$L^*= \{\mathbf v\in\mathbb R^3 : \mathbf v\cdot \mathbf w\in\mathbb Z \text{ for all }\mathbf w\in L\} \tag1$$ 
The relevance of $L^*$ to your problem becomes clear when you realize that (1) is exactly what is needed for the function $\mathbf r\mapsto \exp(i \mathbf v\cdot \mathbf r)$ to be periodic with  respect to $L$. So, the Fourier series for an $L$-periodic function $f$ has the form
$$f(\mathbf r) = \sum_{\mathbf v\in L^*} n_{\mathbf v} \exp(i \mathbf v\cdot \mathbf r) \tag2$$
Let $D$ be a fundamental domain (typically a parallelepiped) for the lattice $L$. 
The exponential functions for different vectors $\mathbf v,\mathbf v'\in L^*$  are orthogonal in $\mathscr L^2(D)$: 
$$\int_D \exp(i \mathbf v\cdot \mathbf r) \exp(-i \mathbf v'\cdot \mathbf r)
=\int_D \exp(i (\mathbf v-\mathbf v')\cdot \mathbf r) =0$$
So, we can find $n_\mathbf v$ by integrating (2) against $\exp(-i \mathbf v\cdot \mathbf r) $:
$$\int_D f(\mathbf r)\exp(-i \mathbf v\cdot \mathbf r)\,d\mathbf r = \int_D n_{\mathbf v} = n_{\mathbf v}\,\mathrm{vol}\,D $$
The volume of $D$ is the determinant of the linear map that sends the standard basis vectors $\mathbf e_i$ to $\mathbf T_i$. It is called the determinant of the lattice, $\det L$. Thus, 
$$n_{\mathbf v} = \frac{1}{\det L}\int_D f(\mathbf r)\exp(-i \mathbf v\cdot \mathbf r)\,d\mathbf r \tag3$$

In practical terms, you find $L^*$ as follows: let $B$ be the linear map associated to $L$ as above; then the adjoint-of-inverse map $(B^{-1})^T$ sends $\mathbf e_i$ to the generators of $L^*$. This works because
$$\mathbf T_i \cdot (B^{-1})^T\mathbf e_j = B^{-1}\mathbf T_i \cdot \mathbf e_j =\mathbf e_i \cdot \mathbf e_j = \delta_{ij} $$

Some lecture notes
