Macaulay2 » Documentation
Packages » Matroids :: Matroid ++ Matroid
next | previous | forward | backward | up | index | toc

# Matroid ++ Matroid -- direct sum of matroids

- Operator: ++
- Usage:
    `M ++ N`
- Inputs:
  - M, a matroid,
  - N, a matroid,
- Outputs:
  - a matroid, the direct sum of M and N

## Description

The direct sum of M and N is a matroid with ground set equal to the disjoint union of the ground sets of M and N, and bases equal to the union of bases of M and N.

    i1 : S = uniformMatroid(2,3) ++ uniformMatroid(1,3)

    o1 = a "matroid" of rank 3 on 6 elements

    o1 : Matroid

    i2 : peek S

    o2 = Matroid{bases => {set {0, 1, 3}, set {4, 0, 1}, set {0, 5, 1}, set {0, 2, 3}, set {4, 0, 2}, set {0, 5, 2}, set {1, 2, 3}, set {4, 1, 2}, set {5, 1, 2}}}
                 cache => CacheTable{...1...}
                 groundSet => set {0, 1, 2, 3, 4, 5}
                 rank => 3

    i3 : S_*

    o3 = {(0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1)}

    o3 : List

    i4 : (S ++ uniformMatroid(1, 3))_*

    o4 = {((0, 0), 0), ((1, 0), 0), ((2, 0), 0), ((0, 1), 0), ((1, 1), 0), ((2,
         ------------------------------------------------------------------------
         1), 0), (0, 1), (1, 1), (2, 1)}

    o4 : List

## Caveat

The elements of the ground set of the direct sum will receive placeholders to ensure disjointness (as evidenced by the elements of S being ordered pairs above). As this method is binary, repeated applications of this function will result in nested placeholders. Since the bases are stored as indices, the bases of M will not change, but those of N will be shifted up by the size of the ground set of M.

## See also

- Matroid + Matroid -- union of matroids
- components(Matroid) -- connected components of matroid

## Ways to use this method:

- Matroid ++ Matroid -- direct sum of matroids

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Matroids/doc-Matroids.m2:1744:0.