Ask Your Question

MKS's profile - activity

2024-04-22 20:21:17 +0200 received badge  Famous Question (source)
2024-02-19 16:53:43 +0200 edited question Plot a 3D figure with different colors of a System of three Equations using SageMath

Plot a 3D figure with different colors of a System of three Equations using SageMath Variable Definition: Three variabl

2024-02-19 16:52:22 +0200 edited question Plot a 3D figure with different colors of a System of three Equations using SageMath

Plot a 3D figure with different colors of a System of three Equations using SageMath Variable Definition: Three variabl

2024-02-19 16:31:26 +0200 edited question Plot a 3D figure with different colors of a System of three Equations using SageMath

Plot a 3D figure with different colors of a System of three Equations using SageMath Variable Definition: Three variabl

2024-02-19 16:26:34 +0200 asked a question Plot a 3D figure with different colors of a System of three Equations using SageMath

Plot a 3D figure with different colors of a System of three Equations using SageMath Variable Definition: Three variabl

2024-02-19 15:57:06 +0200 edited question Plot a 3D figure with different colors of a System of three Equations using SageMath

Plot a 3D figure of a System of three Equations using SageMath # Define variables x, y, z = var('x,y,z') # Define equat

2024-02-19 15:28:10 +0200 asked a question Plot a 3D figure with different colors of a System of three Equations using SageMath

Plot a 3D figure of a System of three Equations using SageMath # Define variables x, y, z = var('x,y,z') # Define equat

2023-12-07 20:59:41 +0200 received badge  Notable Question (source)
2023-04-05 18:21:33 +0200 received badge  Popular Question (source)
2022-04-23 08:23:28 +0200 received badge  Notable Question (source)
2022-01-21 04:32:07 +0200 commented answer How to skip solution which doe not exists in a system of equations?

@MaxAlekseyev Thank you very much for your answer.

2022-01-20 18:01:43 +0200 edited question How to skip solution which doe not exists in a system of equations?

How to skip solution which doe not exists in a system of equations? I would like to solve system of equations which take

2022-01-20 18:00:18 +0200 asked a question How to skip solution which doe not exists in a system of equations?

How to skip solution which doe not exists in a system of equations? I would like to solve system of equations which take

2021-11-02 15:15:08 +0200 received badge  Popular Question (source)
2021-08-17 19:59:08 +0200 received badge  Popular Question (source)
2021-01-25 18:04:36 +0200 commented answer Arithmetic operation is not working in finite field GF(4091^2)?

@ tmonteil What is the solution then?

2021-01-25 14:31:08 +0200 asked a question Arithmetic operation is not working in finite field GF(4091^2)?

I am facing problem during arithmetic operation in $ GF(4091^2)$. But everything working fine in $ GF(13^2)$ as

Var('x')
F.<x> = GF(13^2)
a=F.fetch_int(150)+F.fetch_int(97)
print a

How can I fix this?

2021-01-25 13:35:17 +0200 asked a question How to do arithmetic operation of elements in finite field?

Let us consider an example:

Var('x')
F.<x> = GF(13^2)

We consider two elements 2*x + 11, 3*x + 2 corresponding to the integers 37 and 41 respectively. Now we can operate them as

a=F.fetch_int(37)+F.fetch_int(41)
m=F.fetch_int(37)*F.fetch_int(41)

We have a=4*x + 10 , m= 4*x + 10

In reverse way we can get the corresponding integers as :

ai=a.integer_representation()
mi=m.integer_representation()

That is, ai=65, mi=62

How can I do the same for the field GF(251) using the same function?

2021-01-25 09:02:29 +0200 received badge  Associate Editor (source)
2021-01-25 03:23:09 +0200 asked a question Solve system of equations in a finite field

I would like to generate and solve a system of equations in both GF(251) and GF(13^2) using the same function.

Let us illustrate it in $GF(251)~ [or~ GF(13^2)]$,

