Alec Mihailovs

Dr. Aleksandrs Mihailovs

4470 Reputation

21 Badges

20 years, 18 days
Mihailovs, Inc.
Owner, President, and CEO
Tyngsboro, Massachusetts, United States

Social Networks and Content at Maplesoft.com

Maple Application Center

I received my Ph.D. from the University of Pennsylvania in 1998 and I have been teaching since then at SUNY Oneonta for 1 year, at Shepherd University for 5 years, at Tennessee Tech for 2 years, at Lane College for 1 year, and this year I taught at the University of Massachusetts Lowell. My research interests include Representation Theory and Combinatorics.

MaplePrimes Activity


These are replies submitted by Alec Mihailovs

@acer 

I've just looked at your favorites and the 2nd page was almost exactly the same as the 1st one (the difference was at the bottom where number 2 was higlighted instead of number 1 for the page number.)

Alec

"The the" over the editor is still not fixed.

Alec

@PatrickT 

Same thing (text disappearing) happened to me in this comment (I am retyping it now) and in my last comment in the "A silent upgrade" thread.

The next time I'll just type one letter, submit the message, and then edit it. But there are some people (with low scores) who can't edit their posts if I remember correctly. They won't be able to post anything in this situation.

Alec

PS Actually, I've just noticed that I have the "Edit" link under everybody's messages - so it seems as if I am able to edit anybody's posts now, and you, Patrick, probably, too - maybe that makes the difference for our own messages, and people without that feature may be not affected. -Alec

Hi Alec, I think you're right, it seems that I can edit your message, let's see...

@Christopher2222 

I didn't mean that I wanted it.

You could still offer to share yours one (as Axel Vogt did with his Commenter badge.)

Alec

@pvrbik 

None of the built-in commands will work with matrices of these sizes in pure Maple and/or NAG. In Linbox - maybe, but also doubtful.

Alec

@pvrbik 

None of the built-in commands will work with matrices of these sizes in pure Maple and/or NAG. In Linbox - maybe, but also doubtful.

Alec

Trace is a linear function from F considered as a vector space over its prime subfield Fp, to Fp, so one can calculate it on the basis, and then evaluate it through dot product. In the field F used as an example in this thread, that can be done as

tr:=LinearAlgebra:-Modular:-Mod(2,Vector[row](100,
    [seq(F:-ConvertOut(F:-trace(F:-ConvertIn(_Z^i))),i=0..99)]),integer[]):

Ftrace:=x->F:-ConvertIn(LinearAlgebra:-Modular:-Multiply(2,tr,
    LinearAlgebra:-Modular:-Mod(2,Vector(100,[op(x)]),integer[])));

It works more than 20 times faster than F:-trace and uses much less memory,

A:=[seq(F:-ConvertIn(_Z^i),i=0..10000)]:

v:=CodeTools:-Usage(map(F:-trace,A)):
memory used=2.52GiB, alloc change=0 bytes, cpu time=21.75s, real time=21.85s

v1:=CodeTools:-Usage(map(Ftrace,A)):
memory used=40.04MiB, alloc change=0 bytes, cpu time=0.87s, real time=0.89s

evalb(v=v1);
                                 true

Vector tr used in the definition of Ftrace can be constructed without using F:-trace as

tr1:=LinearAlgebra:-Modular:-Mod(2,Vector[row](100,
    [seq(evala(Trace(a^i,a)) mod 2,i=0..99)]),integer[]):

Or, using Newton's identities, as

f:=expand(_Z^100*eval(op(a),_Z=1/_Z)):

tr2:=LinearAlgebra:-Modular:-Mod(2,Vector[row](100,
    PolynomialTools:-CoefficientList(convert(series(
    100-diff(f,_Z)*_Z/f,_Z,100) mod 2,polynom),_Z)),integer[]):

evalb([seq(i,i=tr)]=[seq(i,i=tr1)]);

                                 true

evalb([seq(i,i=tr)]=[seq(i,i=tr2)]);

                                 true

Alec

PS It can be made even more efficient in characteristic 2,

trA:=[ListTools:-SearchAll](1,[seq(i,i=tr)]):

Ftrace2:=proc(x) local i,s; s:=0; try for i in trA do s:=s+op(i,x) od; 
catch: finally if s::even then F:-zero else F:-one fi end end:

v2:=CodeTools:-Usage(map(Ftrace2,A)):
memory used=1.03MiB, alloc change=0 bytes, cpu time=0.34s, real time=0.35s

evalb(v=v2);
                                 true

Alec

@acer 

I think that's great!

Alec

p(x0,p0,m0,x1,p1,m1,x) is a function f of x (an expression actually which can be a number if x is numeric) such that f(x0)=p0, f(x1)=p1, f'(x0)=m0, f'(x1)=m1.

pb and pe are similar - just pb doesn't input the derivative at x0 and pe doesn't input the derivative at x1 - they are used at the beginning and at the end of the plot. Also, they are quadratic functions of x while p is cubic.

df(L) with L being a 2-dimensional Array of 3 or more points, supposedly ordered by their first coordinates, calculates suggested derivatives for the "exact" interpolation, so that the derivatives at local maximums and minimums are 0, and other derivatives are calculated as the slopes of the lines connecting closest neighbors from the rhs and from the lhs of a point. The values at the beginning and at the end are set to 0, which doesn't matter if pb and pe are used at the beginning and at the end.

Chris(L,X) , with L being a 2-dimensional Array of 3 or more points, sorted in ascending order of their first coordinates, produces a piecewise function f of X (or its value if X is numeric) such that f(L[k,1])=L[k,2], with derivatives at the k-th point given by df(L). This function is a combination of pb on the first interval, pe at the end, and p on the other intervals (between the first one and the last one).

The df could be calculated differently, perhaps. One possible way is to calculate the suggested derivatives being the average values between the slopes of 2 lines connecting the point with its rhs and lhs neighbors - I didn't try that.

The number of points in L (which should be at least 3) is not checked - one has to add such checks to df and to Chris procedures, with producing a straight line for 2 points, and, perhaps, a constant for 1 point, and, maybe, a constant 0 for 0 points, if one would want to save them for future usage.

Alec

@hubertbauer 

You have to use print to plot them - as in print(plot...

The same with results - you can also ?print them - print(A...

Also, ?userinfo can be used.

Alec

@hubertbauer 

You have to use print to plot them - as in print(plot...

The same with results - you can also ?print them - print(A...

Also, ?userinfo can be used.

Alec

Representing univariate polynomials over F through modp2 makes their multiplication much faster. That can be used for constructing a minimal polynomial using conjugates as follows,

minpolyGF:=proc(x,y:=_X)
local i;
foldl((a,b)->modp2(Add(map(F:-`*`,a,b),Shift(a,1)),2),
modp2(One(y,_Z),2),seq(i,i=AConj(x)))
end;

use F in minpolyGF(z^n,x) end;
                                            2
                         (1) + (1) x + (1) x

CodeTools:-Usage(seq(minpolyGF(F:-`^`(z,k)),k=1..1000)):
memory used=13.90GiB, alloc change=0 bytes, cpu time=2.29m, real time=2.30m

It is still much less efficient than MinPolyGF or MinPolyGF1, but much better than minpolGF using multiplication of polynomials represented through RootOf.

Alec

@james1482 

One thing that could be done rather easily, I think, would be adding a procedure GFx similar to GF representing polynomials with coefficients in a finite field using modp2 - that would make their multiplication much faster than with using RootOf (replacing modp1/Multiply with F:-`*` in modp2/Multiply) . Recent posts on this site seem to show an interest in such things.

It could work as GFx(F) with F created by GF, or GFx(F,x) with x being the variable.

Alec

@hild2959

For example,

A := Matrix(3,4,`+`);

                            [2    3    4    5]
                            [                ]
                       A := [3    4    5    6]
                            [                ]
                            [4    5    6    7]

f:=(a,x,b)->a*x+b:

Matrix(map(f,[LinearAlgebra:-Column(A,[1..-1])],x,<1,2,3>));

              [2 x + 1    3 x + 1    4 x + 1    5 x + 1]
              [                                        ]
              [3 x + 2    4 x + 2    5 x + 2    6 x + 2]
              [                                        ]
              [4 x + 3    5 x + 3    6 x + 3    7 x + 3]

Alec

@hild2959

For example,

A := Matrix(3,4,`+`);

                            [2    3    4    5]
                            [                ]
                       A := [3    4    5    6]
                            [                ]
                            [4    5    6    7]

f:=(a,x,b)->a*x+b:

Matrix(map(f,[LinearAlgebra:-Column(A,[1..-1])],x,<1,2,3>));

              [2 x + 1    3 x + 1    4 x + 1    5 x + 1]
              [                                        ]
              [3 x + 2    4 x + 2    5 x + 2    6 x + 2]
              [                                        ]
              [4 x + 3    5 x + 3    6 x + 3    7 x + 3]

Alec

3 4 5 6 7 8 9 Last Page 5 of 180