[sage-devel] Re: Question about Morphism and SchemeMorphism (Issue 14711)

2024-04-02 Thread Gareth Ma
t, meaning the operation defined in Morphism/Map will be ignored, which is undesirable since well a SchemeMorphism should be more like a morphism not a module element I guess (Sorry for the spam on Easter holidays) On 01/04/2024 04:34, Gareth Ma wrote: I'm currently working on stuff related to `Ellipt

[sage-devel] Question about Morphism and SchemeMorphism (Issue 14711)

2024-03-31 Thread Gareth Ma
I'm currently working on stuff related to `EllipticCurveHom` and `SchemeMorphism` at #37705. While working on it, I realised there's a fundamental difference between the two `EllipticCurveHom` inherits from `sage.categories.morphism.Morphism`, while `SchemeMorphism` inherits from

Re: [sage-devel] weirdest bug ever

2024-03-09 Thread Gareth Ma
You typed `mononomials` instead of `monomials`. That's a nono. On 09/03/2024 22:22, 'Martin R' via sage-devel wrote: If I store this in a file "bug.sage" I can do: sage: load('/home/martin/bug.sage') sage: c = bug() sage: c.coefficients_mononomials() -- You received this message because you

Re: [sage-devel] Re: Degree of the zero polynomial ring for `LaurentPolynomialRing`

2024-03-01 Thread Gareth Ma
And that will be a problem when `R` is a laurent polynomial ring. On 01/03/2024 09:12, Gareth Ma wrote: I lean towards setting it to -∞. While we are at this, how should `R.random_element` be called? The method currently takes a `degree` argument, which is a tuple of lower and upper bound

Re: [sage-devel] Re: Degree of the zero polynomial ring for `LaurentPolynomialRing`

2024-03-01 Thread Gareth Ma
I lean towards setting it to -∞. While we are at this, how should `R.random_element` be called? The method currently takes a `degree` argument, which is a tuple of lower and upper bound, and if the user sets the lower bound to -1, then `0` is a possible outcome. Would the user call it with

[sage-devel] Re: [Proposal] allow standard packages to be pip packages, reduce source tarball size

2024-02-22 Thread Gareth Ma
Can someone from this list confirm that the PR Matthias linked (#37411) is okay i.e. not the topic of the debate in this thread? The added documentation seems harmless to me, advertises using git worktree, and can be updated when the discussion in this thread has a conclusion e.g. if upstream

[sage-devel] Opinions needed from cryptographers

2024-02-13 Thread Gareth Ma
Hi all, I have created issue #37305 to collect ideas about cryptography in Sage. If you have used Sage (or Python) for cryptography before, or just has any opinions about the prompt, please discuss them there. Thanks!

Re: [sage-devel] Re: Question about coercion model

2024-02-13 Thread Gareth Ma
epr__(self): return f"Number({self.x})" : def _mul_(self, other): return Number(self.x * ZZ(other)) : : a = Number(5) : a * ZZ(3) : a * int(3) Number(15) Number(15) ``` On 12/02/2024 17:43, Nils Bruin wrote: On Monday 12 February 2024 at 03:21:36 UTC-8 Gareth Ma wro

[sage-devel] Question about coercion model

2024-02-12 Thread Gareth Ma
Hi all, I am currently torturing myself by looking at the coercion model. I saw this line which I have questions about, in particular about its interaction with Python objects. Take the following code

Re: [sage-devel] Re: Problem extracting base B fractional digits of a number

2024-02-11 Thread Gareth Ma
Yes, because 1 / 2 is mathematically infinite in base 3, just like how A=1/3 and B=10 doesn't terminate. On 12/02/2024 07:31, Georgi Guninski wrote: On Sat, Feb 10, 2024 at 6:24 PM Georgi Guninski wrote: ``` def base_B_digits(A, B,prot=False): digits=[] fractional_part = A -

Re: [sage-devel] add transformation matrix interface for BKZ

2024-02-11 Thread Gareth Ma
Regarding fplll and flatter, Sage already has an interface with fplll (via fpylll), and issue #37207 is adding an interface call to flatter (the new pari implementation). On 11/02/2024 23:48, user ctf wrote: Hi. sage-devel members. I am kiona. I want to contribute devel for some math/crypto

Re: [sage-devel] Problem extracting base B fractional digits of a number

2024-02-10 Thread Gareth Ma
I assume you should use floor division to preserve accuracy. As a numerical example, say you want the first 100 /decimal/ digits of 3 / 173. That's the same as floor(10^100 * 3 / 173). In [105]: from decimal import Decimal, getcontext ...: getcontext().prec = 300 ...: print(10**100 *

Re: [sage-devel] Help needed with UniqueRepresentation (of SymmetricFunctions)

2024-02-05 Thread Gareth Ma
The following should show the problem: sage: from sage.structure.unique_representation import UniqueRepresentation : : class A(UniqueRepresentation): : def __init__(self, v=1): : self.v = str(v) : : A() == A() : A() is A() : A() == A(1) True True False

Re: [sage-devel] rebuilding Cython files in `conda` installation

2024-01-24 Thread Gareth Ma
On 24/01/2024 16:37, Dima Pasechnik wrote: On 24 January 2024 15:58:56 GMT, Gareth Ma wrote: Hi all, my development Sage installation uses the conda instructions here <https://doc.sagemath.org/html/en/installation/conda.html#using-conda-to-provide-all-dependencies-for-the-sage-libr

[sage-devel] rebuilding Cython files in `conda` installation

2024-01-24 Thread Gareth Ma
Hi all, my development Sage installation uses the conda instructions here . There is a command below for how to recompile Cython files: pip install --no-build-isolation