initial work on GRAPE implementation

Work in progress. Goals: 

 * Implement GRAPE for unitary and dissipative dynamics
 * Implement time-optimal gate pulses.