ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 02 Oct 2020 01:48:21 +0200Crash with polynomial over "Givaro" finite fieldhttps://ask.sagemath.org/question/53696/crash-with-polynomial-over-givaro-finite-field/I would like to solve a system of equations
in a finite field of prime order $p$
(illustrated below with $p = 229$).
The system consists in four equations and has four unknowns
$a_0$, $a_1$, $a_2$, $a_3$.
It depends on parameters $\alpha_i$, $b_i$, all in $F(p)$,
for $i = 1, 2, 3, 4$.
The four equations are
$$a_0 + a_1 \alpha_1 + a_2 \alpha_1^2 + a_3 \alpha_1^3 = b_1$$
$$a_0 + a_1 \alpha_2 + a_2 \alpha_2^2 + a_3 \alpha_2^3 = b_2$$
$$a_0 + a_1 \alpha_3 + a_2 \alpha_3^2 + a_3 \alpha_3^3 = b_3$$
$$a_0 + a_1 \alpha_4 + a_2 \alpha_4^2 + a_3 \alpha_4^3 = b_4$$
To do this I have tried with the following examples:
pm = 229
bp = 229
F.<x> = GF(pm, impl='givaro')
R.<a0, a1, a2, a3> = PolynomialRing(F)
def NP(a):
return F(ZZ(a).digits(bp)) # integer to polynomial
eqns = [a0 + a1*NP(2) + a2*NP(2)^2 + a3*NP(2)^3 - NP(78),
a0 + a1*NP(3) + a2*NP(3)^2 + a3*NP(3)^3 - NP(136),
a0 + a1*NP(4) + a2*NP(4)^2 + a3*NP(4)^3 - NP(179),
a0 + a1*NP(5) + a2*NP(5)^2 + a3*NP(5)^3 - NP(166)]
A = matrix(F, [[eqn.coefficient(b) for b in R.gens()] for eqn in eqns])
b = vector(F, [-eqn.constant_coefficient() for eqn in eqns])
X = A.solve_right(b)
print(X)
But it shows erros:
Unhandled SIGSEGV: A segmentation fault occurred.
This probably occurred because a *compiled* module has a bug
in it and is not properly wrapped with sig_on(), sig_off().
Python will now terminate.
------------------------------------------------------------------------
/usr/share/sagemath/bin/sage-python: line 2: 7655 Segmentation fault (core dumped) sage -python "$@"
How can I fix this?MKSFri, 02 Oct 2020 01:48:21 +0200https://ask.sagemath.org/question/53696/could someone please try this integral? segmentation fault generatedhttps://ask.sagemath.org/question/42717/could-someone-please-try-this-integral-segmentation-fault-generated/Could someone please try this integral on their PC? I am getting sage core dump from it.
Wanted to see if it just my sage or if it happens to others. Make sure to save your sage work before trying this.
>sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.3.beta6, Release Date: 2018-06-17 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage: var('x m a b')
(x, m, a, b)
sage: integrate(x^m/sqrt(a + b*x^(2 - m)),x)
;;;
;;; Detected access to protected memory, also kwown as 'bus or segmentation fault'.
;;; Jumping to the outermost toplevel prompt
;;;
When I use other algorithm, no core dump
sage: integrate(x^m/sqrt(a + b*x^(2 - m)),x,algorithm="giac")
integrate(x^m/sqrt(b*x^(-m + 2) + a), x)
I am on Linux Manjaro 17.1. Intel PC. Installed sage, compiled from sources, using Manjaro package manager pacman.
And just in case, I also posted bug report here https://trac.sagemath.org/ticket/25636
Thank you
--NasserNasserFri, 22 Jun 2018 22:25:30 +0200https://ask.sagemath.org/question/42717/integral() failing with "segmentation fault"https://ask.sagemath.org/question/10966/integral-failing-with-segmentation-fault/Hi sage community
My question again arises from exercises in technical chemistry done in sage. I wanted to calculate an definite integral (number of transfer units).
var('x')
ys=0.06+2*(x-0.0275)
xs=ys/1.516
#my function
i=1/(xs/(1+xs)-x/(1+x))
#print i
#show(plot(i,x,0,0.03))
#I, the indefinite integral of i
I=integral(i,x)
#print I
#show(plot(I,x,0,0.03))
#three methods too calculate the integral
print n(I(x=0.0275)-I(x=0))
print numerical_integral(i,0,0.0275)
print integral(i,x,0,0.275)
The first two methods work fine. The last method gives me the infinite of the following messages.
;;;
;;; Detected access to protected memory, also kwown as 'bus or segmentation fault'.
;;; Jumping to the outermost toplevel prompt
;;;
This is a bug, isn't it? However, i have no idea how integrate() works.
Greetings, marvmarvMon, 27 Jan 2014 10:37:16 +0100https://ask.sagemath.org/question/10966/