shapes.ShapeMap

class rewalt.shapes.ShapeMap(ogmap, **params)

Bases: OgMap

An overlay of ogposets.OgMap for total maps between Shape objects.

It is used to extend constructions of shapes functorially to their maps, in a way that is compatible with the unique representation of shapes by their underlying ogposets.OgPoset objects.

The most common ShapeMap objects are created by methods of Shape such as Shape.boundary() and Shape.inflate(), or of its subclasses, such as Simplex.simplex_degeneracy() or Cube.cube_connection().

Nevertheless, occasionally we may need to define a map explicitly, in which case we first define an object f of class ogposets.OgMap, then upgrade it to a ShapeMap with the constructor ShapeMap(f).

Parameters

ogmap (ogposets.OgMap) – A total map between shapes.

Keyword Arguments

wfcheck (bool) – Check whether the given map is a total map between shapes (default is True).

Methods

draw(**params)

Bound version of strdiags.draw().

draw_boundaries(**params)

Bound version of strdiags.draw_boundaries().

dual(*dims)

Functorial extension of OgPoset.dual() to maps of oriented graded posets.

generate_layering()

Shorthand for source.generate_layering().

gray(*maps)

Functorial extension of OgPoset.gray() to maps of oriented graded posets.

join(*maps)

Functorial extension of OgPoset.join() to maps of oriented graded posets.

then(other, *others)

Returns the composite with other maps or pairs of maps of oriented graded posets, when defined.

Attributes

layers

Returns the current layering of the map's source, composed with the map.

rewrite_steps

Returns the sequence of rewrite steps associated to the current layering of the map's source, composed with the map.

then(other, *others)

Returns the composite with other maps or pairs of maps of oriented graded posets, when defined.

If given an OgMapPair as argument, it returns the pair of composites of the map with each map in the pair.

Parameters
  • other (OgMap | OgMapPair) – The first map or pair of maps to follow.

  • *others (OgMap | OgMapPair, optional) – Any number of other maps or pair of maps to follow.

Returns

composite – The composite with all the other arguments.

Return type

OgMap | OgMapPair

Notes

If all the maps have type shapes.ShapeMap, their composite has the same type.

property layers

Returns the current layering of the map’s source, composed with the map.

Returns

layers – The source’s current layering, composed with the map.

Return type

list[ShapeMap]

property rewrite_steps

Returns the sequence of rewrite steps associated to the current layering of the map’s source, composed with the map.

Returns

rewrite_steps – The source’s current sequence of rewrite steps, composed with the map.

Return type

list[ShapeMap]

static gray(*maps)

Functorial extension of OgPoset.gray() to maps of oriented graded posets.

This method can be called with the math operator *, that is, fst * snd is equivalent to gray(fst, snd).

This static method can also be used as a bound method, that is, fst.gray(*maps) is equivalent to gray(fst, *maps).

Parameters

*maps (OgMap) – Any number of maps of oriented graded posets.

Returns

gray – The Gray product of the arguments.

Return type

OgMap

Notes

If all the arguments have type shapes.ShapeMap, so does their Gray product.

static join(*maps)

Functorial extension of OgPoset.join() to maps of oriented graded posets.

This method can be called with the shift operators >> and <<, that is, fst >> snd is equivalent to join(fst, snd) and fst << snd is equivalent to join(snd, fst).

This static method can also be used as a bound method, that is, fst.join(*maps) is equivalent to join(fst, *maps).

Parameters

*maps (OgMap) – Any number of maps of oriented graded posets.

Returns

join – The join of the arguments.

Return type

OgMap

Notes

If all the arguments have type shapes.ShapeMap, so does their join.

dual(*dims)

Functorial extension of OgPoset.dual() to maps of oriented graded posets.

The dual in all dimensions can also be called with the negation operator ~, that is, ~ogmap is equivalent to ogmap.dual().

This static method can be also used as a bound method, that is, self.dual(*dims) is equivalent to dual(self, *dims).

Parameters
  • ogmap (OgMap) – A map of oriented graded posets.

  • *dims (int) – Any number of dimensions; if none, defaults to all dimensions.

Returns

dual – The map dualised in the given dimensions.

Return type

OgMap

Notes

If the map is a ShapeMap, so is its dual.

generate_layering()

Shorthand for source.generate_layering().

draw(**params)

Bound version of strdiags.draw().

Calling f.draw(**params) is equivalent to calling strdiags.draw(f, **params).

draw_boundaries(**params)

Bound version of strdiags.draw_boundaries().

Calling f.draw_boundaries(**params) is equivalent to calling strdiags.draw_boundaries(f, **params).