How can I explicitly express the Ising Hamiltonian in matrix form? I am reading this book about numerical methods in physics. It has the following question:

Consider the Ising Hamiltonian defined as following $$H=-\sum_ {i=1}^{N-1} 
\sigma_i^x \sigma_ {i+1} ^x + h \sum_ {i=1} ^N \sigma_i^z$$
Write a program that computes the $2^N \times 2^N$ matrix for
  different $N$

From quantum mechanics, I know that any operator can be expressed in matrix form as follows
$$H_{rs}\dot{=}\langle r |H|s\rangle$$
where $|i\rangle$ are any basis.
My question is what basis can I take for this Hamiltonian? Is there any other way to write this Hamiltonian in matrix form?
 A: For completeness I'll summarize the answer here. After a fun conversation in the comments, we saw that it will be more illuminating to write 
$$H=-\sum_ {i=1}^{N-1} 
\sigma_i^x \sigma_ {i+1} ^x + h \sum_ {i=1} ^N \sigma_i^z $$
as 
$$ H=-\sum_ {i=1}^{N-1} 
\sigma_i^x  \sigma_ {i+1} ^x + h\left( \sum_ {i=1} ^{N-1} 1_1 \otimes \cdots 1_{i-1} \otimes \sigma_i^z \otimes 1_{i+1} \otimes \cdots \otimes 1_{N-1} \right)
+ h ( 1_1 \otimes \cdots \otimes 1_{N-1} \otimes \sigma^z_N) $$
where it is understood that (to prevent clutter) 
$$ \sigma_i^x  \sigma_{i+1}^x = 1_1 \otimes \cdots\otimes 1_{i-1} \otimes \sigma^x_i \otimes \sigma^x_{i+1} \otimes 1_{i+2} \otimes \cdots \otimes 1_{N} $$
and the subscripts are there to denote nothing more than the position of insertion (i.e. they are all $2\times 2$ identity) 
We then create a matrix from the direct product of matrices $A,B$ where $[A] = m \times n$  and $[B] = p \times q$ matrices
$$ \mathbf {A} \otimes \mathbf {B} ={\begin{bmatrix}a_{11}\mathbf {B} &\cdots &a_{1n}\mathbf {B} \\\vdots &\ddots &\vdots \\a_{m1}\mathbf {B} &\cdots &a_{mn}\mathbf {B} \end{bmatrix}}. $$
We apply this to the $i^{th}$ term and then loop over all $i$ to achieve the desired matrix.
A: $\textbf{Quick hint :}$
Interpret spin operators (for chain of length-N) this way (spin operators act on tensor product space) :
$$\sigma_{i}^{\alpha} \rightarrow\underset{N_{}^{\text{th}}\text{order direct/kronecker product of identity and pauli matrices}}{\mathbb{I}_{}^{}\otimes\cdots\otimes\underset{i_{}^{\text{th}} \text{position}}{\sigma_{}^{\alpha}}\otimes\cdots\otimes\mathbb{I}_{}^{}}$$
which makes (for $i < j$):
$$\sigma_{i}^{\alpha}\sigma_{j}^{\beta} \stackrel{i < j}{\rightarrow} \mathbb{I}_{}^{}\otimes\cdots\otimes\underset{i_{}^{\text{th}} \text{position}}{\sigma_{}^{\alpha}}\otimes\cdots\otimes\underset{j_{}^{\text{th}} \text{position}}{\sigma_{}^{\beta}}\otimes \cdots\otimes\mathbb{I}_{}^{}$$
with standard definition of direct/Kronecker product of matrices 
Note also that Kronecker product is associative. 
$\mathbb{I}$ is $2 \times 2$ identity matrix and $\sigma_{}^{}$'s are standard Pauli matrices.
