Add test for boundary state and initial state.
Implement the computation of D1 and D2 matries.