cuequivariance.segmented_tensor_product.Operand

class cuequivariance.segmented_tensor_product.Operand(*, subscripts: Subscripts, segments: list[tuple[int, ...]] | None = None, _dims: dict[str, set[int]] | None = None)

A tensor product operand. It is a list of segments and subscripts.

__init__(*, subscripts: Subscripts, segments: list[tuple[int, ...]] | None = None, _dims: dict[str, set[int]] | None = None)

Methods

__init__(*, subscripts[, segments, _dims])

add_segment(segment)

Add a segment to the operand.

all_same_segment_shape()

Check if all segments have the same shape.

assert_valid()

Assert that the operand is valid.

empty_segments(num_segments)

Create an operand with empty subscripts

get_dimensions_dict()

Return a dictionary of dimensions for each channel.

get_dims(m)

Return the dimensions for a given channel.

get_segment_shape(dims, *[, default])

Return the shape of a potential segment.

insert_segment(index, segment)

Insert a segment at a given index.

segment_slices()

Return slice object for each segment.

transpose_modes(subscripts)

Transpose the channels of the operand.

Attributes

ndim

The number of segment dimensions.

num_segments

The number of segments in the operand.

segment_shape

The shape of the segments if they are all the same.

segment_size

The size of the segments if they are all the same.

segments

The segments of the operand.

size

The total size of the operand.

subscripts