None Software_installation_GUI_integration

Installing the libraries and integration with GUI

Installing the software

To use these notebooks you need to install binary MoebInv libraries and their dependencies.

In short, you simply need to execute it in CoLab or your Ubuntu Focal desktop the next cell:

In [1]:
%%bash

DISTRO=` grep -e "^ID=" /etc/os-release | cut -d= -f2 `
# Execute this cell on Ubuntu only
if echo "ubuntu debian" | grep -qw "$DISTRO" ; then \
    echo "Continue on $DISTRO " ; \
else \
    echo 'Does not look like an Ubuntu/Debian box, exiting' ; \
    exit ; \
fi

# Check if the software is already installed
if dpkg -l python3-pymoebinv > /dev/null ; then \
    echo 'The package is already installed, exiting' ; \
    exit ; \
fi

# Install signature key of the Ubuntu/Debian repository
## apt-key is now obsolete
curl -L https://sourceforge.net/projects/moebinv/files/binary/$DISTRO/moebinv.gpg.key | \
gpg --dearmor > /etc/apt/trusted.gpg.d/moebinv-archive-keyring.gpg

## An alternative installation with a keyring package.
#cd /tmp;\
#wget --backups=1 https://sourceforge.net/projects/moebinv/files/binary/$DISTRO/moebinv-archive-keyring_0.2_all.deb && \
#dpkg -i moebinv-archive-keyring_0.2_all.deb

# Add Ubuntu/Debian repository to known sources
CODENAME=`grep -e "VERSION_CODENAME" /etc/os-release | cut -d= -f2`
echo "deb https://sourceforge.net/projects/moebinv/files/binary/$DISTRO $CODENAME main" > \
     /etc/apt/sources.list.d/moebinv.list 

# Update the contents of the repository
apt update 

# Install required packages and their dependencies
apt-get -q -y install asymptote python3-pymoebinv

# Copy useful initialisation file to the current directory
zcat /usr/share/doc/python3-pymoebinv/EPAL-v1/init_cycle.py.gz > init_cycle.py
Continue on debian 
The package is already installed, exiting

If all above commands are finished without errors the MoebInv is ready to use

Older version v3.5.5

The above instructions install the latest MoebInv distribution with version >= v3.5.6. The older version v3.5.5 remains available and may be downloaded by the following instructions:

In [2]:
%%bash

# Execute this cell on Ubuntu only
if grep -e "ID=ubuntu" /etc/os-release ; then \
    echo 'Continue on Ubuntu' ; \
else \
    echo 'Does not look like an Ubuntu box, exiting' ; \
    exit ; \
fi

# Addtitional standard packages need to be installled
apt-get update && apt-get -q -y install ginac-tools asymptote libboost-python1.65.1 libpython3.6

# MoebInv library binary package
curl -LO https://sourceforge.net/projects/moebinv/files/binary/debian/libmoebinv0_latest_amd64.deb; \ 
dpkg -i libmoebinv0_latest_amd64.deb && rm  libmoebinv0_latest_amd64.deb

# remove an installed version of the Python wrapper 
if [ -f /usr/bin/moebinv-uninstall.sh ]; then \ 
  /usr/bin/moebinv-uninstall.sh ; \
fi

# Installation of the Python wrapper  
curl -L https://sourceforge.net/projects/moebinv/files/binary/pymoebinv.tbz | tar jvx --directory=/
Does not look like an Ubuntu box, exiting

If this does not work at Google CoLab you may need Cut&Paste the above cell into the intended notebook and execute it from there. I still did not figure out how CoLab managed virtual machines and respective environments. From this point of view Code Ocean is much more integrated.

The same command will install MoebInv library on your Ubuntu-18.04/Debian-10/etc Linux-x86-64 (amd64) box.

Alternatively, there is also a CodeOcean capsule with the same facilities.

Some hints

  • From initialisation MoebInv outputs mathematics as LaTeX code. This may not be always rendered nice. For example, GitHub smartly processes LaTeX output, while CoLab puts LaTeX commands as an ordinary text. In latter case plain text output may be more readable.

You can toggle the LaTeX output at any time by latex_on() amd latex_off() commands.

  • Asymptote interface creates script files (with *.asy extension) in the local directory. Files are named after the string in shipout() command. If Asymptote was able to generate a PNG file from this script, it will be shown in the notebook output. You can edit or otherwise use the produced Asymptote script file.

Jupyter and Yaglom integration

There is a Graphical User Interface (GUI) to the MoebInv library—Yaglom, named after Soviet mathematician Isaak Moiseevich Yaglom (Russian: Исаак Моисеевич Яглом). It allows to create and research geometrical constructions by mouse clicks. You may find a pre-compiled Yaglom binary distribution for your desktop platform at SourceForge.

There is bidirectional integration beetween Jupyter and Yaglom:

  • From Jupyter (or any coding system in C++ or Python) use
F.save("my-figure-archive.gar")

to save GiNaC Gar archive. It can be loaded into Yaglom (or any other front-end, indeed).

  • From Yaglom select
File → Export figure → Export Python script

in Main Menu and save the script file. Then it can be executed in the IPython or Jupyter cell.

Furthermore, to use such code as Jupyter notebook I recommend to post-process the generated Python script with p2j (Python to Jupyter) utility.

Here is an Example of Python script and Jupyter notebook automatically created from Yaglom.

References

  1. Vladimir V. Kisil, MoebInv: Symbolic, numeric and graphic manipulations in non-Eclidean geometry, SourceForge repository, 2004-2019.

  2. Vladimir V. Kisil. Geometry of Möbius Transformations: Elliptic, Parabolic and Hyperbolic Actions of $SL_2(\mathbb{R})$. Imperial College Press, London, 2012. Includes a live DVD.

  3. Vladimir V. Kisil, MoebInv notebooks, 2019.

Further info: