File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 11import re
22import numpy
33import sympy
4+ import functools
5+
6+ from collections import defaultdict
47
58from lips .tools import flatten
69from lips .algebraic_geometry .tools import lips_covariant_symbols , lips_invariant_symbols , conversionIdeal
@@ -76,6 +79,16 @@ def image(self, rule):
7679 newIdeal .rule = rule
7780 return newIdeal
7881
82+ @functools .cached_property
83+ def equivalenceClass (self ):
84+ from ..symmetries import all_symmetries
85+ all_perms_self = {symmetry : self (* symmetry ) for symmetry in all_symmetries (self .multiplicity )}
86+ value_to_keys = defaultdict (list )
87+ for k , v in all_perms_self .items ():
88+ value_to_keys [v ].append (k )
89+ distinct_perms_self = {keys [0 ]: val for val , keys in value_to_keys .items ()}
90+ return distinct_perms_self
91+
7992 def to_mom_cons_qring (self ):
8093 oZeroIdeal = LipsIdeal (self .multiplicity , ())
8194 self .to_qring (oZeroIdeal )
Original file line number Diff line number Diff line change @@ -29,3 +29,7 @@ def inverse(permutation_or_symmetry):
2929
3030def identity (n ):
3131 return ('' .join (str (i ) for i in range (1 , n + 1 )), False )
32+
33+
34+ def all_symmetries (multiplicity ):
35+ return phase_weights_compatible_symmetries ([0 ] * multiplicity )
You can’t perform that action at this time.
0 commit comments