Software Companion Overview

Vladimir V. Kisil

Contents

Chapter 1  How to Use the Software

The enclosed DVD (ISO image) with software is derived from several open-source projects, notably Debian GNU–Linux [5], GiNaC library of symbolic calculations [2], Asymptote [7] and many others. Thus, our work is distributed under the GNU General Public License (GPL) 3.0 [6].

You can download an ISO image of a Live GNU–Linux DVD with our CAS from several locations. The initial (now outdated) version was posted through the Data Conservancy Project arXiv.org associated to paper [8]. A newer version of ISO is now included as an auxiliary file to the same paper, see the subdirectory:

http://arxiv.org/src/cs/0512073v11/anc

Also, an updated versions of the ISO image is uploaded to Google Drive:

https://docs.google.com/file/d/0BzfWNH9hAT3VMFl6Z3Z4aVJmcW8

In this Appendix, we only briefly outline how to start using the enclosed DVD or ISO image. As soon as the DVD is running or the ISO image is mounted as a virtual file system, further help may be obtained on the computer screen. We also describe how to run most of the software on the disk on computers without a DVD drive at the end of Sections 1.1, 1.2.1 and 1.2.2.

1.1  Viewing Colour Graphics

The easiest part is to view colour illustrations on your computer. There are not many hardware and software demands for this task—your computer should have a DVD drive and be able to render HTML pages. The last task can be done by any web browser. If these requirements are satisfied, perform the following steps:

If your computer does not have a DVD drive (e.g. is a netbook), but you can gain brief access to a computer with a drive, then you can copy the top-level folder doc from the enclosed DVD to a portable medium, say a memory stick. Illustrations (and other documentation) can be accessed by opening the index.html file from this folder.

In a similar way, the reader can access ISO images of bootable disks, software sources and other supplementary information described below.

1.2  Installation of CAS

There are three major possibilities of using the enclosed CAS:

Method A is straightforward and can bring some performance enhancement. However, it requires hardware compatibility; in particular, you must have the so-called i386 architecture. Method B will run on a much wider set of hardware and you can use CAS from the comfort of your standard desktop. However, this may require an additional third-party programme to be installed.

1.2.1  Booting from the DVD Disk

WARNING: it is a general principle, that running a software within an emulator is more secure than to boot your computer in another OS. Thus we recommend using the method described in Section 1.2.2.

It is difficult to give an exact list of hardware requirements for DVD booting, but your computer must be based on the i386 architecture. If you are ready to have a try, follow these steps:

If the DVD boots but the graphic X server did not start for any reason and you have the text command prompt only, you can still use most of the CAS. This is described in the last paragraph of Section 1.3.


Figure 1.1: Initial screens of software start up. Left, DVD boot menu; right, initial screen after the booting.

If your computer does not have a DVD drive you may still boot the CAS on your computer from a spare USB stick of at least 1Gb capacity. For this, use UNetbootin [1] or a similar tool to put an ISO image of a boot disk on the memory stick. The ISO image(s) is located at the top-level folder iso-images of the DVD and the file README in this folder describes them. You can access this folder as described in Section 1.1.

1.2.2  Running a Linux Emulator

You can also use the enclosed CAS on a wide range of hardware running various operating systems, e.g. Linux, Windows, Mac OS, etc. To this end you need to install a so-called virtual machine, which can emulate i386 architecture. I would recommend VirtualBox [9]—a free, open-source program which works well on many existing platforms. There are many alternatives (including open-source), for example: Qemu [3], Open Virtual Machine [10] and some others.

Here, we outline the procedure for VirtualBox—for other emulators you may need to make some adjustments. To use VirtualBox, follow these steps:

If you succeeded in this you may proceed to Section 1.3. Some tips to improve your experience with emulations are described in the detailed electronic manual.

1.2.3  Recompiling the CAS on Your OS

The core of our software is a C++ library which is based on GiNaC [2]—see its web page for up-to-date information. The latter can be compiled and installed on both Linux and Windows. Subsequently, our library can also be compiled on these computers from the provided sources. Then, the library can be used in your C++ programmes. See the top-level folder src on the DVD and the documentation therein. Also, the library source code (files cycle.h and cycle.cpp) is produced in the current directory if you pass the TEX file of the paper [8] through LATEX.

Our interactive tool is based on pyGiNaC [4]—a Python binding for GiNaC. This may work on many flavours of Linux as well. Please note that, in order to use pyGiNaC with the recent GiNaC, you need to apply my patches to the official version. The DVD contains the whole pyGiNaC source tree which is already patched and is ready to use.

There is also a possibility to use our library interactively with swiGiNaC [11], which is another Python binding for GiNaC and is included in many Linux distributions. The complete sources for binding our library to swiGiNaC are in the corresponding folder of the enclosed DVD. However, swiGiNaC does not implement full functionality of our library.

1.3  Using the CAS and Computer Exercises

Once you have booted to the GUI with the open CAS window as described in Subsections 1.2.1 or 1.2.2, you may need to configure your keyboard (if it is not a US layout). To install, for example, a Portuguese keyboard, you may type the following command at the prompt of the open window:

In [2]: !change-xkbd pt

The keyboard will be switched and the corresponding national flag displayed at the bottom-left corner of the window. For another keyboard you need to use the international two-letter country code instead of pt in the above command. The first exclamation mark tells that the interpreter needs to pass this command to the shell.

1.3.1  Warming Up

The first few lines at the top of the CAS windows suggest several commands to receive a quick introduction or some help on the IPython interpreter. Our CAS was loaded with many predefined objects—see Section 1.5. Let us see what C is, for example:

In [3]: print C
------> print(C)
[cycle2D object]

In [4]: print C.string()
------> print(C.string())
(k, [L,n],m)

Thus, C is a two-dimensional cycle defined with the quadruple (k,l,n,m). Its determinant is:

In [5]: print C.hdet()
------> print(C.hdet())
k*m-L**2+si*n**2 

Here, si stands for σ—the signature of the point space metric. Thus, the answer reads kml2n2—the determinant of the SFSCc matrix of C. Note, that terms of the expression can appear in a different order: GiNaC does not have a predefined sorting preference in output.

As an exercise, the reader may now follow the proof of Theorem 4.13, remembering that the point P and cycle C are already defined. In fact, all statements and exercises marked by the symbol on the margins are already present on the DVD. For example, to access the proof of Theorem 4.13, type the following at the prompt:

In [6]: %ed ex.4.13.py

Here, the special %ed instructs the external editor jed to visit the file ex.4.13.py. This file is a Python script containing the same lines as the proof of Theorem 4.13 in the book. The editor jed may be manipulated from its menu and has command keystrokes compatible with GNU Emacs. For example, to exit the editor, press Ctrl-X Ctrl-C. After that, the interactive shell executes the visited file and outputs:

In [6]: %ed ex.4.13.py
Editing... done. Executing edited code...
Conjugated cycle passes the Moebius image of P: True

Thus, our statement is proven.

For any other CAS-assisted statement or exercise you can also visit the corresponding solution using its number next to the symbol in the margin. For example, for Exercise 6.22, open file ex.6.22.py. However, the next mouse sign marks the item 6.24.i, thus you need to visit file ex.6.24.i.py in this case. These files are located on a read-only file system, so to modify them you need to save them first with a new name (Ctrl-X Ctrl-W), exit the editor, and then use %ed special to edit the freshly-saved file.

1.3.2  Drawing Cycles

You can visualise cycles instantly. First, we open an Asymptote instance and define a picture size:

In [7]: A=asy()
Asymptote session is open.  Available methods are:
    help(), size(int), draw(str), fill(str), clip(str), ...

In [8]: A.size(100)

Then, we define a cycle with centre (0,1) and σ-radius 2:

In [9]: Cn=cycle2D([0,1],e,2)

In [10]: print Cn.string()
------> print(Cn.string())
(1, [0,1],-2-si)

This cycle depends on a variable sign and it must be substituted with a numeric value before a visualisation becomes possible:

In [11]: A.send(cycle2D(Cn.subs(sign==-1)).asy_string())

In [12]: A.send(cycle2D(Cn.subs(sign==0)).asy_string())

In [13]: A.send(cycle2D(Cn.subs(sign==1)).asy_string())

In [14]: A.shipout("cycles")

In [15]: del(A)

By now, a separate window will have opened with cycle Cn drawn triply as a circle, parabola and hyperbola. The image is also saved in the Encapsulated Postscript (EPS) file cycles.eps in the current directory.

Note that you do not need to retype inputs 12 and 13 from scratch. Up/down arrows scroll the input history, so you can simply edit the value of sign in the input line 11. Also, since you are in Linux, the Tab key will do a completion for you whenever possible.

The interactive shell evaluates and remember all expressions, so it may sometime be useful to restart it. It can be closed by Ctrl-D and started from the Main Menu (the bottom-left corner of the screen) using Accessories → CAS pycyle. In the same menu folder, there are two items which open documentation about the library in PDF and HTML formats.

1.3.3  Further Usage

There are several batch checks which can be performed with CAS. Open a terminal window from Main Menu → Accessories → LXTerminal. Type at the command prompt:

$ cd ~/CAS/pycycle/
$ ./run-pyGiNaC.sh test_pycycle.py

A comprehensive test of the library will be performed and the end of the output will look like this:

True: sl2_clifford_list:  (0)
True: sl2_clifford_matrix:  (0)
True: jump_fnct (-1)

Finished. The total number of errors is 0

Under normal circumstances, the reported total number of errors will, of course, be zero. You can also run all exercises from this book in a batch. From a new terminal window, type:

$ cd ~/CAS/pycycle/Examples/
$ ./check_all_exercises.sh 

Exercises will be performed one by one with their numbers reported. Numerous graphical windows will be opened to show pencils of cycles. These windows can be closed by pressing the q key for each of them. This batch file suppresses all output from the exercises, except those containing the False string. Under normal circumstances, these are only Exercises 7.14.i and 7.14.ii.

You may also access the CAS from a command line. This may be required if the graphic X server failed to start for any reason. From the command prompt, type the following:

$ cd ~/CAS/pycycle/Examples/
$ ./run-pyGiNaC.sh 

The full capacity of the CAS is also accessible from the command prompt, except for the preview of drawn cycles in a graphical window. However, EPS files can still be created with Asymptote—see shipout() method.

1.4  Library for Cycles

Our C++ library defines the class cycle to manipulate cycles of arbitrary dimension in a symbolic manner. The derived class cycle2D is tailored to manipulate two-dimensional cycles. For the purpose of the book, we briefly list here some methods for cycle2D in the pyGiNaC binding form only.

constructors
There are two main forms of cycle2D constructors:
C=cycle2D(k,[l,n],m,e) # Cycle defined by a quadruple
Cr=([u,v],e,r) # Cycle with center at [u,v] and radius r2
In both cases, we use a metric defined by a Clifford unit e.
operations
Cycles can be added (+), subtracted (-) or multiplied by a scalar (method exmul()). A simplification is done by normal() and substitution by subs(). Coefficients of cycles can be normalised by the methods normalize() (k-normalisation) and normalize_det().
evaluations
For a given cycle, we can make the following evaluations: hdet()—determinant of its SFSCc matrix, radius_sq()—square of the radius, val()—value of a cycle at a point, which is the power of the point to the cycle.
similarities
There are the following methods for building cycle similarities: sl2_similarity(), matrix_similarity() and cycle_similarity() with an element of SL2(ℝ), a matrix or another cycle, respectively.
checks
There are several checks for cycles, which return GiNaC relations. The latter may be converted to Boolean values if no variables are presented within them. The checks for a single cycle are: is_linear(), is_normalized() and passing(), the latter requires a parameter (point). For two cycles, they are is_orthogonal() and is_f_orthogonal().
specialisation
Having a cycle defined through several variables, we may try to specialise it to satisfy some further conditions. If these conditions are linear with respect to the cycle’s variables, this can be achieved through the very useful method subject_to(). For example, for the above defined cycle C, we can find
C2=C.subject_to([C.passing([u,v]), C.is_orthogonal(C1)])
where C2 will be a generic cycle passing the point [u,v] and orthogonal to C1. See the proof of Theorem 4.13 for an application.
specific
There are the following methods specific to two dimensions: focus(), focal_length()—evaluation of a cycle’s focus and focal length and roots()—finding intersection points with a vertical or horizontal line. For a generic line, use method line_intersect() instead.
drawing
For visualisation through Asymptote, you can use various methods: asy_draw(), asy_path() and asy_string(). They allow you to define the bounding box, colour and style of the cycle’s drawing. See the examples or full documentation for details of usage.

Further information can be obtained from electronic documentation on the enclosed DVD, an inspection of the test file CAS/pycycle/test_pycycle.py and solutions of the exercises.

1.5  Predefined Objects at Initialisation

For convenience, we predefine many GiNaC objects which may be helpful. Here is a brief indication of the most-used:

realsymbol.
a, b, c, d: elements of SL2(ℝ) matrix.
u, v, u1, v1, u2, v2: coordinates of points.
r, r1, r2: radii.
k, l, n, m, k1, l1, n1, m1: components of cycles.
sign, sign1, sign2, sign3, sign4: signatures of various metrics.
s, s1, s2, s3: s parameters of SFSCc matrices.
x, y, t: spare to use.
varidx.
mu, nu, rho, tau: two-dimensional indexes for Clifford units.
matrix.
M, M1, M2, M3: diagonal 2× 2 matrices with entries −1 and i-th sign on their diagonal.
sign_mat, sign_mat1, sign_mat2: similar matrices with i-th s instead of sign.
clifford_unit.
e, es, er, et: Clifford units with metrics derived from matrices M, M1, M2, M3, respectively.
cycle2D.
The following cycles are predefined:
C=cycle2D(k,[l,n],m,e)     # A generic cycle   
C1=cycle2D(k1,[l1,n1],m1,e)# Another generic cycle   
Cr=([u,v],e,r2) # Cycle with centre at [u,v] and radius r2
Cu=cycle2D(1,[0,0],1,e)    # Unit cycle
real_line=cycle2D(0,[0,1],0,e)
Z=cycle2D([u,v], e)        # Zero radius cycles at [u,v]
Z1=cycle2D([u1,v1], e)     # Zero radius cycles at [u1,v1]
Zinf=cycle2D(0,[0,0],1,e)  # Zero radius cycles at infinity

The solutions of the exercises make heavy use of these objects. Their exact definition can be found in the file CAS/pycycle/init_cycle.py from the home directory.

References

[1]
Arpad and Geza Kovacs. UNetbootin—Create Bootable Live USB Drives for Linux, 2011. http://unetbootin.sourceforge.net/.
[2]
Christian Bauer, Alexander Frink, Richard Kreckel, and Jens Vollinga. GiNaC is Not a CAS, 2001–. http://www.ginac.de/.
[3]
Fabrice Bellard. QEMU—a Generic and Open Source Machine Emulator and Virtualizer, 2011. http://qemu.org/.
[4]
Jonathan Brandmeyer. PyGiNaC—a Python interface to the C++ symbolic math library GiNaC, 2004–2007. http://sourceforge.net/projects/pyginac/.
[5]
Project Debian. Debian—The Universal Operating System. Software in the Public Interest, Inc., 1997–2011. http://www.debian.org/.
[6]
GNU. General Public License (GPL). Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, version 3 edition, 29 June 2007. http://www.gnu.org/licenses/gpl.html.
[7]
Andy Hammerlindl, John Bowman, and Tom Prince. Asymptote—powerful descriptive vector graphics language for technical drawing, inspired by MetaPost, 2004–2011. http://asymptote.sourceforge.net/.
[8]
Vladimir V. Kisil. Fillmore-Springer-Cnops construction implemented in GiNaC. Adv. Appl. Clifford Algebr., 17(1):59–70, 2007. Updated full text and source files: arXiv:cs.MS/0512073, On-line.
[9]
Oracle. VirtualBox—Powerful x86 and AMD64/Intel64 Virtualization Product, 2011. http://www.virtualbox.org.
[10]
OVMTP. Open Virtual Machine—the Open Source Implementation of VMware Tools. http://open-vm-tools.sourceforge.net/.
[11]
Ola Skavhaug and Ondrej Certik. swiGiNaC—a Python Interface to GiNaC, Built with SWIG, 2010. http://swiginac.berlios.de/.
visitors to this page since 20/10/2011.
Search this site powered by FreeFind

Last modified: July 10, 2013.
This document was translated from LATEX by HEVEA.