Skip to content

More convenient way to compute linear combinations of *irreducible* character types #214

@fingolfin

Description

@fingolfin

Right now one has to write e.g.

linear_combination([1,2,3], [T[4],T[4],T[5]])

It would be nice if one could instead write e.g.

T[4] + 2*T[4] + 3*T[5]

In the current setup this has various technical issues. There are multiple ways one could try to address them, but we just discussed the following simple potential solution: for each GenericCharacter instance, we could store an (optional) Vector{Vector{Int}} which describes the generic character as a linear combination of irreducibles. For the initial char types in the table, this could either be left undefined, and also for tensor products). But an implementation for + and scalar multiplication (as well as linear_combination itself) could use these to keep track of how often each character type was added and with which scalar.

Then implementing + becomes rather either: just iterate over the Vector{Vector{Int}} for each input and "join" them (if one or both inputs are irreducibles, just [ [], [], ... [1], [], ..., [] ] as their "vector"). For scalar multiplication, just multiply all the coefficients.
Then once that Vector{Vector{Int}} has been recomputed, it can be turned into input for the existing linear_combination function.

Of course this does not handle tensor product character types as input, but that is fine, as long as a helpful error is generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions