List of Permutations

8 views
Skip to first unread message

Martin Baker

unread,
Feb 24, 2010, 5:05:45 AM2/24/10
to FriCAS - computer algebra system
What am I doing wrong here? Why don't List functions appear to work on
Permutations?

Martin Baker

all have:
PI ==> PositiveInteger
LPS ==> List Permutation SetCategory
PS ==> Permutation SetCategory
LPSET ==> List Permutation Set
PSET ==> Permutation Set

----------------------------------------------
lookup(lps2:LPS,i:PI): PS == lps2.i

>> System error:
The value |SetCategory| is not of type LIST.

----------------------------------------------
lookup(lps2:LPSET,i:PI): PSET == lps2.i

>> Apparent user error:
unspecified error

----------------------------------------------
lookup(lps2:LPS,i:PI): PS == qelt(lps2,i)

>> System error:
The value |SetCategory| is not of type LIST.

----------------------------------------------
lookup(lps2:LPSET,i:PI): PSET == qelt(lps2,i)

>> Apparent user error:
unspecified error

----------------------------------------------
leng(lps2:LPS):NNI == # lps2

>> System error:
The value |SetCategory| is not of type LIST.

----------------------------------------------
leng(lps2:LPSET):NNI == # lps2

>> Apparent user error:
unspecified error

Martin Baker

unread,
Feb 24, 2010, 5:21:46 AM2/24/10
to fricas...@googlegroups.com
On Wednesday 24 Feb 2010 10:05:45 Martin Baker wrote:
> What am I doing wrong here? Why don't List functions appear to work on
> Permutations?

I've just worked out that it works over:

LPSET ==> List Permutation Set Integer
PSET ==> Permutation Set Integer

But what I really want to do is use a list of categories, how can I do that?
would I need to use pretend to make the category look like a domain?

Martin Baker

Ralf Hemmecke

unread,
Feb 24, 2010, 5:46:40 AM2/24/10
to fricas...@googlegroups.com

Sorry, I don't understand exactly what you want. One almost never wants
a list of categories. What exactly is it that you want to achieve. Give
input and expected output. Then we can figure out whether there is some
way to achieve it in fricas.

Ralf

leh...@bayou.uni-linz.ac.at

unread,
Feb 24, 2010, 5:56:46 AM2/24/10
to fricas...@googlegroups.com
Hello

there is probably a misunderstanding.


On Wed, Feb 24, 2010 at 02:05:45AM -0800, Martin Baker wrote:
> LPS ==> List Permutation SetCategory

here I get
(1) -> LPS:=List Permutation SetCategory

Permutation(SetCategory) is not a valid type.

What you probably want is a parameter:

XYZPackage(T:SetCategory): with ... == add ...

lookup(lps2:List Permutation T,i:PI): Permutation T == lps2 i

regards,
Franz

Martin Baker

unread,
Feb 24, 2010, 6:25:36 AM2/24/10
to fricas...@googlegroups.com
On Wednesday 24 Feb 2010 10:46:40 Ralf Hemmecke wrote:
> Sorry, I don't understand exactly what you want. One almost never wants
> a list of categories. What exactly is it that you want to achieve. Give
> input and expected output. Then we can figure out whether there is some
> way to achieve it in fricas.

What I am trying to do is convert a PermutationGroup to a domain (which I am
trying to create) to represent a finite group based on a multiplication
(Cayley) table. The PermutationGroup is defined over SetCategory so the
generators of the group are:
List Permutation SetCategory
so the actual SetCategory is is not relevant to me I just want to be able to
work with these permutations of them until I can map the permutations into
other values.

Martin

Martin Baker

unread,
Feb 24, 2010, 6:39:56 AM2/24/10
to fricas...@googlegroups.com

Yes, this is how the existing domain PermutationGroup works.

I guess what I need to do is put my code inside that existing domain rather
than trying to create a new domain to do it.

Martin Baker

Ralf Hemmecke

unread,
Feb 24, 2010, 6:52:15 AM2/24/10
to fricas...@googlegroups.com
> What I am trying to do is convert a PermutationGroup to a domain (which I am
> trying to create) to represent a finite group based on a multiplication
> (Cayley) table. The PermutationGroup is defined over SetCategory so the
> generators of the group are:
> List Permutation SetCategory

No. It's more like Franz said.

> so the actual SetCategory is is not relevant to me I just want to be able to
> work with these permutations of them until I can map the permutations into
> other values.

What about starting to simply create your
"PermutationGroupDefinedByMultiplicationTable" domain? Simply start as
Franz suggested by

PermutationGroupDefinedByMultiplicationTable(T: SetCategory): _
SetCategory with ... -- probably the same exports as PermutationGroup
== add ...
-- implement all the function here

The next thing is to form yet another package that converts an element
of PermutationGroupDefinedByMultiplicationTable(X) to PermutationGroup(X).

And maybe you want to have another parameter multiplicationTable for the
PermutationGroupDefinedByMultiplicationTable domain constructor which
represents the multiplication table.

But again as with your PauliMatrix construction. If you give the
multiplication table, who is going to check that the resulting domain
indeed forms a group? The user might give unreasonable input.

Ralf

Waldek Hebisch

unread,
Feb 24, 2010, 8:00:01 AM2/24/10
to fricas...@googlegroups.com

It is still not clear what you really want to do. PermutationGroup
group can handle _huge_ groups, for example:

(1) -> mathieu24()

(1)
<
(1 16 10 22 24)(2 12 18 21 7)(4 5 8 6 17)(9 11 13 19 15)
,
(2 10)(23 24)(1 22 13 14 6 20 3 21 8 11)(4 15 18 17 16 5 9 19 12
7)
>
Type: PermutationGroup(Integer)
(2) -> order(mathieu24())

(2) 244823040
Type: PositiveInteger

So full multiplication table is too big to fit into memory. And
sometimes Mathieu group is considered "small" (the method used by
PermutationGroup is routinely (by other programs) used to handle
some groups having 10^100 elements).

If you want just to convert PermutationGroup to goup you could do
something like:

GroupFromPermutationGroup(T : SetCategory,
data: PermutationGroup(T)) : Group ==
add
Rep := Premutation(T)
-- implement it
....

To experiment in the interpreter just use PermutationGroup(Integer).
If you want your code to be more general use someting like:

T ==> Integer

PerGr := PermutationGroup(T)

Using this interpreter will be happy having concrete types, and
the code will easily transfer to Spad.

--
Waldek Hebisch
heb...@math.uni.wroc.pl

Martin Baker

unread,
Feb 24, 2010, 10:43:51 AM2/24/10
to fricas...@googlegroups.com
Thanks for all your replies on this, sometimes when I get cryptic error
messages it just seems to be a process of trial and error and it easy to miss
things so it helps to be able to ask a question here.

As to the wider question of whether what I am trying to do is worthwhile? At
this stage I am just experimenting. I'm not suggesting it would be useful for
heavy duty, industrial grade, mathematics. I quite like the idea of a group
implementation that people could use when they first start learning about
groups until they start learning about permutation groups on page 2.

I guess it depends if you see Axiom/FriCAS as a toolbox of different options
all of which have pro's and con's or as a system which forces one approach?

Anyway I think, with the help you have given me, I can make some progress now
and its an interesting exercise even if its not much practical use.

Martin Baker

Ralf Hemmecke

unread,
Feb 24, 2010, 10:56:59 AM2/24/10
to fricas...@googlegroups.com
> As to the wider question of whether what I am trying to do is worthwhile? At
> this stage I am just experimenting.

I hope you don't feel offended by the question "What are you trying to
achieve?". I must pose this question just to give you an appropriate
feedback.

It's obvious that you have not fully discovered the beauty of all these
types, domains, category hierarchies. FriCAS has a steep learning curve.
And experimenting is, of course, allowed. So keep asking, but try to be
as clear as possible.

As on any mailing list, you only get a reply if people feel that they
just have to spend a few seconds to figure out how to help.

Also, if you have examples that don't work, enter them in a sandbox like

http://axiom-wiki.newsynthesis.org/SandboxPermutations

and provide the URL. Potential helpers then just need to edit that page
and show you how to do it right.

Ralf

Reply all
Reply to author
Forward
0 new messages