I think the issue is that between versions 7.2 and 7.3, Sage changed the way n_faces is implemented. If you care about the ordering of the results, use n_cells instead. That's what you should do here, because n_cells uses an ordering consistent with that of the matrices defining the chain complex. I think the fact that it worked before was a lucky accident -- the ordering in the output from n_faces was essentially random in 7.2 (since n_faces returns a set), but your code happened to work: I think the old Sage code used the same essentially random ordering when constructing the chain complex, whereas the new code is more careful to order things in a well-defined way and to always use that ordering.