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

Edit detail for SandBoxComplexManifold revision 5 of 7

1 2 3 4 5 6 7
Editor: Bill Page
Time: 2009/06/21 16:14:16 GMT-7
Note: clean and add a little documentation

added:
Complex domain constructor done differently.

DirectProduct lifts many operations from the underlying domain automatically.

Complex values are represented as conjugate pairs.

removed:
-    elt:(%,"pos") -> R
-    elt:(%,"neg") -> R

changed:
-    elt(x,"pos") == rep(x).1
-    elt(x,"neg") == rep(x).2
-
-    imaginary():% == per directProduct vector [1,-1]
    pair(x:R,y:R):Rep == directProduct vector [x,y]
    dup(x:R):Rep == directProduct vector [x,x]
    import List R

    imaginary():% == per pair(1,-1)

changed:
-    conj(x:%):% == per directProduct vector [rep(x).2,rep(x).1]
    conj(x:%):% == per pair(rep(x).2,rep(x).1)

changed:
-    (x:% * y:%):% == per directProduct vector [ _
-      real(x)*rep(y).1 + imag(x)*rep(y).2,      _
-      real(x)*rep(y).2 - imag(x)*rep(y).1]
    (x:% * y:%):% == per pair( _
      real(x)*rep(y).1 + imag(x)*rep(y).2, _
      real(x)*rep(y).2 - imag(x)*rep(y).1)

added:
    iabs(x:%):R == sqrt norm x
    abs(x:%):% == per dup iabs x

changed:
-      (2::R)*atan(imag(x)/(sqrt(norm(x))+real(x)))
-    sqrt(x:%):% == per( sqrt(sqrt(norm(x)))*directProduct(vector [ _
      (2::R)*atan(imag(x)/(iabs(x)+real(x)))
    sqrt(x:%):% == per( sqrt(iabs(x))*pair( _

changed:
-      cos(arg(x)/(2::R)) - sin(arg(x)/(2::R))] ) )
-
-    -- [sqrt(abs real x)+sqrt(abs imag x).
-    -- sign(real x)*sqrt(abs real x)-sign(imag x)*sqrt(abs imag x)]
-    -- too complicated?
-    --sqrt(x:%):% == per directProduct vector [       _
-    --  (if real(x)>=0 then sqrt real(x) else sqrt(-real(x))) +    _
-    --  (if imag(x)<=0 then sqrt(-imag(x)) else sqrt imag(x)),     _
-    --  (if real(x)>=0 then sqrt real(x) else -sqrt(-real(x))) +   _
-    --  (if imag(x)<=0 then sqrt(-imag(x)) else -sqrt imag(x)) ]
      cos(arg(x)/(2::R)) - sin(arg(x)/(2::R)) ) )

added:
\begin{axiom}
)show CM EXPR INT
\end{axiom}
Compare:
\begin{axiom}
)show COMPLEX EXPR INT
\end{axiom}

Tests:

Complex domain constructor done differently.

DirectProduct lifts many operations from the underlying domain automatically.

Complex values are represented as conjugate pairs. \begin{spad} )abbrev domain CM ComplexManifold ComplexManifold(R:Join(Field,RadicalCategory,TranscendentalFunctionCategory,OrderedSet)): Join(RadicalCategory,DirectProductCategory(2,R)) with imaginary: () -> % real: % -> R imag: % -> R conj: % -> % norm: % -> R arg: % -> R coerce: % -> Complex R == DirectProduct(2,R) add -- represent as conjugate pair Rep == DirectProduct(2,R) pair(x:R,y:R):Rep == directProduct vector [x,y] dup(x:R):Rep == directProduct vector [x,x] import List R

imaginary():% == per pair(1,-1) real(x:%):R == (rep(x).1 + rep(x).2)/(2::R) imag(x:%):R == (rep(x).1 - rep(x).2)/(2::R) -- just swap conj(x:%):% == per pair(rep(x).2,rep(x).1) -- multiplication is interesting (x:% y:%):% == per pair( _ real(x)rep(y).1 + imag(x)rep(y).2, _ real(x)rep(y).2 - imag(x)rep(y).1) norm(x:%):R == retract(xconj(x)) iabs(x:%):R == sqrt norm x abs(x:%):% == per dup iabs x arg(x:%):R == real(x)<0 and imag(x)=0 => pi() (2::R)atan(imag(x)/(iabs(x)+real(x))) sqrt(x:%):% == per( sqrt(iabs(x))pair( cos(arg(x)/(2::R)) + sin(arg(x)/(2::R)), cos(arg(x)/(2::R)) - sin(arg(x)/(2::R)) ) )

coerce(x:%):OutputForm == complex(real x,imag x)$Complex(R)::OutputForm coerce(x:%):Complex(R) == complex(real x,imag x) \end{spad}

\begin{axiom} )show CM EXPR INT \end{axiom} Compare: \begin{axiom} )show COMPLEX EXPR INT \end{axiom}

Tests: \begin{axiom} a:CM(EXPR INT) := 3 b:CM(EXPR INT) := -5 real(a) norm a norm b ab:=ab real ab imag ab s1:=sqrt(a) real s1 imag s1 s2:=sqrt(b) real s2 imag s2 I:CM(EXPR INT) := imaginary() real I norm I imag I imag conj I s3:=sqrt(I) s3s3 c1:=conj(a+bI) real c1 imag c1 norm c1 c1::Complex(EXPR INT) sqrt % s4:=sqrt(c1) real s4 imag s4 s4s4 %::Complex(EXPR INT) normalize % %::Complex(EXPR INT)::Complex(INT) \end{axiom}


Some or all expressions may not have rendered properly, because Axiom returned the following error:
Error: export AXIOM=/usr/local/lib/open-axiom/x86_64-unknown-linux/1.3.0-2009-01-05; export ALDORROOT=/usr/local/aldor/linux/1.1.0; export PATH=$ALDORROOT/bin:$PATH; export HOME=/var/zope2/var/LatexWiki; ulimit -t 600; export LD_LIBRARY_PATH=/usr/local/lib/open-axiom/x86_64-unknown-linux/1.3.0-2009-01-05/lib; LANG=en_US.UTF-8 $AXIOM/bin/AXIOMsys < /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/1256844308733328586-25px.axm
Segmentation fault


Some or all expressions may not have rendered properly, because Latex returned the following error:
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
 \write18 enabled.
 %&-line parsing enabled.
entering extended mode
(./6273261374623983092-16.0px.tex
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, arabic, farsi, croatian, ukrainian, russian, bulgarian, czech, slov
ak, danish, dutch, finnish, basque, french, german, ngerman, ibycus, greek, mon
ogreek, ancientgreek, hungarian, italian, latin, mongolian, norsk, icelandic, i
nterlingua, turkish, coptic, romanian, welsh, serbian, slovenian, estonian, esp
eranto, uppersorbian, indonesian, polish, portuguese, spanish, catalan, galicia
n, swedish, ukenglish, pinyin, loaded.
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size12.clo))
(/usr/share/texmf-texlive/tex/latex/ucs/ucs.sty
(/usr/share/texmf-texlive/tex/latex/ucs/data/uni-global.def))
(/usr/share/texmf-texlive/tex/latex/base/inputenc.sty
(/usr/share/texmf-texlive/tex/latex/ucs/utf8x.def))
(/usr/share/texmf-texlive/tex/latex/bbm/bbm.sty)
(/usr/share/texmf-texlive/tex/latex/jknapltx/mathrsfs.sty)
(/usr/share/texmf-texlive/tex/latex/base/fontenc.sty
(/usr/share/texmf-texlive/tex/latex/base/t1enc.def))
(/usr/share/texmf-texlive/tex/latex/pstricks/pstricks.sty
(/usr/share/texmf-texlive/tex/generic/pstricks/pstricks.tex
`PSTricks' v1.15  <2006/12/22> (tvz)
(/usr/share/texmf-texlive/tex/generic/pstricks/pstricks.con))
(/usr/share/texmf/tex/latex/xcolor/xcolor.sty
(/etc/texmf/tex/latex/config/color.cfg)
(/usr/share/texmf-texlive/tex/latex/graphics/dvips.def)
(/usr/share/texmf-texlive/tex/latex/graphics/dvipsnam.def)))
(/usr/share/texmf-texlive/tex/latex/graphics/epsfig.sty
(/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty
(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty
(/usr/share/texmf-texlive/tex/latex/graphics/trig.sty)
(/etc/texmf/tex/latex/config/graphics.cfg))))
(/usr/share/texmf-texlive/tex/latex/pst-grad/pst-grad.sty
(/usr/share/texmf-texlive/tex/generic/pst-grad/pst-grad.tex
(/usr/share/texmf-texlive/tex/latex/xkeyval/pst-xkey.tex
(/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.tex)))
`pst-plot' v1.05, 2006/11/04 (tvz,dg,hv)))
(/usr/share/texmf-texlive/tex/latex/pstricks/pst-plot.sty
(/usr/share/texmf-texlive/tex/generic/pstricks/pst-plot.tex
 v97 patch 2, 1999/12/12
(/usr/share/texmf-texlive/tex/generic/multido/multido.tex
 v1.41, 2004/05/18 <tvz>)))
(/usr/share/texmf-texlive/tex/latex/geometry/geometry.sty
(/usr/share/texmf-texlive/tex/xelatex/xetexconfig/geometry.cfg)

Package geometry Warning: `lmargin' and `rmargin' result in NEGATIVE (-108.405p t). `width' should be shortened in length.

) (/usr/share/texmf-texlive/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `? option. (/usr/share/texmf-texlive/tex/latex/amsmath/amstext.sty (/usr/share/texmf-texlive/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf-texlive/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf-texlive/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf-texlive/tex/latex/amsfonts/amsfonts.sty) (/usr/share/texmf-texlive/tex/latex/amsfonts/amssymb.sty) (/usr/share/texmf-texlive/tex/latex/amscls/amsthm.sty) (/usr/share/texmf-texlive/tex/latex/setspace/setspace.sty Package: `setspace 6.7 <2000/12/01> ) (/usr/share/texmf-texlive/tex/generic/xypic/xy.sty (/usr/share/texmf-texlive/tex/generic/xypic/xy.tex Bootstrap'ing: catcodes, docmode, (/usr/share/texmf-texlive/tex/generic/xypic/xyrecat.tex) (/usr/share/texmf-texlive/tex/generic/xypic/xyidioms.tex)

Xy-pic version 3.7 <1999/02/16> Copyright (c) 1991-1998 by Kristoffer H. Rose <krisrose@ens-lyon.fr> Xy-pic is free software: see the User's Guide for details.

Loading kernel: messages; fonts; allocations: state, direction, utility macros; pictures: \xy, positions, objects, decorations; kernel objects: directionals, circles, text; options; algorithms: directions, edges, connections; Xy-pic loaded)) (/usr/share/texmf-texlive/tex/generic/xypic/xyall.tex Xy-pic option: All features v.3.3 (/usr/share/texmf-texlive/tex/generic/xypic/xycurve.tex Xy-pic option: Curve and Spline extension v.3.7 curve, circles, loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xyframe.tex Xy-pic option: Frame and Bracket extension v.3.7 loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xycmtip.tex Xy-pic option: Computer Modern tip extension v.3.3 (/usr/share/texmf-texlive/tex/generic/xypic/xytips.tex Xy-pic option: More Tips extension v.3.3 loaded) loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xyline.tex Xy-pic option: Line styles extension v.3.6 loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xyrotate.tex Xy-pic option: Rotate and Scale extension v.3.3 loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xycolor.tex Xy-pic option: Colour extension v.3.3 loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xymatrix.tex Xy-pic option: Matrix feature v.3.4 loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xyarrow.tex Xy-pic option: Arrow and Path feature v.3.5 path, \ar, loaded) (/usr/share/texmf-texlive/tex/generic/xypic/xygraph.tex Xy-pic option: Graph feature v.3.7 loaded) loaded) (/usr/share/texmf-texlive/tex/latex/tools/verbatim.sty) (/usr/share/texmf/tex/latex/graphviz/graphviz.sty (/usr/share/texmf-texlive/tex/latex/psfrag/psfrag.sty)) (/usr/share/texmf/tex/latex/sagetex.sty Writing sage input file 6273261374623983092-16.0px.sage (./6273261374623983092-16.0px.sout)) (/usr/share/texmf-texlive/tex/latex/gnuplottex/gnuplottex.sty (/usr/share/texmf-texlive/tex/latex/base/latexsym.sty) (/usr/share/texmf-texlive/tex/latex/moreverb/moreverb.sty) (/usr/share/texmf-texlive/tex/latex/base/ifthen.sty)) (./6273261374623983092-16.0px.aux) (/usr/share/texmf-texlive/tex/latex/ucs/ucsencs.def) Missing $ inserted. <inserted text> $ l.145 real(x)rep(y).1 + imag(x)rep(y).2, _

(/usr/share/texmf-texlive/tex/latex/jknapltx/ursfs.fd) (/usr/share/texmf-texlive/tex/latex/amsfonts/umsa.fd) (/usr/share/texmf-texlive/tex/latex/amsfonts/umsb.fd) (/usr/share/texmf-texlive/tex/latex/base/ulasy.fd) Missing $ inserted. <inserted text> $ l.156

[1] (/usr/share/texmf-texlive/tex/latex/base/t1cmtt.fd)

LaTeX Warning: Characters dropped after `\end{axiom}' on input line 162.

LaTeX Warning: Characters dropped after `\end{axiom}' on input line 165.

LaTeX Warning: Characters dropped after `\end{axiom}' on input line 201.

[2] (./6273261374623983092-16.0px.aux) ) (see the transcript file for additional information) Output written on 6273261374623983092-16.0px.dvi (2 pages, 2852 bytes). Transcript written on 6273261374623983092-16.0px.log.