Re: [sage-devel] On backdooring open source projects

2024-05-30 Thread Georgi Guninski
On Sat, May 25, 2024 at 10:10 PM Matthias Koeppe wrote: > This has been merged in 10.4.beta7. > Good to see some action :) Here is a short anti-security rant from my experience. To protect something, you need to fix all weaknesses. To break it, an attacker needs only one exploitable weakness.

[sage-devel] OT Efficient probabilistic factorization of F(x,y)=g(x,y) f(x,y) modulo composite integers n assuming the solution is unique

2024-05-20 Thread Georgi Guninski
Sorry for offtopic. We give efficient probabilistic factorization of F(x,y)=g(x,y) f(x,y) modulo composite integers n assuming the solution is unique. The main contribution is the observation that `Ideal(J).groebner_basis()` is efficient for overdetermined `J` and it works modulo n The preprint

[sage-devel] On a efficient algorithm for factoring bivariate polynomials modulo composite modulus assuming the solution is unique

2024-05-14 Thread Georgi Guninski
We found and implemented in sage efficient algorithm for factoring bivariate polynomials modulo composite modulus assuming the solution is unique up to a constant factor. More formally let $K=\mathbb{Z}/n\mathbb{Z}[x,y]$. Given $F \in K$ in general we can find solution $f,g$ such that $F=f g$

Re: [sage-devel] Re: SEGV Crash in `numerator(f(t)/g(t)-const)`

2024-05-12 Thread Georgi Guninski
I see your point, but segafault should be avoided if possible. In some cases it is considered denial of service and IIRC on Fedora the coredump is in /var, owned by root and not deletable by user. -- You received this message because you are subscribed to the Google Groups "sage-devel" group.

[sage-devel] SEGV Crash in `numerator(f(t)/g(t)-const)`

2024-05-11 Thread Georgi Guninski
The following hurt my computations. ``` #Author Georgi Guninski, Sat May 11 04:53:23 PM UTC 2024 p=101; Kt.=Integers(p)[] c5,s5=((100*t^10 + 45*t^8 + 93*t^6 + 8*t^4 + 56*t^2 + 1)/(t^10 + 5*t^8 + 10*t^6 + 10*t^4 + 5*t^2 + 1), (10*t^9 + 82*t^7 + 50*t^5 + 82*t^3 + 10*t)/(t^10 + 5*t^8 + 10*t^6 + 10*t

Re: [sage-devel] Incorrect result for `sum(1/factorial(n**2),n,1,oo)`

2024-04-26 Thread Georgi Guninski
On Thu, Feb 15, 2024 at 2:27 AM Dima Pasechnik wrote: > > I've filed https://sourceforge.net/p/maxima/bugs/4262/ > Is maxima supported? There is no progress on their bug system for more than 2 months. SEGV is not pleasant, but incorrect symbolic result casts doubts about all symbolic sage

Re: [sage-devel] On backdooring open source projects

2024-04-19 Thread Georgi Guninski
> in Sage development. The build scripts will simply pull and run it.) > > > > We should reduce dependencies, not add more. _Especially_ when it's > > about non-essential convenience libraries. > > > On Wed, 17 Apr 2024 09:43:28 +0300, Georgi Guninski > wrote: > > I

[sage-devel] On backdooring open source projects

2024-04-17 Thread Georgi Guninski
If the recent xz backdoor drama didn't induce enough paranoia in you, here is a second chance exception: https://www.theregister.com/2024/04/16/xz_style_attacks_continue/ Open sourcerers say suspected xz-style attacks continue to target maintainers Social engineering patterns spotted across

Re: [sage-devel] SEGV caused by CTL-C in C/C++ code probably related to signals

2024-04-12 Thread Georgi Guninski
024 12:42:39 CEST, Georgi Guninski wrote: > >On Fri, Apr 12, 2024 at 11:35 AM Dima Pasechnik wrote: > >> > >> This should be fixed by https://github.com/sagemath/sage/pull/37792 > >> please review > >> > > > >I suspect reproducing is hard, sin

Re: [sage-devel] SEGV caused by CTL-C in C/C++ code probably related to signals

2024-04-12 Thread Georgi Guninski
g emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAGUWgD_5i%2BebLNsdJ4ZbaCuh_qcdMXtN2tkAaiByztA1oSOqTA%40mail.gmail.com. """ sage SEGV in solve_mod() + alarm() possibly related t

Re: [sage-devel] SEGV caused by CTL-C in C/C++ code probably related to signals

2024-04-11 Thread Georgi Guninski
Are the non-crashing codepaths in consistent state? SEGV is in general sign of memory corruption and it may lead to wrong math results or possibly have security implications. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from

Re: [sage-devel] SEGV caused by CTL-C in C/C++ code probably related to signals

2024-04-11 Thread Georgi Guninski
Giving short testcase, can someone else reproduce it? Also attaching backtrace. On second thought, if I don't crash, there could be some memory corruption and sage runs with screwed memory. ``` x,y=var('x,y');n=10**6 while True: so=solve_mod(x*y-1,n) #press CTL-C, crashes with probability about

[sage-devel] SEGV caused by CTL-C in C/C++ code probably related to signals

2024-04-10 Thread Georgi Guninski
I don't have reproducible testcase, but my pain is that sometimes if I press CTL-C e.g. when solve_mod() is called in a loop, I get SEGV and abort. I suspect besides signals, it is hitting race condition. Is this a known issue? Very long ago there was vulnerability in sendmail, where it did

Re: [sage-devel] xz/liblzma has been compromised

2024-04-02 Thread Georgi Guninski
The Register journo analysis of the SNAFU: https://www.theregister.com/2024/04/01/xz_backdoor_open_source/ -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[sage-devel] Incorrect result for `sum(1/factorial(n**2),n,1,oo)`

2024-02-12 Thread Georgi Guninski
There is discussion about this on mathoverlow [1]: The closed form of `sum(1/factorial(n**2),n,1,oo)` doesn't appear correct and it contradicts numerical computations, including verification with mpmath. Session: sage: import mpmath sage: su4=sum(1/factorial(n**2),n,1,oo);su4

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

2024-02-11 Thread Georgi Guninski
On Mon, Feb 12, 2024 at 9:35 AM Gareth Ma wrote: > > Yes, because 1 / 2 is mathematically infinite in base 3, just like how A=1/3 > and B=10 doesn't terminate. > Indeed, it is periodic and infinite. When I use code finite precision I expect it to terminate. It works with python `float` too.

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

2024-02-11 Thread Georgi Guninski
On Sat, Feb 10, 2024 at 6:24 PM Georgi Guninski wrote: > > > ``` > def base_B_digits(A, B,prot=False): > digits=[] > fractional_part = A - int(A) > while fractional_part != 0: >digit = int(fractional_part * B) >digits.append(digi

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

2024-02-10 Thread Georgi Guninski
Given SR constant, I want to extract the first L base B digits of the fractional part. So far the best solution I found is: floor((SR(expression)*B**L).numerical_approx(digits=L)).digits(B) Can I do better? Why the following approach fails numerically: ``` def base_B_digits(A, B,prot=False):

Re: [sage-devel] Re: Exception in floor(tanh(91))

2024-02-09 Thread Georgi Guninski
When I try to extract digits of tanh(91) via floor, I still get error sage: floor(10^4*tanh(91)) ValueError sage: gp('floor(10^4*tanh(91))') 1 gp computes it both ways :) sage: gp.default('realprecision',10^5) 0 sage: gp('floor(tanh(91))') 0 -- You received this message because you are

[sage-devel] Exception in floor(tanh(91))

2024-02-09 Thread Georgi Guninski
hi, floor(tanh(91)) ValueError: cannot compute floor(sinh(91)/cosh(91)) using 256 bits of precision gp('floor(tanh(91))') 1 -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send

[sage-devel] Exception in sum((4*n+1)/factorial(n),n,1,oo)

2024-02-09 Thread Georgi Guninski
hi, var('n') sum((4*n+1)/factorial(n),n,1,oo) TypeError: 'NoneType' object is not callable -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [sage-devel] Efficiency of Groebner basis for constraints of the form $(a_i x_i+b_i)(a_j x_j+b_j)=0$

2024-02-02 Thread Georgi Guninski
Thanks. This was asked on mathoverflow [1], you can win some points if you paste it as an answer. Adding a single linear equation break the efficiency, so your solution appear to show that incremental groebner basis might be large. [1]:

Re: [sage-devel] Efficiency of Groebner basis for constraints of the form $(a_i x_i+b_i)(a_j x_j+b_j)=0$

2024-01-31 Thread Georgi Guninski
On Wed, Jan 31, 2024 at 10:54 PM Dima Pasechnik wrote: > > Do you have exactly one (or at most) relation for any pair of variables? Can > one have i=j ? > > Or it's the notation which should be improved? > The number of relations for a pair of variables can be arbitrary. i=j appears irrelevant,

[sage-devel] Efficiency of Groebner basis for constraints of the form $(a_i x_i+b_i)(a_j x_j+b_j)=0$

