[sage-support] Re: MILP using Sage

2020-07-07 Thread chandra chowdhury
) p.add_constraint(x[1],min=1) print p.show() print p.solve() A=p.get_values(x) print A On Mon, Jul 6, 2020 at 11:06 PM chandra chowdhury wrote: > Hi, > I am trying to solve MILP using Sage. Problem is if there is no solution > it gives an error. Instead of an error, I want

[sage-support] MILP using Sage

2020-07-06 Thread chandra chowdhury
Hi, I am trying to solve MILP using Sage. Problem is if there is no solution it gives an error. Instead of an error, I want to change constraints (like if initial max=100 which does not give solution, new max=101 which may give solution) and run the solver automatically. p =

[sage-support] Solve equation efficiently

2019-07-24 Thread chandra chowdhury
I have matrices B and C of size (m,n) over integer with m>n. I know there is matrix A of size (m,m) such that AB=C. How to find A efficiently in Sage? -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop

[sage-support] Polynomial over prime field

2019-06-17 Thread chandra chowdhury
Hi, I have multi variable polynomial over integers say f(x,y,z). I want to define it over GF(5) efficiently. For that I am doing this: R=PolynomialRing(GF(5), 3, 'X') Z = list(R.gens()) But g=R(f(Z)) is not working. -- You received this message because you are subscribed to the Google

[sage-support] How to find one element of residue field as a vector over base field

2019-05-15 Thread chandra chowdhury
Dear all, I have written the following code: K. = FunctionField(GF(2)); R. = K[] L. = K.extension(y^2 +y+x+1/x) print L.places(2) p = L.places(2)[1] print p G=p.divisor() LG=G.basis_function_space() print LG Output is as follows: [Place (x^2 + x + 1, x*y + 1), Place (x^2 + x + 1, x*y

[sage-support] How to find coordinate vector

2019-02-22 Thread chandra chowdhury
Hi, I take two vectors as follows: R=[(1, 3), (1, 0)] Then I span it over integers like R=(ZZ^2).span(R) It is clear that vector([0,3]) is in R. I want to find corresponding coordinates i.e, (1,-1). How can I find this using Sage? Instead of integers, is it possible to span over the ring

[sage-support] Period of a sequence

2018-12-09 Thread chandra chowdhury
I have a sequence which I stored in an array. I want to find the period of the sequence. But the following code gives error. S=[1,2,3,1,2,3] S=Sequence(S) print S.period() -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from

[sage-support] Define variables over ring

2018-08-06 Thread chandra chowdhury
I have a ring like this R1 = IntegerModRing(5) R=R1.cartesian_product(R1) How to define variables x,y,z over R? R2.=R[] is not working. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails

[sage-support] Parallel computation in Sage

2018-07-15 Thread chandra chowdhury
I want to calculate the determinant of a large matrix with large entries. So it is taking time. In my machine, I have 32 CPUs. Is it possible in Sage to use all CPUs parallelly to find the determinant? -- You received this message because you are subscribed to the Google Groups "sage-support"

[sage-support] Problem in new Sage version

2018-07-06 Thread chandra chowdhury
Initial version of Sage this worked perfectly *V=BooleanPolynomialRing(GF(2),49,['x%d'%(i) for i in range(1,49)]+['Z'])* But now I am getting error. My version is 7.4 Error is as follows: Traceback (click to the left of this block for traceback) ... TypeError:

[sage-support] Computing basis of Riemann Roch space

2018-05-13 Thread chandra chowdhury
I am trying to find the basis of Riemann Roch space. But I am getting following error. 1 33 (x, y - 1) + (x, y + 1) + (x - 2, y - 21) + (x - 3, y - 17) + (x - 3, y + 17) + (x - 20, y + 18) + (x + 17, y + 4) + (x + 14, y - 9) + (x + 11, y + 11) + (x + 8, y + 13) + (x + 7, y + 9) Traceback (click

[sage-support] Polynomial factorization over modular ring

2017-08-15 Thread chandra chowdhury
Is it possible to factor polynomials completely over modular ring? Like x = var('x') factor(x^5-x, IntegerModRing(25)['x']) gives (x-1)*(x+1)*(x^2+1)*x but the actual factorization is x*(x-1)*(x+1)*(x-7)*(x+7) -- You received this message because you are subscribed to the Google Groups

[sage-support] Cardinality of an ideal

2017-04-03 Thread chandra chowdhury
Dear all, How to find the cardinality of an ideal ? For example, consider the ideal I generated by over the ring Z_8[x]/(x^6+3*x^5+1). I want to find the cardinality of I. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To

[sage-support] BKZ algorithm in Lattice

2017-01-16 Thread chandra chowdhury
Hi, when I am running BKZ algorithm for Lattice dimension more than 200 I am getting RuntimeError: Aborted. Entries are 4000 bits integers. I am using the following code M=M.BKZ(block_size=20,fp="ld" ). -- You received this message because you are subscribed to the Google Groups

[sage-support] Randomness test

2016-11-03 Thread chandra chowdhury
Hi, I have sequence like {57, 44, 40, 57, 50, 53, 17, 24, 20, 3, 8, 51, 62, 56, 2, ..}, where each value is between 0 to 63. I want to check its randomness. Is there any function in Sage for this? -- You received this message because you are subscribed to the Google Groups

[sage-support] Lattice reduction over Ring

2016-07-08 Thread chandra chowdhury
Hi, I have lattice L generated by row vectors (1,1,2), (1,2,1) & (4,5,1) over Z_7. It is clear that (4,5,1)-3*(1,1,2)-(1,2,1)= (0,0,1) over Z_7. So (0,0,1) is on the Lattice L. Is it possible to find the shortest vector of L in Sage? Norm is normal Euclidean norm. Is there any concept of LLL