Opened 11 months ago
Last modified 11 months ago
#23813 needs_work enhancement
Implement matrix action on polynomial scheme morphisms
Reported by:  atowsley  Owned by:  

Priority:  major  Milestone:  sage8.1 
Component:  algebraic geometry  Keywords:  matrix action, scheme morphism 
Cc:  bhutz, paulfili  Merged in:  
Authors:  Adam Towsley  Reviewers:  Ben Hutz, Paul Fili 
Report Upstream:  N/A  Work issues:  
Branch:  u/paulfili/matrix_action_23813 (Commits)  Commit:  6d2c4522cefcf065fca8121355fba558cfe0954c 
Dependencies:  #23497  Stopgaps: 
Description
Created a left and right action by matrices on affine and projective polynomial scheme morphisms. The following examples now works:
sage: P.<x,y> = ProjectiveSpace(ZZ, 1) sage: H = Hom(P,P) sage: f = H([x^2 + y^2, y^2]) sage: matrix([[1,2], [0,1]]) * f sage: f* matrix([[1,2], [0,1]])
Additionally, added conjugation by a matrix for affine dynamical systems.
Change History (19)
comment:1 Changed 11 months ago by
 Branch set to u/atowsley/matrix_action_23813
 Commit set to 1d8a9b63c1b5671904ff9a92684980b9bdf511bd
 Status changed from new to needs_review
comment:2 Changed 11 months ago by
 Reviewers set to Ben Hutz
 Status changed from needs_review to needs_work
Here are some comments for the code syntax
 Examples:: > EXAMPLES::
 blank line after EXAMPELS in init
 isinstance(, ) #space between args
 all functions should have one line description before examples
 def funct(, ) #space between parameters
 blank line at end of action file
 I don't think you use the AlgebraicScheme? import in matrix_space
Now some issues from functionality testing
endomorphisms do not remain endomorphisms
P.<x, y> = ProjectiveSpace(QQ, 1) H = Hom(P, P) f = H([x^2 + y^2, y^2]) m = matrix([[1,1], [0,1]]) f.is_endomorphism(),(m*f).is_endomorphism(), (f*m).is_endomorphism()
Affine scheme morhisms don't have the action function
P.<x, y> = AffineSpace(QQ, 2) H = Hom(P, P) f = H([x^2 + y^2, y^2]) m = matrix([[1,1,1], [0,1,0],[1,0,0]]) f*m, m*f
I think it would helpful to separate the errors
P.<x, y> = ProjectiveSpace(QQ, 1) H = Hom(P, P) f = H([x^2 + y^2, y^2]) m = matrix([[1]]) f.as_dynamical_system().conjugate(m)
When the matrix ring is contained in the morphism base ring it can't work out the parent
P.<x, y> = ProjectiveSpace(CC, 1) H = Hom(P, P) f = H([x^2 + y^2, y^2]) m = matrix(QQ,[[1,1], [1,0]]) m*f
even more troubling
P.<x, y> = ProjectiveSpace(RR, 1) H = Hom(P, P) f = H([x^2 + RR(sqrt(2))*y^2, y^2]) m = matrix(QQ,[[1,1], [1,0]]) m*f
Acting on a dynamical system gives back a projective morphism instead of a dynamical system
P.<x, y> = ProjectiveSpace(QQ, 1) H = Hom(P, P) f = H([x^2 + y^2, y^2]) m = matrix([[1,1], [1,0]]) fd=f.as_dynamical_system() m*fd
comment:3 Changed 11 months ago by
 Commit changed from 1d8a9b63c1b5671904ff9a92684980b9bdf511bd to 52c966ffaab05c800011763772f3a0675ed3e50e
Branch pushed to git repo; I updated commit sha1. New commits:
52c966f  23813 Fixes from review by bhutz

comment:4 Changed 11 months ago by
 Status changed from needs_work to needs_review
comment:5 Changed 11 months ago by
 Commit changed from 52c966ffaab05c800011763772f3a0675ed3e50e to 4eefffc45543cec5625c8063b78110dc50ba6d21