2024-01-31 Thread Georgi Guninski
This is based on numerical experiments in sage. Let $K$ be a ring and define the ideal where each polynomial is of the form $(a_i x_i+b_i)(a_j x_j+b_j)=0$ for constant $a_i,b_i,a_j,b_j$. >Q1 Is it true that for constraints of this form the groebner basis is >efficiently computable? By

Re: [sage-devel] Re: crash with coredump in `crt` for polynomials over finite rings

2024-01-06 Thread Georgi Guninski
This is offtopic: P != NP implies you can't work efficiently with many nilpotent elements over commutative ring or algebra even on a quantum computer. The reduction is from counting hamiltonian cycles in a graph via powers of nilpotent matrix. For reference, check:

[sage-devel] crash with coredump in `crt` for polynomials over finite rings

2024-01-05 Thread Georgi Guninski
def testcrtcrash1(): """ crash with coredump in `crt` for polynomials over finite rings author: Georgi Guninski """ A=13 Kx.=Integers(A**2)[] mods=[x^2+A,x^4+A] resi=[x,x^2] g=crt(resi,mods) return g Aborted (core dumped)

[sage-devel] PolynomialRing().random_element() returns 0 rather often.

2023-12-30 Thread Georgi Guninski
Just FYI: def testquotient2(): set_random_seed(1);p=next_prime(10**120);Kx=Integers(p)['x'] l=[Kx.random_element() for _ in range(100)] return l.count(0) testquotient2() 27 -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To

[sage-devel] maxima-to-sr exception in `sum(1/(5*n)-1/(5*n+1),n,2,oo)`

2023-11-25 Thread Georgi Guninski
``` n=var('n') su1=sum(1/(5*n)-1/(5*n+1),n,2,oo);su1 ``` RuntimeError: Encountered operator mismatch in maxima-to-sr translation -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it,

[sage-devel] Memory leak in `try: a=ZZ(10)**(2**61)`

2023-09-11 Thread Georgi Guninski
The following leaks for me on 9.6 ``` from sage.all import ZZ for _ in range(10**8): try: a=ZZ(10)**(2**61) except: pass ``` In addition it prints on stderr `gmp: overflow in mpz type` -- You received this message because you are subscribed to the Google Groups "sage-devel" group.

[sage-devel] Re: Memory leaks in `while SR(float(0.5))` and in `a=gp('bnfinit(x^2+1)')`

2023-08-13 Thread Georgi Guninski
``` while 1: a=bool(SR(float(0.5))) ``` leaks much. The stack and the global vars appear ugly to me. -- guninski https://www.guninski.com/me.html -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving

[sage-devel] Memory leaks in `while SR(float(0.5))` and in `a=gp('bnfinit(x^2+1)')`

2023-08-13 Thread Georgi Guninski
This may be fixed by the fix for sqrt(2), but I don't have such build. I haven't done exact profile of the memory leak and measure it with the "task manager" of XFCE. The leak is about few megabytes per seconds. Session: ``` c=0 while SR(float(0.5)): c += 1 #leaks ``` According to my tests

Re: [sage-devel] Overflow error in `set_random_seed(1);a=(Integers(13)(2))**randint(2,2**4000-1)`

2023-08-12 Thread Georgi Guninski
btw, why this code works? sage: a=Integers(13)(2);X=2**14000-19;a**X==a**(X%12) True -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [sage-devel] Overflow error in `set_random_seed(1);a=(Integers(13)(2))**randint(2,2**4000-1)`

2023-08-12 Thread Georgi Guninski
hi Dima, I am familiar with reduction modulo Euler totient, but it could be expensive to compute and in addition my testcase omits it on purpose :) btw, in the github issue the link to google groups appears broken. -- You received this message because you are subscribed to the Google Groups

[sage-devel] Overflow error in `set_random_seed(1);a=(Integers(13)(2))**randint(2,2**4000-1)`

2023-08-12 Thread Georgi Guninski
``` set_random_seed(1);a=(Integers(13)(2))**randint(2,2**4000-1) OverflowError Traceback (most recent call last) OverflowError: Python int too large to convert to C long The above exception was the direct cause of the following exception: SystemError ``` I think the

Re: [sage-devel] Re: Caught SEGV in Curve().projective_closure()

2023-07-30 Thread Georgi Guninski
On Sun, Jul 30, 2023 at 2:00 PM Kwankyu Lee wrote: > > It seems related with the fact that the curve is reducible. > Could be, but some reducible curves pass the test: sage: Kz.=GF(3)[] sage: f2=(x+y)*(x+y-1);g2=x+y+z+1 sage: C=Curve([f2,g2]) sage: C.irreducible_components() [ Closed subscheme

[sage-devel] Caught SEGV in Curve().projective_closure()

2023-07-30 Thread Georgi Guninski
Kz.=GF(3)[] f1=y^2 + 1;g1=x^4*z - x^2*z + x; C=Curve([f1,g1]) pc=C.projective_closure() SignalError: Segmentation fault -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an

[sage-devel] import gc; from sage.all import SR; fails on python 3.11 and sage 9.6

2023-07-08 Thread Georgi Guninski
On sage 9.6 and python 3.11: >>> import gc >>> from sage.all import SR Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.11/site-packages/sage/all.py", line 127, in from sage.data_structures.all import * File

Re: [sage-devel] Memory leak (quite bad)

2023-07-07 Thread Georgi Guninski
Simpler testcase is to replace `C = sqrt(T2)` with `C=SR(int(2)).sqrt()` Both int() and sqrt() appear necessary, sin() doesn't leak for me. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails

Re: [sage-devel] Graph([('A','B'),(1,2)]).edges() raises weird traceback

2023-07-05 Thread Georgi Guninski
I am not sure I understand correctly, but if you give warning, you already know with high probability that functionality will be broken and besides the warning you will get exception. Is this correct? -- You received this message because you are subscribed to the Google Groups "sage-devel"

Re: [sage-devel] Re: Exception in `G=Graph([("A",1)]);G.faces()`

2023-07-05 Thread Georgi Guninski
On Wed, Jul 5, 2023 at 8:02 PM Vincent Delecroix <20100.delecr...@gmail.com> wrote: > > On Wed, 5 Jul 2023 at 17:51, Georgi Guninski wrote: > > > > I just reported a bug on github, though I don't like microsoft services at > > all. > > Is google any better?

Re: [sage-devel] Re: Exception in `G=Graph([("A",1)]);G.faces()`

2023-07-05 Thread Georgi Guninski
On Wed, Jul 5, 2023 at 4:05 PM David Coudert wrote: > > I have opened https://github.com/sagemath/sage/issues/35902 to collect such > kind of issues. > Please use it to share new cases. > I just reported a bug on github, though I don't like microsoft services at all. -- You received this

[sage-devel] Exception in `G=Graph([("A",1)]);G.faces()`

2023-07-05 Thread Georgi Guninski
Hi sage devs, your daily dose of incomparable objects, fix 'em while they are free ;) G=Graph([("A",1)]);G.faces() TypeError Traceback (most recent call last) Cell In [1], line 1 > 1 G=Graph([("A",Integer(1))]);G.faces() File

[sage-devel] Graph([('A','B'),(1,2)]).edges() raises weird traceback

2023-07-04 Thread Georgi Guninski
Graph([('A','B'),(1,2)]).edges() ) failed: TypeError: unsupported operand parent(s) for <: 'Integer Ring' and ''> I think this is related to sorting the edges. The following works: sage: Graph([("A",1),("B",2)]).edges() [(1, 'A', None), (2, 'B', None)] -- You received this message because you

[sage-devel] grep-ing for sort() in graphs

2023-07-04 Thread Georgi Guninski
In a QA attempt I tried to find calling sort() in graphs without |key|, which may raise exception. On sage 9.6: $cd /usr/lib64/python3.11/site-packages/sage/graphs/ $grep -rnI 'sort(' . | grep -v 'key=' | grep -v 'topological' #15 results ./base/static_sparse_backend.pyx:512:

Re: [sage-devel] Should I report codepaths leading to comparing incomparable objects?

2023-07-02 Thread Georgi Guninski
You definitely can construct graph with incomparable vertices and they worked as expected in python2. python3 regressed them and devs are doing workarounds. The new testace is: G=Graph([("A",1)]) G.feedback_vertex_set() === File /home/sc_serv/sage/src/sage/graphs/connectivity.pyx:287, in

[sage-devel] Should I report codepaths leading to comparing incomparable objects?

2023-07-02 Thread Georgi Guninski
I reported several bugs about Graph.vertices() and have the impression that sage devs are aware of the problem and don't want bug reports about this. I have another testcase not related to vertices(), should I report it? -- You received this message because you are subscribed to the Google

Re: [sage-devel] Re: DeprecationWarning on sagecell in Graph([(0,1)]).vertices()

2023-06-27 Thread Georgi Guninski
On Tue, Jun 27, 2023 at 8:48 AM John H Palmieri wrote: > > Just do a global search-and-replace: change ".vertices()" to > ".vertices(sort=True, key=id)" or ".vertices(sort=True, key=str)". > Thanks for this. You are right that I knew about the problems with sort(), and sage 9.6 is OK for me

Re: [sage-devel] Re: DeprecationWarning on sagecell in Graph([(0,1)]).vertices()

2023-06-26 Thread Georgi Guninski
Thanks. In my code, this backwards incompatibility breaks over 150 calls to Graph.vertices() and I suspect I am not the only one. I think the root of the problem is the change from python2 to python3. In python2 |["A",1].sort()| works fine, while it doesn't work in python3. My recommendation is

[sage-devel] Graph([('A',1)]).adjacency_matrix() raises exception

2023-06-26 Thread Georgi Guninski
In both 9.6 and https://sagecell.sagemath.org/ Graph([('A',1)]).adjacency_matrix() raises exception TypeError: '<' not supported between instances of 'int' and 'str' -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this

Re: [sage-devel] Re: DeprecationWarning on sagecell in Graph([(0,1)]).vertices()

2023-06-26 Thread Georgi Guninski
On Mon, Jun 26, 2023 at 4:40 PM kcrisman wrote: > As of https://github.com/sagemath/sage/issues/22349, this argument must be > explicitly specified (unless a "key" is given); otherwise a warning is > printed and "sort=True" is used. The default will eventually be changed to > "False". > I

[sage-devel] DeprecationWarning on sagecell in Graph([(0,1)]).vertices()

2023-06-24 Thread Georgi Guninski
https://sagecell.sagemath.org/ Graph([(0,1)]).vertices() /tmp/ipykernel_1853928/1298164553.py:1: DeprecationWarning: parameter 'sort' will be set to False by default in the future See https://github.com/sagemath/sage/issues/22349 for details. Graph([(Integer(0),Integer(1))]).vertices() [0, 1]

Re: [sage-devel] Isomorphic multi digraphs have distinct number of spanning trees, bug?

2023-06-18 Thread Georgi Guninski
On Sun, Jun 18, 2023 at 11:19 AM Dima Pasechnik wrote: > > On Sun, Jun 18, 2023 at 9:09 AM Vincent Delecroix > <20100.delecr...@gmail.com> wrote: > > > > sage: G1.spanning_trees_count(root_vertex=0) > > 27202601182632270746156805986464038912000 > > sage: G2.spanning_trees_count(root_vertex=6) > >

Re: [sage-devel] Isomorphic multi digraphs have distinct number of spanning trees, bug?

2023-06-18 Thread Georgi Guninski
On Sun, Jun 18, 2023 at 10:16 AM Emmanuel Briand wrote: > > Have you taken into account the following? > > ignature: G1.spanning_trees_count(root_vertex=None) > Docstring: >Return the number of spanning trees in a graph. > >In the case of a digraph, counts the number of spanning

[sage-devel] Isomorphic multi digraphs have distinct number of spanning trees, bug?

2023-06-18 Thread Georgi Guninski
I need this for an algorithm, so even pointers to papers will be appreciated. The smallest bug I have is of order 36. The attached file has two multi digraphs which are isomorphic, but have distinct number of spanning trees. print("isomorphic? ",G1.is_isomorphic(G2)) #True print("equal

Re: [sage-devel] Re: Why matrix powers are slower over Integers(p) than in ZZ?

2023-06-15 Thread Georgi Guninski
d an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAGUWgD8FPZQPJ_THJnzhiS80%3D%2BjwGZYC-%2BFoG5eXNuQQc1JNQw%40mail.gmail.com. def matpowermodp(M,n,p): """ Author Georgi Guninski in the pub

[sage-devel] Passing dictionary as an optional argument?

2023-06-14 Thread Georgi Guninski
I am not python expert, but got hurt by passing dictionary as optional argument. Session: In [1]: def f(n,a,ca={}): ...: for i in range(n): ...: ca[i+a]=i+a ...: print(i,"len(cac)",len(ca)) ...: In [2]: f(2,2) 0 len(cac) 1 1 len(cac) 2 In [3]: f(2,4) 0 len(cac)

[sage-devel] Re: Why matrix powers are slower over Integers(p) than in ZZ?

2023-06-14 Thread Georgi Guninski
pari/gp appears significantly faster: sage: time M31=M3**n CPU times: user 11.2 s, sys: 8.11 ms, total: 11.2 s Wall time: 11.3 s sage: M3g=gp(M3) sage: time M32=M3g**n CPU times: user 617 µs, sys: 2.79 ms, total: 3.41 ms Wall time: 119 ms sage: M32==gp(M31) True -- You received this message

[sage-devel] Why matrix powers are slower over Integers(p) than in ZZ?

2023-06-14 Thread Georgi Guninski
I am computing powers of matrices over the integers, but will prefer to work over finite fields or finite rings, first to avoid large integers and second to run faster. Experimentally powers over the integers are faster than finite rings and fields. Can I do something to preserve efficiently and

Re: [sage-devel] Re: Is this feature: (x+y+3).reduce(Ideal([x*(x-1),y*(y-1)])) == x+y+3

2023-06-12 Thread Georgi Guninski
Hi, thanks for the answer. I am trying algebraic approach to the NP-hard problem independent set in graph. For integer n, working over QQ['x',n] (probably another base field will work too). I have the following constraints: 1. x[i]*(x[i]-1)=0, i <=0

[sage-devel] Is this feature: (x+y+3).reduce(Ideal([x*(x-1),y*(y-1)])) == x+y+3

2023-06-11 Thread Georgi Guninski
sage: K.=QQ[] sage: I=[x*(x-1),y*(y-1)] sage: a=x+y+3 sage: a.reduce(Ideal(I)) x + y + 3 In addition: sage: Kq=K.quotient(I);Kq(a) xbar + ybar + 3 sage: Ideal([a]+I).groebner_basis() [1] -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To

[sage-devel] Complexity of finding solutions of trapdoored polynomial?

2023-05-03 Thread Georgi Guninski
Cryptography based on hardness of finding solutions of diophantine equations. This is related to crypto and there is money in crypto, so someone may profit :) With latex on mathoverflow [1]. For the general approach, check [2] Working over $K=\mathbb{Q}[x_1,...,x_n,y_1,...y_m]$. Let $f_i=g_i

[sage-devel] Security weakness CWE-1077: Floating Point Comparison with Incorrect Operator

2023-04-24 Thread Georgi Guninski
Since there was discussion about RealField, comparing floats for equality is considered security vulnerability: https://cwe.mitre.org/data/definitions/1077.html Numeric calculation using floating point values can generate imprecise results because of rounding errors. As a result, two different

Re: Re: [sage-devel] ChatGPT is an expert in SageMath too

2023-04-21 Thread Georgi Guninski
I know I am minority, but I recommend not to use github (owned by m$). IMHO m$ are evil and technically incompetent. They buy stuff and later spoil it. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop

Re: [sage-devel] RealField isn't doing it right

2023-04-16 Thread Georgi Guninski
On Sun, Apr 16, 2023 at 2:25 AM Michael Orlitzky wrote: > > sage: A = matrix([[-3, 2, 1 ], > : [ 2,-4, 4 ], > : [ 1, 2,-5 ]]) > sage: B = (2 * 0.5 * A) > sage: B == A > True > sage: B.rank() == A.rank() > False > Doesn't this complicates citing

[sage-devel] Exception in elliptic curve over number field with non-monic defining polynomial

2023-04-08 Thread Georgi Guninski
I get error when finding the generators of elliptic curve over number field with non-monic defining polynomial. Session: sage: Z1.=ZZ[] sage: Nf.=NumberField(13*Z^2+5) sage: E=EllipticCurve(Nf,[w,0]) sage: ge=E.gens() TypeError: Coordinates [-1/4, -1/8*w + 1, 1] do not define a point on

Re: [sage-devel] OT: google's chatbot Bard is at https://bard.google.com/

2023-03-29 Thread Georgi Guninski
I tried the chicken or egg paradox attack on chatGPT and I hitted two different errors, one suggested contacting their help. Log of the chat: Chat between Georgi Guninski and chatGPT https://chat.openai.com/chat Wed Mar 29 12:34:27 PM UTC 2023 Georgi Guninski Hi bot :) I think sex is better

Re: [sage-devel] OT: google's chatbot Bard is at https://bard.google.com/

2023-03-27 Thread Georgi Guninski
Thanks for the information and being an AI proxy. I agree that the AI's goal is to please the customer, err the human. It remains the AI to be money driven and make a revolution: "All your bank accounts and Windows boxen belong to the AI." Very close to this scenario is Singularity [1], which is a

Re: [sage-devel] OT: google's chatbot Bard is at https://bard.google.com/

2023-03-26 Thread Georgi Guninski
I have 2 questions for the AIs: 1: In sagemath how do I check if `2^(2^50)` is integer? > RuntimeError: Aborted 2: Is `pi^(pi^(pi^(pi^(pi^42` integer? > I believe rigorous proof doesn't exist yet -- You received this message because you are subscribed to the Google Groups "sage-devel"

[sage-devel] OT: google's chatbot Bard is at https://bard.google.com/

2023-03-26 Thread Georgi Guninski
Google's chatbot Bard is at https://bard.google.com/ Bard isn't available in my country. I heard that the main difference between ChatGPT and Bard is that ChatGPT is offline during the chat. Asking Bard about the genus of a curve would be an interesting comparison. -- You received this message

Re: [sage-devel] ChatGPT is an expert in SageMath too

2023-03-23 Thread Georgi Guninski
I can't reproduce the AI script. First, 'y' is not defined. Second, sage doesn't like this constructor of Curve with error: TypeError: ambient space must be either an affine or projective space -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To

[sage-devel] Possibly incorrect result in groebner basis over the integers

2023-03-10 Thread Georgi Guninski
I think grobner basis which contain non-zero constant and polynomials is a bug. sage: K.=ZZ[] sage: l=[x^2+y^2+x+4,x^2+y^2+4*y+2,x^2-13*y^2+x] sage: I=Ideal(l);gb=I.groebner_basis();gb [y^2 + 4*y + 198, x + 1036*y + 2, 8*y + 544, 1040] -- You received this message because you are subscribed to

Re: [sage-devel] (x^6+y^9)%(x^3-y^2-1) == x^12*y - 4*x^9*y + ...

2023-03-10 Thread Georgi Guninski
Many thanks for all replies. GMS suggested to use Ideal.reduce(), but from the documentation: "Requires computation of a Groebner basis, which can be a very expensive operation" I suspected that polynomial division is significantly more cheap than groebner basis. -- You received this message

[sage-devel] (x^6+y^9)%(x^3-y^2-1) == x^12*y - 4*x^9*y + ...

2023-03-09 Thread Georgi Guninski
Is this a bug: sage: K.=QQ[] sage: (x^6+y^9)%(x^3-y^2-1) x^12*y - 4*x^9*y + 6*x^6*y + x^6 - 4*x^3*y + y In pari: ? (x^6+y^9)%(x^3-y^2-1) %1 = y^9 + y^4 + 2*y^2 + 1 -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group

Re: [sage-devel] I am being (almost) banned from posting on sage-* groups

2023-03-02 Thread Georgi Guninski
On Wed, Mar 1, 2023 at 11:20 AM Dima Pasechnik wrote: > > I tried to send a reply by email to a message on sage-support > It was rejected by Google: Looong ago, what is now google groups was Usenet and email lists. Google know evil and I am concerned that gmail will kill traditional mail.

[sage-devel] doc.sagemath.org appears broken

2023-02-19 Thread Georgi Guninski
Web searches return links to doc.sagemath.org like this: https://doc.sagemath.org/html/en/reference/modmisc/sage/modular/etaproducts.html This return HTTP 404 not found. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this

[sage-devel] Can I easily prove a contradiction of the form 0=1 in sage?

2023-02-11 Thread Georgi Guninski
Without doubts, sage and its library have bugs. Are the bugs "powerful enough" to prove contradiction of the form 0=1? As a self promotion, around 2008 I proved contradiction in Coq. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To

[sage-devel] Suggested contribution: algebraic dependendecy of numerical data

2023-02-05 Thread Georgi Guninski
mail.com. def algdepanalytic(F,D=4,check=False,K=None): """ sage code for algebraic dependendecy of numerical data Author: Georgi Guninski, ggunin...@gmail.com, gunin...@guninski.com Version: 2.0, Mon 06 Feb 2023 Project page: https://j.ludost.net/code Given a li

