Program for Generating Toratopes in Toratopic Notation

Discuss interdimensional programming, Java applets and so forth.

Program for Generating Toratopes in Toratopic Notation

Postby ICN5D » Thu Apr 03, 2014 12:16 am

I'm interested in a small simple sequence generator that can produce valid toratopes in what ever dimension. Some way that's quicker and more error free than by hand. It would be cool to have it in the toratope notation! Or, even a conversion algorithm that makes the implicit surface equation from the notation. It might be handy with more complex shapes. It would be a graphical representation of the A000669 integer series.
in search of combinatorial objects of finite extent
ICN5D
Pentonian
 
Posts: 1047
Joined: Mon Jul 28, 2008 4:25 am
Location: Orlando, FL

Re: Program for Generating Toratopes in Toratopic Notation

Postby ICN5D » Mon Apr 07, 2014 7:39 pm

So, does anyone have a clue how to make a simple sequence generator, in the toratope format, according to A669?
in search of combinatorial objects of finite extent
ICN5D
Pentonian
 
Posts: 1047
Joined: Mon Jul 28, 2008 4:25 am
Location: Orlando, FL

Re: Program for Generating Toratopes in Toratopic Notation

Postby quickfur » Tue Apr 08, 2014 12:06 am

You'll have to be a bit more specific than that. Exactly what will the input(s) be, and what do you expect the output to be?
quickfur
Pentonian
 
Posts: 2483
Joined: Thu Sep 02, 2004 11:20 pm
Location: The Great White North

Re: Program for Generating Toratopes in Toratopic Notation

Postby ICN5D » Tue Apr 08, 2014 3:40 am

My bad :)


The input should be something like :




FORMULA
Product_{k>0} 1/(1-x^k)^a_k = 1+x+2*Sum_{k>1} a_k*x^k

Image

EXAMPLE
a(4)=5 with the following series-reduced planted trees: (oooo), (oo(oo)), (o(ooo)), (o(o(oo))), ((oo)(oo))

MAPLE
Method 1: a := [1, 1]; for n from 3 to 30 do L := series( mul( (1-x^k)^(-a[k]), k=1..n-1)/(1-x^n)^b, x, n+1); t1 := coeff(L, x, n); R := series( 1+2*add(a[k]*x^k, k=1..n-1)+2*b*x^n, x, n+1); t2 := coeff(R, x, n); t3 := solve(t1-t2, b); a := [op(a), t3]; od: A000669 := n-> a[n];
Method 2, more efficient: with(numtheory): M := 1001; a := array(0..M); p := array(0..M); a[1] := 1; a[2] := 1; a[3] := 2; p[1] := 1; p[2] := 3; p[3] := 7;
Method 2, cont.: for m from 4 to M do t1 := divisors(m); t3 := 0; for d in t1 minus {m} do t3 := t3+d*a[d]; od: t4 := p[m-1]+2*add(p[k]*a[m-k], k=1..m-2)+t3; a[m] := t4/m; p[m] := t3+t4; od: # A000669 := n-> a[n]; A058757 := n->p[n];

MATHEMATICA
a[1] = 1; a[n_] := (s = Series[1/(1 - x), {x, 0, n}];
Do[s = Series[s/(1 - x^k)^Coefficient[s, x^k], {x, 0, n}], {k, 2, n}]; Coefficient[s, x^n]/2); Array[a, 28]


PROG
(PARI) a(n)=local(A, X); if(n<2, n>0, X=x+x*O(x^n); A=1/(1-X); for(k=2, n, A/=(1-X^k)^polcoeff(A, k)); polcoeff(A, n)/2)



Which ever one of those makes any sense, apologies if not. I copied that right off this right here


The output I am looking for is only the toratope notation itself, just a list of the sequences up to what ever dimension I want. I like pouring over all possible ones, and searching for interesting beasts. It's just graphically appeasing, in a strange-person kind of way. I hope you can understand! :)

Something like this?

2D:
(II)

3D:
(III)
((II)I)

4D:
(IIII)
((II)II)
((II)(II))
((III)I)
(((II)I)I)

5D:
(IIIII)
((II)III)
((II)(II)I)
((III)II)
(((II)I)II)
((III)(II))
(((II)I)(II))
((IIII)I)
(((II)II)I)
(((II)(II))I)
(((III)I)I)
((((II)I)I)I)

6D:
(IIIIII)
((II)IIII)
((II)(II)II)
((II)(II)(II))
((III)III)
(((II)I)III)
((III)(II)I)
(((II)I)(II)I)
((III)(III))
(((II)I)(III))
(((II)I)((II)I))
((IIII)II)
(((II)II)II)
(((II)(II))II)
(((III)I)II)
((((II)I)I)II)
((IIII)(II))
(((II)II)(II))
(((II)(II))(II))
(((III)I)(II))
((((II)I)I)(II))
((IIIII)I)
(((II)III)I)
(((II)(II)I)I)
(((III)II)I)
((((II)I)II)I)
(((III)(II))I)
((((II)I)(II))I)
(((IIII)I)I)
((((II)II)I)I)
((((II)(II))I)I)
((((III)I)I)I)
(((((II)I)I)I)I)


Where, what I aim to get is the full accurate list of all 7D, 8D, 9D, etc. Up to 9 will be over one thousand, of course, but it's just a simple number sequence generator.
in search of combinatorial objects of finite extent
ICN5D
Pentonian
 
Posts: 1047
Joined: Mon Jul 28, 2008 4:25 am
Location: Orlando, FL

Re: Program for Generating Toratopes in Toratopic Notation

Postby ICN5D » Thu Apr 17, 2014 11:12 pm

It seems to be fairly straightforward in my perception, but the task could be more advanced than what I was thinking. To sum up the previous post, I guess the best formula would be :

Product_{k>0} 1/(1-x^k)^a_k = 1+x+2*Sum_{k>1} a_k*x^k

This should generate the amount of toratopes in each dimension. Where, what I am looking for is a full listing of them in the toratope notation. It would end up being the graphical output of all possible permutations. I can do it by hand, the long way, but it would be prone to errors. I feel this would be a solution to potential minor oversights.

It seems like a simple C++ script could do this, of which I have no useful knowledge in. I ask my small community of mathematical minded folks if they have any ideas how to accomplish this :)
in search of combinatorial objects of finite extent
ICN5D
Pentonian
 
Posts: 1047
Joined: Mon Jul 28, 2008 4:25 am
Location: Orlando, FL

Re: Program for Generating Toratopes in Toratopic Notation

Postby PWrong » Tue Sep 09, 2014 8:49 am

As for generating the notations automatically, that's exactly what I was looking for here . But then, Marek answered by enumerating the list up to 10D. I'd still be interested in over 10D, where at 11D the list is six thousand strong. What would be really neat, is a notation --> equation converter. When I decide to drop some $$$ on a nice fast computer, it'll help with big toratopes.


This is the method I use, which could potentially be turned into pseudocode or Mathematica code. I'll do it for 7D, with the assumption that we already have a list of the closed and open toratopes up to 6D.

Step 1. Generate the partitions, not including the largest hypersphere.
1111111
211111
22111
2221
31111
3211
322
331
4111
421
43
511
52
61

Step 2.
For each partition, look at all the numbers 'k' greater than 2, and list all possible ways of replacing each one with any of the closed toratopes of dimension k, but delete the duplicates up to rotation e.g. (21)3 = 3(21).

Examples:
322 has a 3, which could be either 3 or (21), so
322 -> {322, (21)22}.

331 has two 3's, each of which could be either 3 or (21), so 331 -> {331, (21)31, 3(21)1, (21)(21)1}. Then we delete the duplicates, so that
331 -> {331, (21)31, (21)(21)1}.

43 has a 4 and 3. We have
43 -> {43, (211)3, (22)3, (31)3, ((21)1)3, 4(21), (211)(21), (22)(21), (31)(21), ((21)1)(21)}

Step 3. We now have a list of all the open toratopes:

1111111,
211111,
22111,
2221,
31111, (21)1111
3211, (21)211
322, (21)22
331, 3(21)1, (21)(21)1
4111, (211)111, (22)111, (31)111, ((21)1)111,
421, (211)21, (22)21, (31)21, ((21)1)21,
43, (211)3, (22)3, (31)3, ((21)1)3, 4(21), (211)(21), (22)(21), (31)(21), ((21)1)(21),
511, (2111)11, e.t.c.
52, (2111)2, e.t.c.
61, (21111)1, e.t.c.

Step 4. The list of closed toratopes are given by simply putting brackets around the open toratopes. For example (22111) is the closed form of 22111.
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Program for Generating Toratopes in Toratopic Notation

Postby PWrong » Tue Sep 09, 2014 11:57 am

Here we go. To generate the toratopes:
Code: Select all
Toratopes[1] = {1};
Rotatopes[n_] := Rest[IntegerPartitions[n]]
ExpandRotatope[list_] :=
DeleteDuplicates[
  Map[Reverse @* Sort, Tuples[Map[Toratopes, list]], 1]]
Toratopes[n_] := Flatten[Map[ExpandRotatope, Rotatopes[n]], 1]

To express them as a list in fancier notation:
Code: Select all
TStringList[1] = "I";
TStringList[list_] :=
Flatten[{"(", Table[TStringList[i], {i, list}], ")"}, 1]

ClosedToratopeNotation[list_] := StringJoin[TStringList[list]]
OpenToratopeNotation[list_] :=
StringJoin[ TStringList[list] // Most // Rest]

ToratopeList[n_] :=
If[n === 1, {"I"},
   Join[Map[OpenToratopeNotation, Toratopes[n]],
    Map[ClosedToratopeNotation, Toratopes[n]]]] // TableForm

And the result:
Code: Select all
ToratopeList[7]

IIIIIII
(II)IIIII
(II)(II)III
(II)(II)(II)I
((II)I)IIII
(III)IIII
((II)I)(II)II
(III)(II)II
((II)I)(II)(II)
(III)(II)(II)
((II)I)((II)I)I
(III)((II)I)I
(III)(III)I
((III)I)III
(((II)I)I)III
((II)(II))III
((II)II)III
(IIII)III
((III)I)(II)I
(((II)I)I)(II)I
((II)(II))(II)I
((II)II)(II)I
(IIII)(II)I
((III)I)((II)I)
(III)((III)I)
(((II)I)I)((II)I)
(III)(((II)I)I)
((II)(II))((II)I)
(III)((II)(II))
((II)II)((II)I)
((II)II)(III)
(IIII)((II)I)
(IIII)(III)
((IIII)I)II
(((II)II)I)II
(((II)(II))I)II
((((II)I)I)I)II
(((III)I)I)II
((III)(II))II
(((II)I)(II))II
((III)II)II
(((II)I)II)II
((II)(II)I)II
((II)III)II
(IIIII)II
((IIII)I)(II)
(((II)II)I)(II)
(((II)(II))I)(II)
((((II)I)I)I)(II)
(((III)I)I)(II)
((III)(II))(II)
(((II)I)(II))(II)
((III)II)(II)
(((II)I)II)(II)
((II)(II)I)(II)
((II)III)(II)
(IIIII)(II)
((IIIII)I)I
(((II)III)I)I
(((II)(II)I)I)I
((((II)I)II)I)I
(((III)II)I)I
((((II)I)(II))I)I
(((III)(II))I)I
((((III)I)I)I)I
(((((II)I)I)I)I)I
((((II)(II))I)I)I
((((II)II)I)I)I
(((IIII)I)I)I
((IIII)(II))I
(((II)II)(II))I
(((II)(II))(II))I
((((II)I)I)(II))I
(((III)I)(II))I
((IIII)II)I
(((II)II)II)I
(((II)(II))II)I
((((II)I)I)II)I
(((III)I)II)I
((III)(III))I
((III)((II)I))I
(((II)I)((II)I))I
((III)(II)I)I
(((II)I)(II)I)I
((III)III)I
(((II)I)III)I
((II)(II)(II))I
((II)(II)II)I
((II)IIII)I
(IIIIII)I
(IIIIIII)
((II)IIIII)
((II)(II)III)
((II)(II)(II)I)
(((II)I)IIII)
((III)IIII)
(((II)I)(II)II)
((III)(II)II)
(((II)I)(II)(II))
((III)(II)(II))
(((II)I)((II)I)I)
((III)((II)I)I)
((III)(III)I)
(((III)I)III)
((((II)I)I)III)
(((II)(II))III)
(((II)II)III)
((IIII)III)
(((III)I)(II)I)
((((II)I)I)(II)I)
(((II)(II))(II)I)
(((II)II)(II)I)
((IIII)(II)I)
(((III)I)((II)I))
((III)((III)I))
((((II)I)I)((II)I))
((III)(((II)I)I))
(((II)(II))((II)I))
((III)((II)(II)))
(((II)II)((II)I))
(((II)II)(III))
((IIII)((II)I))
((IIII)(III))
(((IIII)I)II)
((((II)II)I)II)
((((II)(II))I)II)
(((((II)I)I)I)II)
((((III)I)I)II)
(((III)(II))II)
((((II)I)(II))II)
(((III)II)II)
((((II)I)II)II)
(((II)(II)I)II)
(((II)III)II)
((IIIII)II)
(((IIII)I)(II))
((((II)II)I)(II))
((((II)(II))I)(II))
(((((II)I)I)I)(II))
((((III)I)I)(II))
(((III)(II))(II))
((((II)I)(II))(II))
(((III)II)(II))
((((II)I)II)(II))
(((II)(II)I)(II))
(((II)III)(II))
((IIIII)(II))
(((IIIII)I)I)
((((II)III)I)I)
((((II)(II)I)I)I)
(((((II)I)II)I)I)
((((III)II)I)I)
(((((II)I)(II))I)I)
((((III)(II))I)I)
(((((III)I)I)I)I)
((((((II)I)I)I)I)I)
(((((II)(II))I)I)I)
(((((II)II)I)I)I)
((((IIII)I)I)I)
(((IIII)(II))I)
((((II)II)(II))I)
((((II)(II))(II))I)
(((((II)I)I)(II))I)
((((III)I)(II))I)
(((IIII)II)I)
((((II)II)II)I)
((((II)(II))II)I)
(((((II)I)I)II)I)
((((III)I)II)I)
(((III)(III))I)
(((III)((II)I))I)
((((II)I)((II)I))I)
(((III)(II)I)I)
((((II)I)(II)I)I)
(((III)III)I)
((((II)I)III)I)
(((II)(II)(II))I)
(((II)(II)II)I)
(((II)IIII)I)
((IIIIII)I)
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Program for Generating Toratopes in Toratopic Notation

Postby ICN5D » Tue Sep 09, 2014 2:07 pm

Hell yeah, that is awesome! What a nice error free way to enumerate over 10D. Hmmm , makes me think, it wouldn't be too far of a stretch to create a cut algorithm that makes the cuts and translates into text, in tabular form. It would parse every cut of any toratope, and describe the array, even if empty. It could use a small preprogrammed library in parallel with interpreting extra brackets for easy translation.
in search of combinatorial objects of finite extent
ICN5D
Pentonian
 
Posts: 1047
Joined: Mon Jul 28, 2008 4:25 am
Location: Orlando, FL

Re: Program for Generating Toratopes in Toratopic Notation

Postby ICN5D » Mon Sep 15, 2014 11:46 pm

Actually, now that I've got a chancre to try this, I can't get it to work. Tried many combinations of copy-pasting the text, but no luck. It should be straightforward, right? Just paste the code and hit shift+enter?
in search of combinatorial objects of finite extent
ICN5D
Pentonian
 
Posts: 1047
Joined: Mon Jul 28, 2008 4:25 am
Location: Orlando, FL

Re: Program for Generating Toratopes in Toratopic Notation

Postby PWrong » Wed Sep 17, 2014 2:11 pm

Yeah, I just tried copying it and it worked fine. That's weird, what kind of error do you get?
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Program for Generating Toratopes in Toratopic Notation

Postby ICN5D » Wed Sep 17, 2014 7:14 pm

Double checked it, my broken comp was taking a really long time, nothing wrong with the code. Cant wait till I get a new one.
in search of combinatorial objects of finite extent
ICN5D
Pentonian
 
Posts: 1047
Joined: Mon Jul 28, 2008 4:25 am
Location: Orlando, FL


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest