Thanks, Now I'm trying to apply the Chinese Theorem Remainder after the
code, then .... I defined

q = X^18 + a*X^15 + a*X^12 + X^11 + (a + 1)*X^2 + a
r = a^3*X^3 + (a^3 + a^2 + a)*X^2 + (a^2 + 1)*X + a^3 + a^2 + a
#p,q and r are relatively prime
and I'm trying ...
crt([(A\b)[0],(A\b)[1],(A\b)[2]],[p,q,r])

but I get

 File "element.pyx", line 344, in
sage.structure.element.Element.__getattr__ (sage/structure/element.c:3871)
  File "misc.pyx", line 251, in
sage.structure.misc.getattr_from_other_class (sage/structure/misc.c:1606)
AttributeError: 'PolynomialQuotientRing_field_with_category.element_class'
object has no attribute 'quo_rem'

When I maked the similar to integers that crt works fine, but in this case
not. I'm thinking that problem is the change Xbar to X

Here my complete example to integers

from numpy import arange, eye, linalg
#2x-3y+2z=21
#x+4y-z=1
#-x+2y+z=17
A = matrix([[2,-3,2],[1,4,-1],[-1,2,1]])
b=vector([21,1,17])
p=[17,11,13]
d=det(A)
dlist=[0,0,0]
ylist=matrix(IntegerModRing(p[i]),[[2,-3,2],[1,4,-1],[-1,2,1]])\vector(IntegerModRing(p[i]),[21,1,17])
p1=[int(ylist[0]),int(ylist[1]),int(ylist[2])]
CRT(p1,p)


2013/10/23 Ivan Andrus <darthand...@gmail.com>

> Do you mean something like:
>
> R.<Xbar> = PR.quotient(PR.ideal(p))
> # change your formulas to Xbar instead of X
> A \ b
> # ==> (a^3 + a, a^2, (a^3 + a^2)*Xbar^2 + (a + 1)*Xbar + a^3 + a)
>
> -Ivan
>
> On Oct 23, 2013, at 1:14 PM, Juan Grados <juan...@gmail.com> wrote:
>
> Yes, but p(x) is fixed polynomial here my code
>
> m = 4;delta = 3;N = 2^m
> K_.<a> = GF(2);
> F.<a> = GF(2^m)
> PR = PolynomialRing(F,'X')
> X = PR.gen()
> a11 = (a^2)*(X^3)+(a^11)*(X^2)+1
> a12 = (a)*(X^4)+(a^13)*(X^3)+X+1
> a13 = X^2+(a^13)*(X^3)+a*(X^2)+1
> a21 = X^3
> a22 = X+a
> a23 = X^2+X^3+a*X
>  a31 = (a^12)*X+a*(X^2)
> a32 = (a^8)*(X^2)+X^2+X^3
> a33 = a*X + (a^2)*(X^3)
> A = matrix([[a11,a12,a13],[a21,a22,a23],[a31,a32,a33]])
> b =
> vector([(a^6)*(X^14)+X^13+X,a*(X^2)+(X^3)*(a^11)+X^2+X+a^12,(a^8)*(X^7)+a*(X^2)+(a^12)*(X^13)+X^3+X^2+X+1])
> p = (a^2 + a)*X^3 + (a + 1)*X^2 + (a^2 + 1)*X + 1
>
> I need
>
> matrix(PolynomialModRing(p),A)\vector(PolynomialModRing(p),b)
>
> but PolynomialModRing not exist ...
>
>
> 2013/10/23 John Cremona <john.crem...@gmail.com>
>
>> On 23 October 2013 19:50, Juan Grados <juan...@gmail.com> wrote:
>> > Is there in sage, any instruction to solve a linear system equations
>> > module p(x) (polynomial over finite field), where the system
>> coefficients
>> > are polynomials over finite field?. I know that for integers exists,
>> example
>> > (thanks Purkayastha)
>> >
>> > sage: I6 = IntegerModRing(6)
>> > sage: M = random_matrix(I6, 4, 4)
>> > sage: v = random_vector(I6, 4)
>> > sage: M \ v
>> > (4, 0, 2, 1)
>> >
>>
>> You could try doing exactly the same thing, and it works:
>>
>> sage: R.<x> = PolynomialRing(GF(17))
>> sage: M = random_matrix(R, 4, 4)
>> sage: v = random_vector(R,4)
>> sage: M \ v
>> ((12*x^8 + 10*x^7 + 11*x^6 + 7*x^5 + 10*x^4 + 16*x^3 + 11*x^2 + 6*x +
>> 13)/(x^8 + 15*x^7 + 8*x^6 + 5*x^5 + 15*x^4 + 14*x^3 + x^2 + 4*x),
>> (2*x^8 + 8*x^7 + 2*x^6 + 11*x^5 + 12*x^4 + 15*x^3 + 5*x^2 + 3*x +
>> 5)/(x^8 + 15*x^7 + 8*x^6 + 5*x^5 + 15*x^4 + 14*x^3 + x^2 + 4*x),
>> (12*x^8 + 3*x^7 + 12*x^6 + 10*x^5 + 14*x^4 + 7*x^3 + 7*x^2 + 7*x +
>> 10)/(x^8 + 15*x^7 + 8*x^6 + 5*x^5 + 15*x^4 + 14*x^3 + x^2 + 4*x),
>> (14*x^8 + 6*x^7 + 12*x^6 + 13*x^5 + 4*x^4 + 13*x^3 + 8*x^2 + 5*x +
>> 3)/(x^8 + 15*x^7 + 8*x^6 + 5*x^5 + 15*x^4 + 14*x^3 + x^2 + 4*x))
>>
>> John Cremona
>>
>> > thanks
>> >
>> > --
>> > ---------------------------------------------------------------------
>> > MSc. Juan del Carmen Grados Vásquez
>> > Laboratório Nacional de Computação Científica
>> > Tel: +55 24 2233-6260
>> > (http://www.lncc.br/)
>> > http://juaninf.blogspot.com
>> > ---------------------------------------------------------------------
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "sage-support" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an
>> > email to sage-support+unsubscr...@googlegroups.com.
>> > To post to this group, send email to sage-support@googlegroups.com.
>> > Visit this group at http://groups.google.com/group/sage-support.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to sage-support+unsubscr...@googlegroups.com.
>> To post to this group, send email to sage-support@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sage-support.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> ---------------------------------------------------------------------
> MSc. Juan del Carmen Grados Vásquez
> Laboratório Nacional de Computação Científica
> Tel: +55 24 2233-6260
> (http://www.lncc.br/)
> http://juaninf.blogspot.com
> ---------------------------------------------------------------------
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
---------------------------------------------------------------------
MSc. Juan del Carmen Grados Vásquez
Laboratório Nacional de Computação Científica
Tel: +55 24 2233-6260
(http://www.lncc.br/)
http://juaninf.blogspot.com
---------------------------------------------------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to