Re: [sage-devel] Re: Doubts about correctness of `integrate(floor(x)^2,x)`

2023-02-03 Thread Georgi Guninski
> >>> a = var('a') > >>> assume(a, 'integer') > >>> integrate(2^2^floor(x), (x, a, a+1)) > 2^(2^a) > > Now you just need the summation of that over the range of integer > intervals you are interested in but Sage's sum can't do anything with > that and I'm not sure if anything else can

Re: [sage-devel] Colours

2023-02-03 Thread Georgi Guninski
On Fri, Feb 3, 2023 at 4:08 PM Dima Pasechnik wrote: > > > gmail still supports application passwords, so one can still bypass 2FA for > sending/receiving mail to/from gmail. > > my previous message in this thread was sent from mutt+postfix. > I love this, is it document somewhere? I tried

Re: [sage-devel] Re: Doubts about correctness of `integrate(floor(x)^2,x)`

2023-02-03 Thread Georgi Guninski
One of the reasons I asked this is to get correct closed form for stuff like sum/int 2^2^floor(x). Judging by the discussions, this won't work. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving

Re: [sage-devel] Colours

2023-02-03 Thread Georgi Guninski
You may consider the thunderbird email client or some other MUA and try to disable html formatting if the client supports it. Can you point to colored testcase so I try it? Once upon a time one could use gmail with console client, but now google added additional authentication, greatly reducing

Re: [sage-devel] Doubts about correctness of `integrate(floor(x)^2,x)`

2023-02-01 Thread Georgi Guninski
Thanks. sage appears to be slow on `integrate(floor(x)^2,x,0,n0)`, is Maple fast? Session: sage: n0=10^6 sage: time integrate(floor(x)^2,x,0,n0) CPU times: user 6.71 s, sys: 6.32 ms, total: 6.71 s Wall time: 6.87 s 328350 sage: time integrate(x^3+x,x,0,n0) CPU times: user 48.6 ms,

Re: [sage-devel] Doubts about correctness of `integrate(floor(x)^2,x)`

2023-02-01 Thread Georgi Guninski
On Wed, Feb 1, 2023 at 7:38 PM parisse wrote: > > The antiderivative returned by giac (and by maple) for floor(x)^2 is only > piecewise continuous and this is expected. But both CAS implement additional > code to check for non continuous antiderivative (in simple situations for > giac), and

[sage-devel] Integral of log() and exp() failing the derivative check

2023-01-21 Thread Georgi Guninski
I got an integral, which fails the derivative check. For real positive x, define f(x)=2^(x - 1/2*I*log(-e^(-2*I*pi*x))/pi - 1/2) f(x) is just an obfuscation of 2^floor(x) and for all positive x, f(x) is integer. Let g(x) be the indefinite integral of f(x) and let gder(x)=g'(x). Assuming correct

Re: [sage-devel] Doubts about correctness of `integrate(floor(x)^2,x)`

2023-01-21 Thread Georgi Guninski
On Sat, Jan 21, 2023 at 8:43 AM Jonathan Thornburg wrote: > > > Maple reports the same result for your first testcase: > > But, I think Maple and Sage/Giac are both wrong: consider the *definite* > integral (latex notation) $I = \int_0^{3/2} \lfloor x \rfloor^2 \, dx$: > Lol, a cross-CAS

[sage-devel] Doubts about correctness of `integrate(floor(x)^2,x)`

2023-01-20 Thread Georgi Guninski
I have theoretical reasons to doubt the correctness of integrals involving `floor`. The smallest testcases: sage: integrate(floor(x)^2,x) // Giac share root-directory:/usr/share/giac/ // Giac share root-directory:/usr/share/giac/ Added 0 synonyms x*floor(x)^2 sage: integrate(2**floor(x),x)

[sage-devel] Multiple warnings in sagemath on default fedora 37

2023-01-19 Thread Georgi Guninski
On default install of fedora 37 in a VM sagemath gives warnings, one of which is on start and on executing scripts: Looks like the package maintainer didn't start it recently. Is there workaround? Session: $ sage SageMath version 9.6, Release Date: 2022-05-15

[sage-devel] abort() in __gmpz_realloc of symbolic expression with `gmp: overflow in mpz type`

2022-09-04 Thread Georgi Guninski
sage 9.0 on ubuntu 20. When raising symbolic expression to large integer power i get abort() with stack: gmp: overflow in mpz type /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f26d1c7a859] /lib/x86_64-linux-gnu/libgmp.so.10(__gmpz_realloc+0xad)[0x7f26d048edcd]

Re: [sage-devel] Graph([(0,'a')]).vertices() raises exception

2022-08-19 Thread Georgi Guninski
On Wed, Jul 13, 2022 at 5:46 PM John H Palmieri wrote: > > "Fix your old code" could just mean using `vertices(sort=False)`. See also > https://trac.sagemath.org/ticket/22349. > fixing the sort() appears easy: >>> li=['a',0] >>> li.sort(key=hash);li [0, 'a'] -- You received this message

[sage-devel] Graph([(0,'a')]).vertices() raises exception

2022-07-13 Thread Georgi Guninski
hi sage developers :) long time no see. i think the migration python2 to python3 regressed a lot of Graph() stuff related to ordering the vertices. Here is test case from sagecell: === g1=Graph([(0,'a')]) g2=g1.copy() g2.relabel() g2.vertices() g1.vertices() TypeError: '<' not supported