### Introduction

This section describes classes for electronic structure analysis.
The basic class is the `ElectronicStates` class described below.

### ElectronicStates class

The class `ElectronicStates` are a python list of ElectronicState
objects.

Additional methods defined to describe the collection of electronic states:

`ReadFromFile``- The generic
`ElectronicStates`class can read from a NetCDF format (equal to the GPAW netCDF restart file). A specific calculator can overload this methods to be able to read a specific format. Examples of this is given in STMTool. `Get/SetSpace`- Typically the unitcell
`Set/SetNumberOfKPoints`- Number of different kpoint in the list
`Get/SetNumberOfSpins`- Number of different spins in the list
`Get/SetNumberOfBands`- Number of different bands for each spin and kpoint.
`Get/SetFermiLevel`- The fermi level for the calculation.

#### Calculator methods relating to the `ElectronicStates` class

The calculator could implement these methods:

`GetElectronicStates``- Return a
`ElectronicStates`object. This method could at some point replace the DFT calculator interface methods,`GetIBZKPoints`,`GetEigenValues`,`GetWaveFunctions`, etc. `GetWannierLocalizationMatrix()`- Return the localixation matrix for doing maximally localized wannier functions the given set of electronic states. For a detailed description see <Analysis#maximally localized wannier functions>`.
`GetHamiltonianMatrix(electronicstates)`- Return the Hamiltonian matrix for the given set of electronic states.

### ElectronicState(Grid)

The class `ElectronicState` (derived from a Grid class) describes a
single electronic state.

It is assumed that the Grid class holds
the wave function, i.e. the Bloch function for the state,
multiplied by the phase factor **exp(ikx)**.

Two representations for the state are available via the
`ElectronicState` class.
A compact representation via the methods Get/SetWaveFunction,
and a real space representation. For this latter representation
the Grid class handle the 3 dimensional grid information.

For the generic version of `ElectronicState` the
two methods GetWaveFunction and GetArray will be identical.

For a code with a different internal representation, like a pseudopotential planewave code, it is natural that the internal representation is the reciprocal planewave expansion coefficients.

In addition to the method from the `Grid` class described below,
the `ElectronicState` class has the following methods to define
a electronic states (which could be a eigenstate):

`Get/SetKPoint`- Define the kpoint
`Get/SetEigenValue`- Define the eigenvalue
`Get/SetSpin`- Define the spin
`Get/SetOccupationNumber`- Define the occupation number, 0:2 for a paramagnetic calculation, 0:1 for a magnetic caculation.
`Get/SetKPointWeight`- Symmetry weight on the kpoint.
`GetWaveFunctionOnGrid`- Same as GetArray, see the
`Grid`class below. A non real space program will here implement a method to represent the wavefunction on a real space grid. `GetWaveFunction`- Same as GetArray, a not real space program will here return its reciprocal space representation.

#### Grid class

A grid represents a collection of values defined in an 'N' -dimensional space. A single value of the collection then represents the grid at a discrete position having coordinates given in terms of the space. The values may be scalars but can in general have any number of components.

The following methods should always be available:

`Get/SetSpace`- Returns the space in which the grid is defined.
`Get/SetArray`- Returns an array representing the collection of values.
`Get/SetOrigin`- Returns the origin of the grid.
`GetCartesianCoordinates`- Returns an array with the cartesian coordinates of the discrete points at which the collection of points are defined.