Most of the changes have to do with the circuit_sim_sparse and the linear helper in order to support sparse arrays