This function returns the 2sum of two given matroids M and N (cf. Oxley, Section 7.1).
It is always assumed that the common basepoint of M and N is the first element in the respective ground sets, i.e. the element with index 0. (To form a 2sum using a different basepoint, one can first relabel M and/or N.) Moreover, it is necessary that the basepoint 0 is not a loop or coloop in either M or N. Under these assumptions, the 2sum of M and N is equal to the contraction of the seriesConnection of M and N by 0 (or alternatively, the deletion of the parallelConnection of M and N by 0).
The operation of 2sum is important in higher matroid connectivity: a connected matroid is 3connected iff it cannot be expressed as a 2sum of smaller matroids.



The object sum2 is a method function.