Changeset b45eec in git for Singular/dyn_modules/python/symm.py
- Timestamp:
- Apr 19, 2020, 9:57:14 PM (4 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- ffcf715a570941627bf020648e93955f1596f2ef
- Parents:
- d49a473d44aa25c5ecc3126360ab3179ddb8af7e636fa5455e699fa8c0a820dd60e00a059f96f8ef
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/dyn_modules/python/symm.py
rd49a47 rb45eec 1 1 from probstat import Cartesian 2 from itertools import repeat ,imap, ifilter2 from itertools import repeat 3 3 from util import EquivalenceRelation 4 4 from interpreter import * … … 28 28 29 29 colors=3 30 value_range=[modPNumber(i,colors) for i in xrange(colors)]30 value_range=[modPNumber(i,colors) for i in range(colors)] 31 31 32 32 wrel=EquivalenceRelation() … … 34 34 wrel[i]=-i 35 35 weights_canonical_to_index=dict((weight,i+1) \ 36 for (i,weight) in enumerate( ifilter( \36 for (i,weight) in enumerate(filter( \ 37 37 wrel.isCanonical,value_range))) 38 38 wtrans=dict((weight,weights_canonical_to_index[wrel.canonical(weight)]) for weight in \ … … 42 42 43 43 def constr_variations(): 44 return imap(tuple,Cartesian(list(repeat(value_range,6))))44 return list(map(tuple,Cartesian(list(repeat(value_range,6))))) 45 45 relation=EquivalenceRelation() 46 46 for (a,b,c,d,e,f) in constr_variations(): … … 48 48 relation[(a,b,c,d,e,f)]=(a,-d,-e,-b,-c,-f) 49 49 canonical_to_index=dict((symbol,weights+i+1) for (i,symbol) in \ 50 enumerate( ifilter( \50 enumerate(filter( \ 51 51 relation.isCanonical,constr_variations()))) 52 52 vartrans=dict((symbol,canonical_to_index[relation.canonical(symbol)]) for symbol in \ … … 63 63 r=create_ring(char=0,nvars=weights+symbols) 64 64 r.set() 65 print r65 print(r) 66 66 myideal=Ideal() 67 67 def polysum(l): … … 90 90 back_table_joint=dict(back_table_v) 91 91 back_table_joint.update(back_table_w) 92 print "back", back_table_joint93 print "original length",len(myideal)94 print "now calculating"92 print(("back", back_table_joint)) 93 print(("original length",len(myideal))) 94 print("now calculating") 95 95 myideal=singular.simplify(myideal,4) 96 print "simplified", len(myideal)96 print(("simplified", len(myideal))) 97 97 gb=singular.slimgb(myideal) 98 print gb99 print len(gb), "GB elements"98 print(gb) 99 print((len(gb), "GB elements"))
Note: See TracChangeset
for help on using the changeset viewer.