-
Notifications
You must be signed in to change notification settings - Fork 4
Description
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.