MathAction changed pages
http://axiomwiki.newsynthesis.org
MathAction changed pagesenWed, 20 Jun 2018 16:00:39 +0000[FrontPage] fix typo and remove Statistics link
http://axiomwiki.newsynthesis.org/FrontPage
http://axiomwiki.newsynthesis.org/FrontPage
??changed:
 highlevel "programming language":FriCASLanguage for expressing a
highlevel "programming language":FriCASLanguage for expressing
??changed:
 <li>[Statistics]</li>
<! <li>[Statistics]</li> >
Fri, 25 May 2018 13:37:21 +0000[FriCASHelpSet]
http://axiomwiki.newsynthesis.org/FriCASHelpSet
http://axiomwiki.newsynthesis.org/FriCASHelpSet
++added:
<h3>)set messages prompt</h3>
\begin{axiom}
)set messages prompt
\end{axiom}
<h3>)set messages time</h3>
\begin{axiom}
)set messages time
\end{axiom}
++added:
<h3>)set output fraction</h3>
\begin{axiom}
)set output fraction
\end{axiom}
Thu, 24 May 2018 21:36:19 +0000[SandboxErik]
http://axiomwiki.newsynthesis.org/SandboxErik
http://axiomwiki.newsynthesis.org/SandboxErik
??changed:

How do I find the nroot of a number?
You can do it symbolically or numerically.
\begin{axiom}
nthRoot(4, 7)
nthRoot(4.0, 7)
\end{axiom}
How do I solve inequalites?
FriCAS lacks support for this.
How do I find the angle in a scalar product? Degrees and radians.
Homework! Program the mathematical formula and you are done.
Is it possible to find the logarithm with base 10, 2 and 3 etc?
https://en.wikipedia.org/wiki/Logarithm#Change_of_base
In FriCAS 'log' denotes the natural logarithm and '%e' denotes 'exp(1)'.
\begin{axiom}
log %e
\end{axiom}
The lenght of a vector?
Just enter the formula.
\begin{axiom}
v := vector [1,3,5]
len := sqrt dot(v,v)
\end{axiom}
How can I rewrite a expression to with respect to a variable? For example v=H*r and to make axiom rewrite this as r=H/r?
Solve for it.
\begin{axiom}
)clear prop v
solve(v=H*r, r)
\end{axiom}
And I guess lcm is defined for only 2 numbers and not 3?
You can compute the lcm of a list of values.
\begin{axiom}
lst := [n for n in 1..10]
lcm lst
\end{axiom}
I realize that this is a lot of questions, so it is completely okay if you
answer each questions short. I have tried a lot on my own, but need hints
to understand the whole picture. I will also try to understand the coding
of the programme afterwards:)It took me a short time to become natural with
the programme, so thanks a lot!
Thu, 24 May 2018 20:47:26 +0000[GroupAlgorithms]
http://axiomwiki.newsynthesis.org/GroupAlgorithms
http://axiomwiki.newsynthesis.org/GroupAlgorithms
++added:
One can also use more naive method, like ExampleCharacterTable
Tue, 22 May 2018 19:46:32 +0000[ExampleCharacterTable]
http://axiomwiki.newsynthesis.org/ExampleCharacterTable
http://axiomwiki.newsynthesis.org/ExampleCharacterTable
??changed:

We want to compute characters of wreath product Z_3^(Z_3)*Z_3
First, we represent the group in computer giving generators as permutations:
\begin{axiom}
pG := Permutation(Integer)
g1 := cycle([1,2,3])$pG
g2 := cycle([1,4,7])$pG*cycle([2,5,8])$pG*cycle([3,6,9])$pG
gens := [1$pG, g1, g2]
\end{axiom}
Check the order:
\begin{axiom}
order(permutationGroup(gens))
\end{axiom}
Now, we compute list of elements. We will repeatedly multiply pending list of elements by
generators. Due to length we do no print results.
\begin{axiom}
mul_sets(s1, s2) ==
l := [[g1*g2 for g1 in s1] for g2 in s2]
removeDuplicates(reduce(append, l))
ls := gens;
for i in 1..20 repeat
ls := mul_sets(ls, gens)
\end{axiom}
Check that we obtained all elements:
\begin{axiom}
#ls
\end{axiom}
Now, we want to compute conjugacy classes. 'rl' below is list
of remaining elements to process.
\begin{axiom}
classes : List(List(Permutation(Integer))) := []
rl := ls;
while not(empty?(rl)) repeat
cl := removeDuplicates([g^(1)*rl(1)*g for g in ls])
classes := cons(cl, classes)
rl := setDifference(rl, cl)
 reverse for more natural order
classes := reverse!(classes);
 check for correct number of classes
#classes
\end{axiom}
Now we want to compute multiplication table for classes.
\begin{axiom}
 Auxiliary function to multiply element g1 by class cl1.
 Input:
 g1  element
 cl1  class
 lcl  list of all classes
product_of_classes(g1, cl1, lcl) ==
res := []$List(Integer)
els := [g1*g2 for g2 in cl1]
for cl2 in lcl repeat
sum := 0$Integer
for g2 in els repeat
if member?(g2, cl2) then sum := sum + 1
res := cons(sum, res)
reverse!(res)
 Auxiliary function to multiply class cl1 by class cl2
 Input:
 cl1 and cl2  classes
 lcl  list of all classes
 ncll  list of cardinalities of classes in lcl
product_of_classes2(cl1, cl2, lcl, nlcl) ==
res1 : List(Integer) := product_of_classes(cl1(1), cl2, lcl)
n := #cl1
[((k*n) exquo l)::Integer for k in res1 for l in nlcl]
 remember cardinalities of classes for future use
nlcl := [#cl for cl in classes]
 empty multiplication table
mt := []$List(Matrix(Integer))
 Fill the multiplication table
for i in 1.. for cl1 in classes repeat
mti := new(17, 17, 0)$Matrix(Integer)
for j in 1.. for cl2 in classes repeat
pl := product_of_classes2(cl1, cl2, classes, nlcl)
for k in 1.. for coeff in pl repeat
mti(k, j) := coeff
mt := cons(mti, mt)
mt := reverse!(mt);
\end{axiom}
Computation of characters will be done over finite field, in particular
for p = 1459 we have all needed roots of unity. We will produce
matrix of multiplication by random element and compute its eigenvectors.
\begin{axiom}
pF := PrimeField(1459)
A := reduce(_+, [(random()$pF)*m::Matrix(pF) for m in mt]);
 check if eigenvalues are distinct
#eigenvalues(A)
 list of eigenvectors
le1 := [eir.eigvec for eir in eigenvectors(A)];
 convert to right type
le := [column(first(ev)::Matrix(PrimeField(1459)), 1) for ev in le1];
\end{axiom}
Alas, we need a bug fix, currently on our machine computation of eigenvalues and eigenvectors fails...
By normalizing and pass from g to g^(1) we get characters from eigenvectors
\begin{axiom}
 Compute table of inverses for classes
inv := new(17, 0)$Vector(Integer);
for i in 1.. for cl1 in classes repeat
g1 := first(cl1)^(1)
for j in 1.. for cl2 in classes repeat
if member?(g1, cl2) then
inv(i) := j
break
 Auxiliary function to compute scalar product <f, f> of central function
 f with itself. Input
 f  function as vector of values corresponding to classes
 inv  table of inverses for classes
 nlcl  list of cardinalities of classes
skalar_product(f, inv, nlcl) ==
n : Integer := 0
s : pF := 0
for i in 1..17 for k in nlcl repeat
n := n + k
s := s + f(i)*f(inv(i))*(k::pF)
s/(n::pF)
 Auxiliary function to normalize eigenvectors so that <f, f> = 1 and
 value at e is positive. Input
 le  list of eigenvectors
 inv  table of inverses
 nlcl  list of cardinalities of classes
normalize_vectors(le, inv, nlcl) ==
res := []$List(Vector(pF))
il := parts(inv)
 needed for computation of roots
g := primitiveElement()$pF
for ev in le repeat
sp := skalar_product(ev, inv, nlcl)
k1 := discreteLog(sp)
odd?(k1) => error "sp always is a square"
a1 := g^((k1 quo 2))
n := ev(1)*a1
 We choose root so that value at e is positive, that is less than p/2. Since values are much
 smaller than that we can use 700 in test below.
if (n::Integer) > 700 then a1 := a1
ev1 := ev*a1
res := cons(vector([ev1(k) for k in il])$Vector(pF), res)
reverse!(res)
 Here we get list of characters
lch := normalize_vectors(le, inv, nlcl)
 Check that squares of dimensions sum to correct value
reduce(_+, [ch(1)^2 for ch in lch])
\end{axiom}
Comment: Using characters over finite field we could also compute values of characters over complex numbers, but we stop here.
Tue, 22 May 2018 19:45:40 +0000[LanguageDifferences]
http://axiomwiki.newsynthesis.org/LanguageDifferences
http://axiomwiki.newsynthesis.org/LanguageDifferences
++added:
* Spad has singleton types: string is treated as a name of type with single element. This does not
work in Aldor.
Mon, 21 May 2018 12:16:20 +0000[#335 sort! drops list elements]
http://axiomwiki.newsynthesis.org/335SortDropsListElements
http://axiomwiki.newsynthesis.org/335SortDropsListElements
++added:
From test1 Thu May 10 20:21:49 +0000 2018
From: test1
Date: Thu, 10 May 2018 20:21:49 +0000
Subject:
MessageID: <20180510202149+0000@axiomwiki.newsynthesis.org>
Status: open => closed
Thu, 10 May 2018 20:21:49 +0000[ListProgramming]
http://axiomwiki.newsynthesis.org/ListProgramming
http://axiomwiki.newsynthesis.org/ListProgramming
++added:
Note that after modification value of original list may be useless, while return value is OK. For example
\begin{axiom}
bb := [3, 4, 1, 2]
bs := sort! bb
bb
bs
\end{axiom}
'sort!' rearranges connections between list nodes, so orignal list looks too short. But return value
is correct. So remember to use return value!
Thu, 10 May 2018 20:19:58 +0000[AxiomCompiler]
http://axiomwiki.newsynthesis.org/AxiomCompiler
http://axiomwiki.newsynthesis.org/AxiomCompiler
++added:
See [FriCAS compiler]. The text below is mostly of historical interest.
Thu, 10 May 2018 14:54:49 +0000[FriCAS compiler]
http://axiomwiki.newsynthesis.org/FriCASCompiler
http://axiomwiki.newsynthesis.org/FriCASCompiler
??changed:
The language used for programming FriCAS is called Spad. Currently most of Axiom
documentation still applies, see AxiomCompiler. However, there are changes, some mentioned
The language used for programming FriCAS is called Spad. Currently most detailed
documentation is in FriCAS book http://fricas.github.io/book.pdf However, there are changes, some mentioned
++added:
AxiomCompiler gives some historical context.
Thu, 10 May 2018 14:54:15 +0000