Downloaded the padic.spad from github and made the recommended modifications (moving up lines with getExpon and getZp) and compiled.
In addition, the attached file, als.input, was also modified per the following:
pR := PAdicRational(11)
pI := PAdicInteger(11)
ll := [[[10, 7], [3, 8]], [[9, 2], [5, 1]]]
AP := ALGSC(pR, 2, ['A, 'B], ll)
qF := Fraction(Integer)
BP := ALGSC(qF, 2, ['A, 'B], ll)
V := basis()$AP
(A, B) := (V(1), V(2))
gen_digs2(d1 : Stream(Integer), d2 : Stream(Integer)) : Stream(BP) ==
(delay$Stream(BP))(
() : Stream(BP) +->
ed1 := empty?(d1)
ed2 := empty?(d2)
ed1 and ed2 => empty()$Stream(BP)
c1 : Integer
if ed2 then
c1 := 0
else
c1 := frst(d1)
d1 := rst(d1)
c2 : Integer
if ed2 then
c2 := 0
else
c2 := frst(d2)
d2 := rst(d2)
bv := represents(vector([c1::qF, c2::qF]))$BP
cons(bv, gen_digs2(d1, d2))
)
my_pr(n : Integer) : OutputForm == 11::OutputForm ^ (n::OutputForm)
mS := ModuleTaylorSeries(qF, BP, my_pr)
dW(x) == digits(retract(x)@pI)
pds(W : AP) : mS ==
cW := coordinates(W)
series(gen_digs2(dW(cW(1)), dW(cW(2))))$mS
Here are a few examples of the applications of pds on vectors:
(14) -> D : AP := 654 * A + 488 * B
2 2
(14) (4 + 4 11 )B + (5 + 4 11 + 5 11 )A
(15) -> typeOf(D)
(15)
AlgebraGivenByStructuralConstants(PAdicRational(11),2,[A,B],[[[10,7],[3,8]],[
[9,2],[5,1]]])
(16) ->
(16) -> pds(D)
Compiling function dW with type PAdicRational(11) -> Stream(Integer)
Compiling function gen_digs2 with type (Stream(Integer), Stream(
Integer)) -> Stream(AlgebraGivenByStructuralConstants(Fraction(
Integer),2,[A,B],[[[10,7],[3,8]],[[9,2],[5,1]]]))
Compiling function pds with type AlgebraGivenByStructuralConstants(
PAdicRational(11),2,[A,B],[[[10,7],[3,8]],[[9,2],[5,1]]]) ->
ModuleTaylorSeries(Fraction(Integer),
AlgebraGivenByStructuralConstants(Fraction(Integer),2,[A,B],[[[10
,7],[3,8]],[[9,2],[5,1]]]),theMap(*1;my_pr;1;frame1))
1 2
(16) 4 B + 5 A + 4 A 11 + (4 B + 5 A)11
(17) ->
However, in the following example it complains:
(17) -> F : AP := 1234 * A + 5678 * B
2 3 2
(17) (2 + 10 11 + 2 11 + 4 11 )B + (2 + 2 11 + 10 11 )A
(18) ->
(18) -> pds(F)
>> System error:
Argument X is not a NUMBER: "NullStream"
(18) ->
It seems pds works on some but not on all vectors.