Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fingolfin opened this issue Oct 4, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@fingolfin
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants