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

# relabel -- relabel a matroid

- Usage:
    `relabel(M, H)`
    `relabel(M, L)`
    `relabel M`
- Inputs:
  - M, a matroid,
  - H, a hash table,
  - L, a list,
- Outputs:
  - a matroid, a matroid isomorphic to M

## Description

This method yields another matroid isomorphic to the input matroid M with labels specified by a hash table, or list of options. The keys of the hash table should be (a subset of) $\{0, ..., n-1\}$ where n is the number of elements in the groundSet of M. Since any unused elements are assumed to remain unchanged, the set of values should coincide with the set of keys.

Alternatively, the images of $\{0, ..., n-1\}$ (in order) can be specified (as a list, whose elements are not options). If neither a list nor hash table is provided, then a random permutation is chosen.

    i1 : Q6 = specificMatroid "Q6"

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

    o1 : Matroid

    i2 : M = relabel_Q6 {3 => 0, 0 => 3}

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

    o2 : Matroid

    i3 : (nonbases Q6, nonbases M)

    o3 = ({set {0, 1, 2}, set {4, 0, 3}}, {set {1, 2, 3}, set {4, 0, 3}})

    o3 : Sequence

    i4 : (M == Q6, areIsomorphic(M, Q6))

    o4 = (false, true)

    o4 : Sequence

    i5 : nonbases relabel Q6

    o5 = {set {0, 5, 3}, set {4, 5, 1}}

    o5 : List

## See also

- isomorphism(Matroid,Matroid) -- computes an isomorphism between isomorphic matroids
- areIsomorphic(Matroid,Matroid) -- whether two matroids are isomorphic

## Ways to use relabel:

- `relabel(Matroid)`
- `relabel(Matroid,HashTable)`
- `relabel(Matroid,List)`

## For the programmer

The object relabel is a method function.

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