Wrote code that gets access to compute_optimization_matrix.
Added computeOptimizationMatrix method to BaseChain.
More work in progress.