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

)abbrev domain TENSALG TensorAlgebra
TensorAlgebra(M,R,B) : Exports == Implementation where
M:FreeModuleCategory(R, B) R:CommutativeRing B:OrderedSet
OF ==> OutputForm NNI ==> NonNegativeInteger FMB ==> FreeMonoid B CTOF ==> CoercibleTo OutputForm FMCRB ==> FreeModuleCategory(R,FMB) GRALR ==> GradedAlgebra(R,NNI) XFABR ==> XFreeAlgebra(B,R) XDPBR ==> XDistributedPolynomial(B,R) TERM ==> Record(k:FMB,c:R)
Exports == Join(FMCRB, XFABR, GRALR) with
coerce : B -> % convert : FMB -> OutputForm
Rep := XDPBR
product(x,y) == x*y -- GradedAlgebra, pro forma
convert(x:FMB):OutputForm == x=1$FMB => empty()$OF length(x)$FMB = 1 => x::OF length(x)$FMB = 2 => tensor(first(x)::OF,rest(x)::OF)$OF tensor(first(x)::OF, convert(rest x)) coerce(x:%):OutputForm == zero? x => empty()$OF x=1$% => outputForm(1)$OF c:R:=leadingCoefficient(x) if c=1 then cof:=empty()$OF else cof:=c::OF kof:OF:=cof * convert(leadingSupport(x)) zero? reductum(x) => kof kof + reductum(x)::OF spad Compiling FriCAS source code from file /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/579490114000940455-25px001.spad using old system compiler. TENSALG abbreviates domain TensorAlgebra ------------------------------------------------------------------------ initializing NRLIB TENSALG for TensorAlgebra compiling into NRLIB TENSALG compiling exported product : ($,$) ->$
Time: 0.01 SEC.
compiling exported convert : FreeMonoid B -> OutputForm Time: 0.01 SEC.
compiling exported coerce : $-> OutputForm Time: 0.01 SEC. ****** Domain: R already in scope augmenting R: (OrderedAbelianMonoidSup) (time taken in buildFunctor: 10) ;;; *** |TensorAlgebra| REDEFINED ;;; *** |TensorAlgebra| REDEFINED Time: 0.02 SEC. Cumulative Statistics for Constructor TensorAlgebra Time: 0.05 seconds --------------non extending category---------------------- .. TensorAlgebra(#1,#2,#3) of cat (|Join| (|FreeModuleCategory| |#2| (|FreeMonoid| |#3|)) (|XFreeAlgebra| |#3| |#2|) (|GradedAlgebra| |#2| (|NonNegativeInteger|)) (CATEGORY |domain| (SIGNATURE |coerce| ($ |#3|)) (SIGNATURE |convert| ((|OutputForm|) (|FreeMonoid| |#3|))))) has no (|XPolynomialsCat| |#3| |#2|) finalizing NRLIB TENSALG Processing TensorAlgebra for Browser database: --->-->TensorAlgebra(constructor): Not documented!!!! --->-->TensorAlgebra((coerce (% B))): Not documented!!!! --->-->TensorAlgebra((convert ((OutputForm) (FreeMonoid B)))): Not documented!!!! --->-->TensorAlgebra(): Missing Description ; compiling file "/var/aw/var/LatexWiki/TENSALG.NRLIB/TENSALG.lsp" (written 01 FEB 2020 05:45:52 PM):
; /var/aw/var/LatexWiki/TENSALG.NRLIB/TENSALG.fasl written ; compilation finished in 0:00:00.031 ------------------------------------------------------------------------ TensorAlgebra is now explicitly exposed in frame initial TensorAlgebra will be automatically loaded when needed from /var/aw/var/LatexWiki/TENSALG.NRLIB/TENSALG

fricas
B:=OrderedVariableList [e[i] for i in 1..5]
 (1)
Type: Type
fricas
e:=enumerate()$B  (2) Type: List(OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])) fricas R:=Expression Integer  (3) Type: Type fricas R has CommutativeRing  (4) Type: Boolean fricas M:=FreeModule(R, B)  (5) Type: Type fricas -- This is the object of interest TA:=TensorAlgebra(M,R,B)  (6) Type: Type fricas -- coerce basis to TA b:=[a::TA for a in e]  (7) Type: List(TensorAlgebra?(FreeModule(Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])),Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]]))) fricas v1:=x*b.1+y*b.2-z*b.3  (8) Type: TensorAlgebra?(FreeModule(Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])),Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])) fricas v2:=y^n*b.1-cos(x)*b.2  (9) Type: TensorAlgebra?(FreeModule(Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])),Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])) fricas v3:=sin(x+y+z)*b.3  (10) Type: TensorAlgebra?(FreeModule(Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])),Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])) fricas t0:=exp(-x-y-z)*1$TA
 (11)
Type: TensorAlgebra?(FreeModule(Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])),Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]]))
fricas
t1:=b.1*b.2*b.3*b.4+v1
 (12)
Type: TensorAlgebra?(FreeModule(Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])),Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]]))
fricas
t2:=v1*v2+v1*v3*b.5+t0*b.4*b.3
 (13)
Type: TensorAlgebra?(FreeModule(Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])),Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]]))
fricas
-- product(x,y) same as x*y
p1:=product(v1,v2)
 (14)
Type: TensorAlgebra?(FreeModule(Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])),Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]]))
fricas
p2:=product(product(v1,v3),t1)
 (15)
Type: TensorAlgebra?(FreeModule(Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])),Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]]))
fricas
p3:=tan(x)*1$TA  (16) Type: TensorAlgebra?(FreeModule(Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])),Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])) fricas s1:=p1+p2+p3  (17) Type: TensorAlgebra?(FreeModule(Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])),Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])) fricas --- degree(v1*v2*v3*t1)  (18) Type: PositiveInteger? fricas listOfTerms (v1*v1*v2*v3)  (19) Type: List(Record(k: FreeMonoid(OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])),c: Expression(Integer))) fricas degree (1$TA)
 (20)
Type: NonNegativeInteger?
fricas
v1+1$TA  (21) Type: TensorAlgebra?(FreeModule(Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])),Expression(Integer),OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])) fricas listOfTerms %  (22) Type: List(Record(k: FreeMonoid(OrderedVariableList([e[1],e[2],e[3],e[4],e[5]])),c: Expression(Integer))) fricas -- degree (0$TA) ---> err in XDP ??
-- projection to TensorPower(n...) easy : filter degree = n
fricas
)show TENSALG
TensorAlgebra(M: FreeModuleCategory(R,B),R: CommutativeRing,B: OrderedSet) is a domain constructor Abbreviation for TensorAlgebra is TENSALG This constructor is exposed in this frame. ------------------------------- Operations --------------------------------
?*? : (%, %) -> % ?*? : (Integer, %) -> % ?*? : (B, %) -> % ?*? : (FreeMonoid(B), R) -> % ?*? : (R, FreeMonoid(B)) -> % ?*? : (%, R) -> % ?*? : (R, %) -> % ?*? : (PositiveInteger, %) -> % ?+? : (%, %) -> % ?-? : (%, %) -> % -? : % -> % ?=? : (%, %) -> Boolean 1 : () -> % 0 : () -> % ?^? : (%, PositiveInteger) -> % annihilate? : (%, %) -> Boolean antiCommutator : (%, %) -> % associator : (%, %, %) -> % coef : (%, FreeMonoid(B)) -> R coef : (%, %) -> R coefficients : % -> List(R) coerce : Integer -> % coerce : R -> % coerce : FreeMonoid(B) -> % coerce : B -> % coerce : % -> OutputForm commutator : (%, %) -> % constant : % -> R constant? : % -> Boolean degree : % -> NonNegativeInteger hash : % -> SingleInteger latex : % -> String lquo : (%, B) -> % lquo : (%, FreeMonoid(B)) -> % lquo : (%, %) -> % map : ((R -> R), %) -> % mindeg : % -> FreeMonoid(B) mirror : % -> % monom : (FreeMonoid(B), R) -> % monomial? : % -> Boolean monomials : % -> List(%) one? : % -> Boolean opposite? : (%, %) -> Boolean product : (%, %) -> % quasiRegular : % -> % quasiRegular? : % -> Boolean recip : % -> Union(%,"failed") retract : % -> R retract : % -> FreeMonoid(B) rquo : (%, B) -> % rquo : (%, FreeMonoid(B)) -> % rquo : (%, %) -> % sample : () -> % varList : % -> List(B) zero? : % -> Boolean ?~=? : (%, %) -> Boolean ?*? : (NonNegativeInteger, %) -> % ?<? : (%, %) -> Boolean if R has OAMON and FreeMonoid(B) has ORDSET or R has OAMONS and FreeMonoid(B) has ORDSET ?<=? : (%, %) -> Boolean if R has OAMON and FreeMonoid(B) has ORDSET or R has OAMONS and FreeMonoid(B) has ORDSET ?>? : (%, %) -> Boolean if R has OAMON and FreeMonoid(B) has ORDSET or R has OAMONS and FreeMonoid(B) has ORDSET ?>=? : (%, %) -> Boolean if R has OAMON and FreeMonoid(B) has ORDSET or R has OAMONS and FreeMonoid(B) has ORDSET ?^? : (%, NonNegativeInteger) -> % characteristic : () -> NonNegativeInteger coefficient : (%, FreeMonoid(B)) -> R construct : List(Record(k: FreeMonoid(B),c: R)) -> % constructOrdered : List(Record(k: FreeMonoid(B),c: R)) -> % if FreeMonoid(B) has COMPAR convert : FreeMonoid(B) -> OutputForm hashUpdate! : (HashState, %) -> HashState leadingCoefficient : % -> R if FreeMonoid(B) has COMPAR leadingMonomial : % -> % if FreeMonoid(B) has COMPAR leadingSupport : % -> FreeMonoid(B) if FreeMonoid(B) has COMPAR leadingTerm : % -> Record(k: FreeMonoid(B),c: R) if FreeMonoid(B) has COMPAR leftPower : (%, PositiveInteger) -> % leftPower : (%, NonNegativeInteger) -> % leftRecip : % -> Union(%,"failed") linearExtend : ((FreeMonoid(B) -> R), %) -> R if R has COMRING listOfTerms : % -> List(Record(k: FreeMonoid(B),c: R)) max : (%, %) -> % if R has OAMON and FreeMonoid(B) has ORDSET or R has OAMONS and FreeMonoid(B) has ORDSET min : (%, %) -> % if R has OAMON and FreeMonoid(B) has ORDSET or R has OAMONS and FreeMonoid(B) has ORDSET mindegTerm : % -> Record(k: FreeMonoid(B),c: R) monomial : (R, FreeMonoid(B)) -> % numberOfMonomials : % -> NonNegativeInteger reductum : % -> % if FreeMonoid(B) has COMPAR retractIfCan : % -> Union(R,"failed") retractIfCan : % -> Union(FreeMonoid(B),"failed") rightPower : (%, PositiveInteger) -> % rightPower : (%, NonNegativeInteger) -> % rightRecip : % -> Union(%,"failed") sh : (%, %) -> % if R has COMRING sh : (%, NonNegativeInteger) -> % if R has COMRING smaller? : (%, %) -> Boolean if R has COMPAR and FreeMonoid(B) has COMPAR or R has OAMON and FreeMonoid(B) has ORDSET or R has OAMONS and FreeMonoid(B) has ORDSET subtractIfCan : (%, %) -> Union(%,"failed") sup : (%, %) -> % if R has OAMONS and FreeMonoid(B) has ORDSET support : % -> List(FreeMonoid(B))

 Subject:   Be Bold !! ( 15 subscribers )