Equation construction part:
$\phi(x)=a_0+a_1x+a_2x^2$, where $a_0,a_1,a_2\in GF(251) ~[or~ GF(13^2)]$.

Solve system of equations:
$a_0+a_1.\alpha_1++a_2.\alpha_1^2=\phi(\alpha_1)$
$a_0+a_1.\alpha_2++a_2.\alpha_2^2=\phi(\alpha_2)$
$a_0+a_1.\alpha_3++a_2.\alpha_3^2=\phi(\alpha_3)$
where $\alpha_1,\alpha_2,\alpha_3\in GF(251) ~[or~ GF(13^2)]$.

MWE: Case -I : $GF(251)$
Choose $(a_0,a_1,a_2)=(5,123,49)\in GF(251)$. $(\alpha_1,\alpha_2,\alpha_3)=(1,2,3)\in GF(251)$. Then
$\phi(x)=5+123x+49x^2$, and the system of equations becomes
$a_0+a_1.1++a_2.1^2=\phi(1)=177$
$a_0+a_1.2++a_2.2^2=\phi(2)=196$
$a_0+a_1.3++a_2.3^2=\phi(3)=62$

Case -II : $GF(13^2)$
Choose $(a_0,a_1,a_2)=(5,123,49)=(5, 9x + 6, 3x + 10) \in GF(13^2)$. $(\alpha_1,\alpha_2,\alpha_3)=(1,2,3)\in GF(13^2)$. Then
$\phi(x)=5+(9x + 6)x+(3x + 10)x^2$ and the system of equations becomes
$a_0+a_1.1++a_2.1^2=\phi(1)=12x + 8$
$a_0+a_1.2++a_2.2^2=\phi(2)=4
x + 5$
$a_0+a_1.3++a_2.3^2=\phi(2)=2*x + 9$

How can I do the above using the same function for the both filed $GF(251)$ and $GF(13^2)$?

2021-01-20 10:52:20 +0200 asked a question How to index all elements of a finite field?

I would like to assign an integer corresponding to element of a finite field $GF(p^m)$, where $p^m\in[ {13^2,3^5, 131,137,139,251}] $
MWE:

 F.<x> = GF(3^5, impl='givaro')

THe elements of GF(3^5) are 0,1,2,x,x^2 etc, we would like to indexing each element such as $0-->0, 1-->1,2-->2,x-->3, x^2--4$ etc. Not only that, if I call any element for example if I call x^2 it should rerun 4 and conversely.

This process should work for the field order prime $p^m, m=1$ also. How can I do this?

2020-11-30 10:58:41 +0200 commented answer Error: No module named 'sagenb'

@ JohnPalmieri I did according to you, but shows access denied: Access to the file was deniedThe file at file:///home/mks/.local/share/jupyter/runtime/nbserver-9493-open.html is not readable. It may have been removed, moved, or file permissions may be preventing access. ERR_ACCESS_DENIED

2020-11-30 04:22:19 +0200 commented answer Error: No module named 'sagenb'

@ EmmanuelCharpentier BUt it does not solve my problem how to fix it?

2020-11-29 12:24:26 +0200 asked a question Error: No module named 'sagenb'

SageMath is not working on Ubuntu 20.04. When I am going to open notebook interface it show the following errors:

https://imgur.com/a/aQQkUSQ

How can I fix this?

2020-10-30 12:02:16 +0200 commented answer Crash with polynomial over "Givaro" finite field

@ tmonteil Is there any package instead of "givaro" which has no bug?

2020-10-02 01:48:21 +0200 asked a question 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?

2020-09-19 14:00:05 +0200 marked best answer How to express elements in a field of prime order and power of a prime order using the same function?

When field size is of the form $p^m$, where $p$ is a prime and $m>1$ is a positive integer, there is no problem. For example

F.<x> = GF(5^2)
print F.fetch_int(4)

It outputs : 4.

But if we take field size is in the form $p^1$, then the above code does not working. For example

F.<x> = GF(5^1)
print F.fetch_int(4)

It gives errors. How can I fix this using the same function in both the cases?