Branch pushed to git repo; I updated commit sha1. New commits:
4eefffc  23813 Added matrix actions for affine morphisms

comment:6 Changed 11 months ago by
Most everything seems fixed, except here is another issue with affines. I think the issue may actually be in dehomogenize().
P.<x, y> = AffineSpace(QQ, 2) P2.<u,v,w> = AffineSpace(QQ,3) H = Hom(P2, P) f = H([u^2 + v^2, w^2]) m = matrix([[1,1,1], [1,0,1],[0,0,1]]) m*f
comment:7 Changed 11 months ago by
 Commit changed from 4eefffc45543cec5625c8063b78110dc50ba6d21 to 86ab06aeee2ad614da02d28e8ba7f49c5b7e2fe7
Branch pushed to git repo; I updated commit sha1. New commits:
86ab06a  23813 fixed dehomogenize

comment:8 Changed 11 months ago by
 Reviewers changed from Ben Hutz to Ben Hutz, Paul Fili
comment:9 Changed 11 months ago by
 Commit changed from 86ab06aeee2ad614da02d28e8ba7f49c5b7e2fe7 to 3ebecc9f11cca4837f69839f43b5d9d2fd8c342e
Branch pushed to git repo; I updated commit sha1. New commits:
3ebecc9  23813 Added examples, fixed dehomogenize again.

comment:10 Changed 11 months ago by
 Status changed from needs_review to positive_review
comment:11 Changed 11 months ago by
 Status changed from positive_review to needs_work
merge conflict
comment:12 Changed 11 months ago by
 Branch changed from u/atowsley/matrix_action_23813 to u/bhutz/matrix_action_23813
comment:13 Changed 11 months ago by
 Commit changed from 3ebecc9f11cca4837f69839f43b5d9d2fd8c342e to a4ee1486ddd5d50356b28296eb4132134cb1cbb1
 Status changed from needs_work to needs_review
comment:14 Changed 11 months ago by
 Branch changed from u/bhutz/matrix_action_23813 to u/paulfili/matrix_action_23813
comment:15 Changed 11 months ago by
 Commit changed from a4ee1486ddd5d50356b28296eb4132134cb1cbb1 to 6d2c4522cefcf065fca8121355fba558cfe0954c
 Status changed from needs_review to needs_work
I added a "minimal" option that finds the minimal field of definition. I haven't had a chance to test it much yet, or add a doctest illustrating the functionality. Can you guys check it out and see if it works as desired?
New commits:
6d2c452  Added minimal field functionality

comment:16 Changed 11 months ago by
merge conflict
comment:17 Changed 11 months ago by
I didn't see a new commit, but the conflict seems to be worked out. However, the code doesn't work
sage: K.<w>=QuadraticField(5) sage: P.<x, y> = ProjectiveSpace(K, 1) sage: f = DynamicalSystem([x^2 + 2*y^2, y^2]) sage: m = matrix(QQ,[[1,1], [1,0]]) sage: f.conjugate(m,minimal=True) NameError: global name 'number_field_elements_from_algebraics' is not defined
I think this is probably better as a separate function as I can see more uses for this. Then conjugate can call that function based on the minimal parameter.
I'm also tempted to separate that out from matrix actions and make it its own ticket. What do you think?
comment:18 Changed 11 months ago by
Sure, we can make a new ticket with this functionality. I'll check what's going wrong as soon as I can, the examples I ran worked somehow.
comment:19 Changed 11 months ago by
I agree that this should probably be a new ticket since it can be used in other situations as well. I'll let Paul separate out the code and then I'll rerun the tests on this ticket.
Last 10 new commits:
Merge branch 8.1.beta3 into t/23497/arith_dyn
23497: some fixes from review
23497: doc formatting INPUT/OUTPUT
23497: use __classcall_private__
Fixing things with __classcall_private__.
Cleaning up the doc and improving the code.
23497: a couple minor fixes
Merge branch 8.1.beta4 into t/23497/arith_dyn23497
Fixing typo in doctest.
23813 Implemented matrix actions on scheme morphisms