Opened 7 years ago
Closed 6 years ago
#16271 closed enhancement (fixed)
Support the generic Steenrod algebra at the prime 2
Reported by:  cnassau  Owned by:  

Priority:  minor  Milestone:  sage6.3 
Component:  algebraic topology  Keywords:  Steenrod algebra 
Cc:  jhpalmieri  Merged in:  
Authors:  Christian Nassau  Reviewers:  John Palmieri 
Report Upstream:  N/A  Work issues:  
Branch:  429a989 (Commits)  Commit:  429a9894ef1afc6b1b86f54e664e474c6c25491b 
Dependencies:  Stopgaps: 
Description
For some applications one would like to work with the "odd primary Steenrod algebra at the prime 2". The attached patch introduces a new keyword "generic" that allows to do this:
sage: EA=SteenrodAlgebra(p=2,generic=True) ; EA generic mod 2 Steenrod algebra, milnor basis sage: EA[8] Vector space spanned by (Q_0 Q_2, Q_0 Q_1 P(2), P(1,1), P(4)) over Finite Field of size 2 sage: SteenrodAlgebra(p=2,generic=True,basis='adem')[7] Vector space spanned by (beta P^2 P^1, beta P^3, P^2 P^1 beta, P^3 beta) over Finite Field of size 2
Change History (19)
comment:1 Changed 7 years ago by
 Branch set to u/cnassau/ticket/16271
 Created changed from 04/30/14 12:18:49 to 04/30/14 12:18:49
 Modified changed from 04/30/14 12:18:49 to 04/30/14 12:18:49
comment:2 Changed 7 years ago by
 Cc jhpalmieri added
 Commit set to 8c59a4e918a6f80993c0b3107d4576bb5b702048
comment:3 Changed 7 years ago by
 Commit changed from 8c59a4e918a6f80993c0b3107d4576bb5b702048 to 7c8315e6fc71011764f589bf5743d6626ddc161d
comment:4 Changed 7 years ago by
 Commit changed from 7c8315e6fc71011764f589bf5743d6626ddc161d to 5f8d71c8245ef3998cdd251e7811a6180ad88f2e
Branch pushed to git repo; I updated commit sha1. New commits:
5f8d71c  Merge branch 'develop' of git://github.com/sagemath/sage into generic_steenrod

comment:5 Changed 7 years ago by
 Commit changed from 5f8d71c8245ef3998cdd251e7811a6180ad88f2e to df429ca0996cb57052d89343ebbf3e946ea2b482
Branch pushed to git repo; I updated commit sha1. New commits:
df429ca  more tests and minor improvements

comment:6 Changed 7 years ago by
 Status changed from new to needs_review
The code seems functional now. I've also added an is_generic
method to allow inspection of the '_generic' attribute.
One thing that might be problematic about this patch is that a few routines have changed their signature now: 'serre_cartan_mono_to_string', for example, now expects 'generic' as second argument, not 'p'. We might instead go for
def serre_cartan_mono_to_string(data,p,generic=None)
which would save backward compatibility... I'm not sure if that is required, though.
comment:7 Changed 7 years ago by
 Commit changed from df429ca0996cb57052d89343ebbf3e946ea2b482 to db6527ec2fdd8b9e896debcded7ed94d3bc2edd9
Branch pushed to git repo; I updated commit sha1. New commits:
db6527e  Merge branch 'develop' of git://github.com/sagemath/sage into generic_steenrod

