Skip to content

Conversation

kwankyu
Copy link
Collaborator

@kwankyu kwankyu commented Feb 21, 2024

so that we can do

sage: A2.<x,y> = AffineSpace(QQ, 2)
sage: p = A2.point([0,0])
sage: P = p.as_subscheme()
sage: P
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
  x,
  y
sage: Q = P.projective_closure()
sage: Q
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
  x0,
  x1
sage: q, = Q.rational_points()
sage: q
(0 : 0 : 1)
sage: q.as_subscheme()
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
  x0,
  x1

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@kwankyu kwankyu changed the title Add as_subscheme() method for algebraic points Add as_subscheme() method for rational points Feb 21, 2024
@kwankyu kwankyu force-pushed the p/points-as-subschemes branch from 04d71e0 to 81aff8c Compare February 21, 2024 07:48
@kwankyu kwankyu marked this pull request as ready for review February 22, 2024 00:36
Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall. Two minor things:

  1. Please add tests for the input-checking errors to make sure they are working properly.
  2. Are we certain that removing the fixed-in-place _NumberFields will not slow down the code in any meaningful way? It seems like something that could be created often enough that it might matter.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Feb 25, 2024

  1. Please add tests for the input-checking errors to make sure they are working properly.

I cannot make up tests to invoke them. This tells that I added unnecessary checks. Hence I removed them.

  1. Are we certain that removing the fixed-in-place _NumberFields will not slow down the code in any meaningful way? It seems like something that could be created often enough that it might matter.

I experimented it. Really _NumberFields gains a slight speedup. Hence I restored it.

Thanks for pointing out these.

@kwankyu kwankyu force-pushed the p/points-as-subschemes branch from 361410a to 1a147c1 Compare February 25, 2024 10:34
@tscrim
Copy link
Collaborator

tscrim commented Feb 25, 2024

Thank you.

  1. Please add tests for the input-checking errors to make sure they are working properly.

I cannot make up tests to invoke them. This tells that I added unnecessary checks. Hence I removed them.

Would you want to leave them as assert statements?

@kwankyu
Copy link
Collaborator Author

kwankyu commented Feb 25, 2024

No. The (affine and projective) point constructors have the checks so that the assert statements would just be duplicates.

Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Then positive review.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Feb 25, 2024

Thanks!

Copy link

Documentation preview for this PR (built with commit ba8adc6; changes) is ready! 🎉

@vbraun vbraun merged commit 7b13a0a into sagemath:develop Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants