class clifford.BasisVectorIds(blade_ids: Sequence[IdT])[source]

Stores ids for the ordered set of basis vectors, typically integers.

Provides helpers to convert between bitmaps indicating which vectors are present in a blade, and tuples of the original ids.

For example:

>>> ids = BasisVectorIds([11, 22, 33])
>>> ids.bitmap_as_tuple(0b110)
(22, 33)
>>> sign, bitmap = ids.tuple_as_sign_and_bitmap((33, 22))
>>> assert sign, bitmap == (-1, 0b110)
bitmap_as_tuple(bitmap: int) → Tuple[IdT][source]

Convert a bitmap representation into a tuple of ids.

id_as_bitmap(id: IdT)int[source]

Convert the id of a single vector into a bitmap representation.

tuple_as_sign_and_bitmap(blade: Tuple[IdT]) → Tuple[int, int][source]

Convert a blade from a tuple of ids into a bitmap representation.

order_from_tuples(blades: Sequence[Tuple[IdT]]) → clifford._layout_helpers.BasisBladeOrder[source]

Produce an ordering from a set of tuples.

This is the inverse of order_as_tuples().

>>> ids = BasisVectorIds(['x', 'y'])
>>> ids.order_from_tuples([(), ('y',), ('x', 'y'), ('x',)])
BasisBladeOrder([0b00, 0b10, 0b11, 0b01])
order_as_tuples(ordering: clifford._layout_helpers.BasisBladeOrder) → List[Tuple[IdT]][source]

Represent an ordering with these ids.

This is the inverse of order_from_tuples().

>>> ids = BasisVectorIds(['x', 'y'])
>>> ids.order_as_tuples(BasisBladeOrder([0b00, 0b10, 0b11, 0b01]))
[(), ('y',), ('x', 'y'), ('x',)]
classmethod ordered_integers(n: int, *, first_index: int = 1) → clifford._layout_helpers.BasisVectorIds[int][source]

Create a set of n sequential integers as ids, starting from first_index.

augmented_with(n: int) → clifford._layout_helpers.BasisVectorIds[source]

Return a new copy with n new ids at the end.