comment:8 followups: ↓ 10 ↓ 14 Changed 7 years ago by
I'm not getting this to work. When I evaluate
sage: SteenrodAlgebra(p=2,generic=True)
I get an error:
 TypeError Traceback (most recent call last) <ipythoninput17bd50008c6f7> in <module>() > 1 EA = SteenrodAlgebra(p=Integer(2),generic=True) ; EA /Users/palmieri/Desktop/Sage_stuff/git/sage/local/lib/python2.7/sitepackages/sage/algebras/steenrod/steenrod_algebra.pyc in SteenrodAlgebra(p, basis, generic, **kwds) 4122 return SteenrodAlgebra_mod_two(p=2, basis=basis, **kwds) 4123 else: > 4124 return SteenrodAlgebra_generic(p=p, basis=basis, generic=True, **kwds) 4125 4126 /Users/palmieri/Desktop/Sage_stuff/git/sage/local/lib/python2.7/sitepackages/sage/misc/classcall_metaclass.so in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (sage/misc/classcall_metaclass.c:1282)() /Users/palmieri/Desktop/Sage_stuff/git/sage/local/lib/python2.7/sitepackages/sage/algebras/steenrod/steenrod_algebra.pyc in __classcall__(self, p, basis, **kwds) 525 526 std_basis = get_basis_name(basis, p, generic=std_generic) > 527 std_profile, std_type = normalize_profile(profile, precision=precision, truncation_type=truncation_type, p=p, generic=std_generic) 528 return super(SteenrodAlgebra_generic, self).__classcall__(self, p=p, basis=std_basis, profile=std_profile, 529 truncation_type=std_type, generic=std_generic) /Users/palmieri/Desktop/Sage_stuff/git/sage/local/lib/python2.7/sitepackages/sage/algebras/steenrod/steenrod_algebra_misc.pyc in normalize_profile(profile, precision, truncation_type, p, generic) 550 k = k[:1] 551 new_profile = (e, k) > 552 if is_valid_profile(new_profile, truncation_type, p): 553 return new_profile, truncation_type 554 else: /Users/palmieri/Desktop/Sage_stuff/git/sage/local/lib/python2.7/sitepackages/sage/algebras/steenrod/steenrod_algebra_misc.pyc in is_valid_profile(profile, truncation_type, p) 258 if pro_r < Infinity: 259 for i in range(1,r): > 260 if pro_r < min(pro[ri1]  i, pro[i1]): 261 return False 262 else:
Does is_valid_profile
also need to accept a generic
argument? Maybe something like this:

src/sage/algebras/steenrod/steenrod_algebra_misc.py
diff git a/src/sage/algebras/steenrod/steenrod_algebra_misc.py b/src/sage/algebras/steenrod/steen index 70b328c..fe58660 100644
a b def get_basis_name(basis, p, generic=None): 183 183 ###################################################### 184 184 # profile functions 185 185 186 def is_valid_profile(profile, truncation_type, p=2 ):186 def is_valid_profile(profile, truncation_type, p=2, generic=None): 187 187 """ 188 188 True if ``profile``, together with ``truncation_type``, is a valid 189 189 profile at the prime `p`. … … def is_valid_profile(profile, truncation_type, p=2): 250 250 True 251 251 """ 252 252 from sage.rings.infinity import Infinity 253 if p == 2: 253 if generic is None: 254 generic = False if p==2 else True 255 if p == 2 and not generic: 254 256 pro = list(profile) + [truncation_type]*len(profile) 255 257 r = 0 256 258 for pro_r in pro: … … def normalize_profile(profile, precision=None, truncation_type='auto', p=2, gen 549 551 while len(k) > 0 and k[1] == 2: 550 552 k = k[:1] 551 553 new_profile = (e, k) 552 if is_valid_profile(new_profile, truncation_type, p ):554 if is_valid_profile(new_profile, truncation_type, p, generic=generic): 553 555 return new_profile, truncation_type 554 556 else: 555 557 raise ValueError("Invalid profile")
Also, in the documentation for the function SteenrodAlgebra
, I think you should say a bit more, for example what the degrees of the elements are. Maybe move the comment about what the dual looks like from is_generic
to SteenrodAlgebra
.
comment:9 Changed 7 years ago by
 Commit changed from db6527ec2fdd8b9e896debcded7ed94d3bc2edd9 to 14197a6d0c6bb497eb185bab5eb420888fd79a5e
Branch pushed to git repo; I updated commit sha1. New commits:
14197a6  Merge branch 'develop' of git://github.com/sagemath/sage into generic_steenrod

comment:10 in reply to: ↑ 8 Changed 7 years ago by
 Status changed from needs_review to needs_work
Replying to jhpalmieri:
I'm not getting this to work. When I evaluate
sage: SteenrodAlgebra(p=2,generic=True)I get an error:
Very strange: it works for me, it works for the patchbot (selmer, sage 6.3.beta1)  yet your machine (and your patch) is definitely right. I do get this error when I try to construct a subalgebra:
sage: SteenrodAlgebra(p=2,generic=True,profile=([2,1],(2,2,2,))) ... /waste/cn/sagegit/local/lib/python2.7/sitepackages/sage/algebras/steenrod/steenrod_algebra_misc.pyc in is_valid_profile(profile, truncation_type, p) 258 if pro_r < Infinity: 259 for i in range(1,r): > 260 if pro_r < min(pro[ri1]  i, pro[i1]): 261 return False 262 else: TypeError: unsupported operand type(s) for : 'tuple' and 'int'
You're also right about the documentation, which should be improved. I'll post an updated patch when it is ready.
comment:11 Changed 7 years ago by
 Commit changed from 14197a6d0c6bb497eb185bab5eb420888fd79a5e to 2bfe11d1cb9116e326bbbceaeca95cdcd9dae4c9
comment:12 Changed 7 years ago by
 Commit changed from 2bfe11d1cb9116e326bbbceaeca95cdcd9dae4c9 to 1e7797c2e6cce1d385edfef64125376683e2bfcc
Branch pushed to git repo; I updated commit sha1. New commits:
1e7797c  Merge branch 'develop' of git://github.com/sagemath/sage into generic_steenrod

comment:13 Changed 7 years ago by
 Commit changed from 1e7797c2e6cce1d385edfef64125376683e2bfcc to be31a8886b3dad8e7eac3e0c96000ac11b80b11b
Branch pushed to git repo; I updated commit sha1. New commits:
be31a88  documentation improvements and a bugfix in is_valid_profile

comment:14 in reply to: ↑ 8 Changed 7 years ago by
 Status changed from needs_work to needs_review
Replying to jhpalmieri:
Does
is_valid_profile
also need to accept ageneric
argument? Also, in the documentation for the functionSteenrodAlgebra
, I think you should say a bit more, for example what the degrees of the elements are. Maybe move the comment about what the dual looks like fromis_generic
toSteenrodAlgebra
.
As suggested, I have added the generic
argument to is_valid_profile
and enhanced the documentation a (tiny) little bit. [My apologies that this took so long  I was busy with other matters.] I now refer to Voevodsky's motivic Steenrod algebra paper as another source that relates to the generic Steenrod algebra  other explicit references are not so easy to find.
It might be nice to also add support for the motivic Steenrod algebra, but I'll leave that for another ticket. Currently my cohomology programs can deal with the classical and the generic case, but not the motivic one, so my interest in the motivic case is not so urgent. It shouldn't be too difficult to implement the motivic version on top of the existing code, though...
comment:15 Changed 6 years ago by
 Commit changed from be31a8886b3dad8e7eac3e0c96000ac11b80b11b to ef07a703a0ebfc2580ec9cc169a4680189f303c0
Branch pushed to git repo; I updated commit sha1. New commits:
ef07a70  Merge branch 'develop' of git://github.com/sagemath/sage into generic_steenrod

comment:16 followup: ↓ 17 Changed 6 years ago by
 Branch changed from u/cnassau/ticket/16271 to u/jhpalmieri/generic_steenrod
 Commit changed from ef07a703a0ebfc2580ec9cc169a4680189f303c0 to 429a9894ef1afc6b1b86f54e664e474c6c25491b
 Reviewers set to John Palmieri
I've made a few small changes:
 added some doctests explicitly involving the mod 2 generic Steenrod algebra. I guess this is mostly not necessary, since the generic code gets tested well at odd primes, but I added these anyway.
 top of the file: added
# * coding: utf8 *
so the accent in "Études" wouldn't break docbuilding.
 fixed a preexisting bug in
_latex_term
for the "pst" basis
 changed the
__contains__
method so that elements in the ordinary mod 2 Steenrod algebra are not contained in the generic version. Is this the right thing to do?
If you're happy with these changes, it can get a positive review.
New commits:
429a989  Generic Steenrod algebra: add some doctests

comment:17 in reply to: ↑ 16 Changed 6 years ago by
Replying to jhpalmieri:
 changed the
__contains__
method so that elements in the ordinary mod 2 Steenrod algebra are not contained in the generic version. Is this the right thing to do?
Yes, I think so, at least for the moment. It might eventually make sense to think of the generic variant as a quotient of the regular Steenrod algebra  but I'm hesitant to propose such a change right now, as the need for it is not clear to me. I'm also not sure whether one should then follow the Sage SubQuotient
protocol or just provide some extra logic in the element constructor; currently, the latter sounds more resonable to me.
If you're happy with these changes, it can get a positive review.
I'm very happy  thanks for all the work you've put into this!
comment:18 Changed 6 years ago by
 Status changed from needs_review to positive_review
comment:19 Changed 6 years ago by
 Branch changed from u/jhpalmieri/generic_steenrod to 429a9894ef1afc6b1b86f54e664e474c6c25491b
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
TSK16271  support the generic Steenrod algebra at the prime 2