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

Edit detail for SandBoxComplexManifold revision 1 of 7

1 2 3 4 5 6 7
Editor: Bill Page
Time: 2009/06/20 15:12:26 GMT-7
Note: new

changed:
-
\begin{spad}
)abbrev domain CM ComplexManifold
ComplexManifold(R:Join(Field,RadicalCategory,OrderedSet)): Join(RadicalCategory,DirectProductCategory(2,R)) with
    elt:(%,"pos") -> R
    elt:(%,"neg") -> R
    imaginary: () -> %
    real: % -> R
    imag: % -> R
    conj: % -> %
  == DirectProduct(2,R) add
    Rep == DirectProduct(2,R)
    elt(x,"pos") == rep(x).1
    elt(x,"neg") == rep(x).2

    imaginary():% == per directProduct vector [1,-1]
    real(x:%):R == (rep(x).1 + rep(x).2)/(2::R)
    imag(x:%):R == (rep(x).1 - rep(x).2)/(2::R)
    conj(x:%):% == per directProduct vector [rep(x).2,rep(x).1]
    sqrt(x:%):% == per directProduct vector [  _
      sqrt real(x) + sqrt imag(x),  _
      ((if real(x)>=0 then sqrt real(x) else 0) - _
      (if real(x)<=0 then sqrt real(x) else 0)) + _
      ((if imag(x)<=0 then sqrt imag(x) else 0) - _
      (if imag(x)>=0 then sqrt imag(x) else 0)) ]
\end{spad}

\begin{axiom}
a:CM(EXPR INT) := 3
b:CM(EXPR INT) := -3
real(a)
s1:=sqrt(a)
real s1
imag s1
s2:=sqrt(b)
real s2
imag s2
I:CM(EXPR INT) := imaginary()
imag I
imag conj I
conj(a+b*I)
\end{axiom}

fricas
(1) -> <spad>
fricas
)abbrev domain CM ComplexManifold
ComplexManifold(R:Join(Field,RadicalCategory,OrderedSet)): Join(RadicalCategory,DirectProductCategory(2,R)) with
    elt:(%,"pos") -> R
    elt:(%,"neg") -> R
    imaginary: () -> %
    real: % -> R
    imag: % -> R
    conj: % -> %
  == DirectProduct(2,R) add
    Rep == DirectProduct(2,R)
    elt(x,"pos") == rep(x).1
    elt(x,"neg") == rep(x).2
imaginary():% == per directProduct vector [1,-1] real(x:%):R == (rep(x).1 + rep(x).2)/(2::R) imag(x:%):R == (rep(x).1 - rep(x).2)/(2::R) conj(x:%):% == per directProduct vector [rep(x).2,rep(x).1] sqrt(x:%):% == per directProduct vector [ _ sqrt real(x) + sqrt imag(x), _ ((if real(x)>=0 then sqrt real(x) else 0) - _ (if real(x)<=0 then sqrt real(x) else 0)) + _ ((if imag(x)<=0 then sqrt imag(x) else 0) - _ (if imag(x)>=0 then sqrt imag(x) else 0)) ]</spad>
fricas
Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/5976774624515024081-25px001.spad
      using system compiler.
   CM abbreviates domain ComplexManifold 
------------------------------------------------------------------------
   initializing NRLIB CM for ComplexManifold 
   compiling into NRLIB CM 
****** Domain: R already in scope
****** Domain: R already in scope
************* USER ERROR **********
available signatures for Rep: 
    NONE
NEED Rep: () -> ?
****** comp fails at level 1 with expression: ******
((DEF (|Rep|) (NIL) (|DirectProduct| 2 R)))
****** level 1  ******
x:= (DEF (Rep) (NIL) (DirectProduct 2 R))
m:= $EmptyMode
f:=
((((* #) (+ #) (|1| #) (< #) ...)))
>> Apparent user error: unspecified error

fricas
a:CM(EXPR INT) := 3
ComplexManifold is an unknown constructor and so is unavailable. Did you mean to use -> but type something different instead?