Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up lattice precision p-adics #24809

Open
saraedum opened this issue Feb 21, 2018 · 2 comments
Open

Speed up lattice precision p-adics #24809

saraedum opened this issue Feb 21, 2018 · 2 comments

Comments

@saraedum
Copy link
Member

  • Drop labels keyword in parents & make parents more unique
  • Switch to templates for elements
  • Switch to cython for precision lattice
  • Specialized data structure for matrix
  • Make pickling and conversion more robust (pickling should dump the full lattice matrix and unpickling restores the matrix but puts it next to the existing matrix)
  • Share precision lattice between all parents with the same p.

Depends on #23505

CC: @roed314 @xcaruso @sagetrac-TristanVaccon

Component: padics

Keywords: lattice precision

Issue created by migration from https://trac.sagemath.org/ticket/24809

@saraedum saraedum added this to the sage-8.2 milestone Feb 21, 2018
@xcaruso
Copy link
Contributor

xcaruso commented Feb 22, 2018

comment:1

About pickling/unpickling, I propose the following interface:

  • (usual syntax) if x is a p-adic, dumps(x) saves x as approx + O(p^prec) but diffused digits implying x are not saved
  • if R is a parent (and/or a precision lattice maybe), R.dumps_elements(x,y,z,...) saves the approximation of all listed elements together with a lattice representing the precision on this set of elements
  • loads(obj) loads the stored variables in obj (they can be many of them if obj was constructed by dumps_elements) as new independant variables.

How does it sound?

@saraedum
Copy link
Member Author

comment:2

I am not sure how dumps_elements would integrate with the usual pickling workflow, say when pickling something like a matrix.

I think a simpler interface is not harder implement and makes things less surprising:

  • Whenever we pickle an element we pickle its entire precision lattice. So, if we happen to pickle many elements at the same time, say a polynomial, we pickle their lattice (once.)
  • Restoring elements just appends the pickled lattice to the existing lattice and does a "drop unused columns".

While this is not a very space-efficient format (but I guess we don't care) it gives us both behaviours you describe above automatically, doesn't it?

@mkoeppe mkoeppe removed this from the sage-8.2 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants