login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Test the different Series defined for Species

axiom
)cd ~/combinat/src
The current FriCAS default directory is /var/zope2/var/LatexWiki
axiom
)re ../lib/combinat.input
The file ../lib/combinat.input is needed but does not exist.

Composition of Species:

aldor
#includeDir "/var/lib/zope/combinat/include"
#libraryDir "/var/lib/zope/combinat/lib"
#include "combinat"
macro { E == EmptySetSpecies; X == SingletonSpecies; + == Plus; * == Times; } import from ACInteger; kSet(L:ACLabelType, k:Integer): CombinatorialSpecies L == RestrictedSpecies(SetSpecies, k)(L) add; kSubset(L:ACLabelType, k:Integer): CombinatorialSpecies L == (RestrictedSpecies(SetSpecies, k)*SetSpecies)(L) add; TwoSet(L:ACLabelType): CombinatorialSpecies L == kSet(L,2) add; Graph(L: ACLabelType): CombinatorialSpecies L == FunctorialCompose(Subset, SetSpecies*TwoSet)(L) add;
aldor
   Compiling FriCAS source code from file 
      /var/zope2/var/LatexWiki/328803476490765780-25px002.as using 
      AXIOM-XL compiler and options 
-O -Fasy -Fao -Flsp -laxiom -Mno-ALDOR_W_WillObsolete -DAxiom -Y $AXIOM/algebra -I $AXIOM/algebra
      Use the system command )set compiler args to change these 
      options.
"/var/zope2/var/LatexWiki/328803476490765780-25px002.as", line 3: 
#include "combinat"
^
[L3 C1] #1 (Error) Could not open file `combinat'.
The )library system command was not called after compilation.

These are the definitions of Cycle and LinearOrder? see SandBoxSpeciesAldor

aldor
#includeDir "/var/lib/zope/combinat/include"
#libraryDir "/var/lib/zope/combinat/lib"
#assert MacrosCombinat
#assert Axiom
#include "combinat"
macro {
        SPECIES == (L: LabelType) -> CombinatorialSpecies L;
        V == CycleIndexVariable;
        NonNegativeMachineInteger == I;
        T == SparseIndexedPowerProduct(V, NonNegativeMachineInteger);
        P == SparseDistributedPolynomial(Q, V, T);
}
LinearOrder(L: LabelType): with {
CombinatorialSpecies L;
coerce: % -> List L;
} == List L add {
        Rep == List L;
        import from Rep;
coerce(x: %): List L == rep x;
local lists(l: List L): Generator List L == generate {
        empty? l => yield l;
        current := l;
        c := first current;
        for u in lists(rest l) repeat yield cons(c, u);
        assert(not empty? current);
        while not empty?(tmp := rest current) repeat {
                c := first tmp;
                setrest!(current, rest tmp); -- remove c from l
                for u in lists l repeat yield cons(c, u);
                setrest!(current, tmp); -- put c back into l
                current := tmp;
        }
}
structures(s: SetSpecies L): Generator % == generate {
        for l in lists(s :: List L) repeat yield per l;
}
local LinearOrderIsomorphismType: IsomorphismTypeCategory L 
== add {
        isomorphismTypes(s: MultiSet L): Generator % == never;
        (x:%) = (y:%): Boolean == never;
        (tw: TextWriter) << (x: %): TextWriter == never;
}
IsomorphismType: IsomorphismTypeCategory L == LinearOrderIsomorphismType;
generatingSeries: ExponentialGeneratingSeries == {
        (stream(1$Q)$DataStream(Q)) :: ExponentialGeneratingSeries;
}
isomorphismTypeGeneratingSeries: OrdinaryGeneratingSeries == {
        (stream(1$Z)$DataStream(Z)) :: OrdinaryGeneratingSeries;
}
local cisGenerator: Generator P == generate {
        import from I, T, P;
        x1: V := 1::V;
        for n: I in 0.. repeat yield power(x1, n) :: P;
}
cycleIndexSeries: CycleIndexSeries == cisGenerator :: CycleIndexSeries;
import from String;
expression: SpeciesExpression == leaf("LinearOrder");
}
Cycle(L: LabelType): with {
CombinatorialSpecies L;
coerce: % -> List L;
cycle: List L -> %;
} == List L add {
        Rep == List L;
        import from I, Rep;
local cisCycle(ao: I): Generator P == generate {
        macro PrimePowerProduct == SparseIndexedPowerProduct(I, I);
local multiply(k: PrimePowerProduct): I == {
        r: I := 1;
        for ep in k repeat {(e, p) := ep; r := r * p^e}
        r;
}
local eulerPhi(t: SparseIndexedPowerProduct(I, I)): I == {
        phi: I := 1;
        for ep in t repeat {
                (e, p) := ep;
                phi := phi * p^(e-1) * (p-1)
        }
        phi;
}
local cisCoefficient(n: I): P == BugWorkaround(
    PrimePowerProduct has with {
            divisors: % -> Generator %;
            /: (%, %) -> %;
    }
){
        import from Z, V, SmallIntegerTools;
        nn: PrimePowerProduct := factor n;
        p: P := 0;
        for m in divisors nn repeat {
                k: PrimePowerProduct := nn/m;
                q: Q := (eulerPhi(k) :: Z) / (n :: Z);
                xk: V := multiply(k) :: V;
                t: T := power(xk, multiply m);
                p := [q, t]$P + p;
        }
        p;
}
        yield 0$P;
        for n:I in 1.. repeat yield cisCoefficient(n);
}
coerce(x: %): List L == rep x;
cycle(l: List L): % == per l;
structures(s: SetSpecies L): Generator % == generate {
        import from LinearOrder L;
        if not empty? s then {
                l: List L := s :: List L;
                u := first l;
                for t in structures(set rest l)$LinearOrder(L) repeat {
                        yield per cons(u, t :: List L);
                }
        }
}
local CycleIsomorphismType: IsomorphismTypeCategory L 
== add {
        isomorphismTypes(s: MultiSet L): Generator % == never;
        (x:%) = (y:%): Boolean == never;
        (tw: TextWriter) << (x: %): TextWriter == never;
}
IsomorphismType: IsomorphismTypeCategory L == CycleIsomorphismType;
local cycleOrder(): SeriesOrder == 1 :: SeriesOrder;
egsCycle(ao: I): Generator Q == generate {
        import from Z, Q;
        yield 0;
        for n:I in 1.. repeat yield inv(n :: Z);
}
generatingSeries: ExponentialGeneratingSeries == new(egsCycle, cycleOrder);
ogsCycle(ao: I): Generator Z == generate {yield 0$Z; yield 1$Z};
isomorphismTypeGeneratingSeries: OrdinaryGeneratingSeries == {
        new(ogsCycle, cycleOrder);
}
cycleIndexSeries: CycleIndexSeries == new(cisCycle, cycleOrder);
import from String;
expression: SpeciesExpression == leaf("Cycle");
}
Perm(L: ACLabelType): CombinatorialSpecies L == Compose(SetSpecies,Cycle)(L) add;
aldor
   Compiling FriCAS source code from file 
      /var/zope2/var/LatexWiki/1726705911677297462-25px003.as using 
      AXIOM-XL compiler and options 
-O -Fasy -Fao -Flsp -laxiom -Mno-ALDOR_W_WillObsolete -DAxiom -Y $AXIOM/algebra -I $AXIOM/algebra
      Use the system command )set compiler args to change these 
      options.
"/var/zope2/var/LatexWiki/1726705911677297462-25px003.as", line 5: 
#include "combinat"
^
[L5 C1] #1 (Error) Could not open file `combinat'.
The )library system command was not called after compilation.

axiom
Z := ACInteger;
Type: Variable(ACInteger?)
axiom
labels: SetSpecies Z := set [1::Z,2::Z,
3::Z, 4::Z, 5::Z]
There are no library operations named SetSpecies Use HyperDoc Browse or issue )what op SetSpecies to learn if there is any operation containing " SetSpecies " in its name.
Cannot find a definition or applicable library operation named SetSpecies with argument type(s) Variable(ACInteger)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. [structures(labels)$kSet(Z,5)]$ACLIST(kSet(Z,5))
There are no library operations named kSet Use HyperDoc Browse or issue )what op kSet to learn if there is any operation containing " kSet " in its name.
Cannot find a definition or applicable library operation named kSet with argument type(s) Variable(ACInteger) PositiveInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. [structures(labels)$kSet(Z,2)]$ACLIST(kSet(Z,2))
There are no library operations named kSet Use HyperDoc Browse or issue )what op kSet to learn if there is any operation containing " kSet " in its name.
Cannot find a definition or applicable library operation named kSet with argument type(s) Variable(ACInteger) PositiveInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. [structures(labels)$kSubset(Z, 2)]$ACLIST(kSubset(Z, 2))
There are no library operations named kSubset Use HyperDoc Browse or issue )what op kSubset to learn if there is any operation containing " kSubset " in its name.
Cannot find a definition or applicable library operation named kSubset with argument type(s) Variable(ACInteger) PositiveInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. [structures(labels)$TwoSet(Z)]$ACLIST(TwoSet(Z))
There are no library operations named TwoSet Use HyperDoc Browse or issue )what op TwoSet to learn if there is any operation containing " TwoSet " in its name.
Cannot find a definition or applicable library operation named TwoSet with argument type(s) Variable(ACInteger)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. labels3: SetSpecies Z := set [10::Z,20::Z]
There are no library operations named SetSpecies Use HyperDoc Browse or issue )what op SetSpecies to learn if there is any operation containing " SetSpecies " in its name.
Cannot find a definition or applicable library operation named SetSpecies with argument type(s) Variable(ACInteger)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. [structures(labels3)$TwoSet(Z)]$ACLIST(TwoSet(Z))
There are no library operations named TwoSet Use HyperDoc Browse or issue )what op TwoSet to learn if there is any operation containing " TwoSet " in its name.
Cannot find a definition or applicable library operation named TwoSet with argument type(s) Variable(ACInteger)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. [structures(labels)$Perm(Z)]$ACLIST(Perm(Z))
There are no library operations named Perm Use HyperDoc Browse or issue )what op Perm to learn if there is any operation containing " Perm " in its name.
Cannot find a definition or applicable library operation named Perm with argument type(s) Variable(ACInteger)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.

Some problems are appearing, calling:

  [structures(labels3)$Graph(Z)]$ACLIST(Graph(Z))

axiom
es: ExponentialGeneratingSeries := generatingSeries()$Perm(Z);
There are no library operations named Perm Use HyperDoc Browse or issue )what op Perm to learn if there is any operation containing " Perm " in its name.
Cannot find a definition or applicable library operation named Perm with argument type(s) Variable(ACInteger)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. [count(es, i) for i in 0..10]
There are 2 exposed and 0 unexposed library operations named count having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op count to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named count with argument type(s) Variable(es) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. FriCAS will attempt to step through and interpret the code. There are 2 exposed and 0 unexposed library operations named count having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op count to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named count with argument type(s) Variable(es) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.

These are the binomial coefficients of 2 and 4, respectively.

axiom
es: ExponentialGeneratingSeries := generatingSeries()$kSubset(Z,2);
There are no library operations named kSubset Use HyperDoc Browse or issue )what op kSubset to learn if there is any operation containing " kSubset " in its name.
Cannot find a definition or applicable library operation named kSubset with argument type(s) Variable(ACInteger) PositiveInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. [count(es, i) for i in 0..10]
There are 2 exposed and 0 unexposed library operations named count having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op count to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named count with argument type(s) Variable(es) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. FriCAS will attempt to step through and interpret the code. There are 2 exposed and 0 unexposed library operations named count having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op count to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named count with argument type(s) Variable(es) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. es: ExponentialGeneratingSeries := generatingSeries()$kSubset(Z,4);
There are no library operations named kSubset Use HyperDoc Browse or issue )what op kSubset to learn if there is any operation containing " kSubset " in its name.
Cannot find a definition or applicable library operation named kSubset with argument type(s) Variable(ACInteger) PositiveInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. [count(es, i) for i in 0..10]
There are 2 exposed and 0 unexposed library operations named count having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op count to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named count with argument type(s) Variable(es) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. FriCAS will attempt to step through and interpret the code. There are 2 exposed and 0 unexposed library operations named count having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op count to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named count with argument type(s) Variable(es) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. es: ExponentialGeneratingSeries := generatingSeries()$Graph(Z);
There are no library operations named Graph Use HyperDoc Browse or issue )what op Graph to learn if there is any operation containing " Graph " in its name.
Cannot find a definition or applicable library operation named Graph with argument type(s) Variable(ACInteger)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. [coefficient(es, i) for i in 0..5]
There are 8 exposed and 4 unexposed library operations named coefficient having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op coefficient to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named coefficient with argument type(s) Variable(es) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. FriCAS will attempt to step through and interpret the code. There are 8 exposed and 4 unexposed library operations named coefficient having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op coefficient to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named coefficient with argument type(s) Variable(es) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. os2: OrdinaryGeneratingSeries := isomorphismTypeGeneratingSeries()$Perm(Z);
There are no library operations named Perm Use HyperDoc Browse or issue )what op Perm to learn if there is any operation containing " Perm " in its name.
Cannot find a definition or applicable library operation named Perm with argument type(s) Variable(ACInteger)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. [coefficient(os2, i) for i in 0..5]
There are 8 exposed and 4 unexposed library operations named coefficient having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op coefficient to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named coefficient with argument type(s) Variable(os2) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. FriCAS will attempt to step through and interpret the code. There are 8 exposed and 4 unexposed library operations named coefficient having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op coefficient to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named coefficient with argument type(s) Variable(os2) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.

???

axiom
os: OrdinaryGeneratingSeries := isomorphismTypeGeneratingSeries()$Graph(Z);
There are no library operations named Graph Use HyperDoc Browse or issue )what op Graph to learn if there is any operation containing " Graph " in its name.
Cannot find a definition or applicable library operation named Graph with argument type(s) Variable(ACInteger)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. [coefficient(os, i) for i in 0..5]
There are 8 exposed and 4 unexposed library operations named coefficient having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op coefficient to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named coefficient with argument type(s) Variable(os) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. FriCAS will attempt to step through and interpret the code. There are 8 exposed and 4 unexposed library operations named coefficient having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op coefficient to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named coefficient with argument type(s) Variable(os) NonNegativeInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. cs: CycleIndexSeries := cycleIndexSeries()$Graph(Z);
There are no library operations named Graph Use HyperDoc Browse or issue )what op Graph to learn if there is any operation containing " Graph " in its name.
Cannot find a definition or applicable library operation named Graph with argument type(s) Variable(ACInteger)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. cs5:=coefficient(cs, 5)
There are 8 exposed and 4 unexposed library operations named coefficient having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op coefficient to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named coefficient with argument type(s) Variable(cs) PositiveInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.

The identity in S_5 fixes every graph, so the coefficient of x_1^5 must be equal to coefficient(es, 5). This is the background to the equation "es = cs(1,0,0,0...)"

axiom
coefficient(es, 5)
There are 8 exposed and 4 unexposed library operations named coefficient having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op coefficient to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named coefficient with argument type(s) Variable(es) PositiveInteger
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.

Each transposition \tau \in S_5 fixes the same number of graphs, because of symmetry. We want to know how many graphs are fixed by transposition. Therefore we have to multiplicate the coefficient of x_1^3x_2^1 by factorial(n) and divide by the number of transposition in S_5:

axiom
32/3*factorial(5)/(5*4/2)

\label{eq1}128(1)
Type: Fraction(Integer)




  Subject:   Be Bold !!
  ( 13 subscribers )  
Please rate this page: