minor cleanup. use shape of underlaying data only if data is set, otherwise fall back on computing shape from dims
make sure that Qobj.shape returns a list rather than tuple