Ymol


Ymol available freely for downloading!

Ymol is a molecular visualisation and animation program for the X Window System written from scratch. It can be used to create production quality images, and movies, using either the built in renderer or by exporting the scenes to POVRAY (Persistence of Vision). Ymol contains a programming language of its own, which can be used to create presentations that run non-interactively.

The rotating C60 molecule below was rendered with Ymol.

Rotating C60, 174x163 pixels

For more examples see the picture gallery.


The current version of ymol is 0.8.134. Ymol is currently in an alpha stage of program development, but is mostly very stable, anyway. When it reaches version 0.9.x it will be considered to be in the beta stage. Ymol is available as a binary and source distribution free for non commercial use. Although development and testing mainly occurs on Linux (i386 and x86_64), Ymol has been tested to run on Linux, FreeBSD, IRIX, OSF/1, ULTRIX, AIX, Solaris, HP-UX (PA), and Win32 (Cygwin). Ymol should be fairly easy to port to anything running *nix and X11.
Pretty-looking pictures with many atoms might take some time to render, but the default mode Ymol operates in is very fast and suitable for interactive use. Using only core Xlib calls to draw circles, polygons and lines, Ymol shows real time movies on slow (486 class) machines. Ymol can also use the POVRay raytracer.


Download ymol

Go to Ymol distribution directory

Latest updates

  • 2009-05-23: When deleting atoms all labels were removed. Fixed. Released source and Linux (i386, x86_64) binaries for the 0.8.134 version.
  • 2009-03-30: Updated to fix sockimport from crashing if. Released source for the 0.8.133 version.
  • 2007-10-22: Small change: default distance between eyes is 1 angstrom in stereo view. Version 0.8.132 (not publically released).
  • 2007-10-17: Released source and Linux (i386, x86_64) binaries for the 0.8.131 version.
  • 2007-10-17: Primarily many changes to the stereographic mode. It now works for all view modes, also with povray. See the image gallery for an example. Also a couple of rendering mode bug fixes.
  • 2007-10-10: Released source and Linux (i386, x86_64) binaries for the 0.8.130 version.
  • 2007-10-10: Added possibility to assign explicit bonds in the ymol socket interface. Check the testsockbond.for example.
  • 2007-10-05: Released source and Linux (i386, x86_64) binaries for the 0.8.129 version.
  • 2007-10-05: Added Triangelize mode.
  • 2007-09-15: Released source and Linux (i386, x86_64) binaries for the 0.8.128 version.
  • 2007-09-15: Wrote a ymol library which can be linked into other applications to ease the use of ymol as a realtime visualization package for other application. Wrote the ymolssh command to allow forwarding of the ymol ports used for visualization through a firewall. See ymolssh for more information.
  • 2007-08-30: Released source for 0.8.127 version. Only difference is a removal of winsock test, which made ymol not compile under cygwin, so no need to release binaries for this version.
  • 2007-08-12: Released source and Linux (i386, x86_64) binaries for the 0.8.126 version.
  • 2007-08-12: Some minor fixes, such as cleanup of the ymolpid and ymol_sockimport files at program exit.
  • 2007-08-10: Released source and Linux (i386, x86_64) binaries for the 0.8.125 version.
  • 2007-08-10: Added new stereographic display mode.
  • 2007-08-10: Released source and Linux (i386, x86_64) binaries for the 0.8.124 version.
  • 2007-08-10: Added new socket interface to ymol. The testsocket.py python program in the ymol distribution demonstrates the use of this socket interface.
  • 2007-02-14: Released source and Linux (i386, x86_64) binaries for the 0.8.123 version.
  • 2006-11-02: Several bug fixes.
  • 2006-10-13: Position and color of atomlabels can now be modified through the CLI. Several bug fixes.
  • 2006-03-07: Released source, Linux (i386, x86_64), and FreeBSD (i386) binaries for the 0.8.120 version.
  • 2006-03-07: Phong RSV and N can now be accessed easily through the default atom properties dialog.
  • 2006-03-06: The default window size is now 720x576 to ease the creation of PAL video.
  • 2006-03-06: Bondrules are now much faster to calculate, since a cell searching O(N) algorithm replaced the old O(N2).
  • 2005-06-14: Can now read some files from the mdsus program.
  • 2005-04-07: Released source for the 0.8.119 version.
  • 2004-11-17: Can export data explorer from the CLI.
  • 2004-05-28: User can load new fonts.
  • 2004-05-22: Released source for the 0.8.118 version. Released source for Xco 0.2.136 and y4vm 0.8.22.
  • 2004-05-12: Now supports x86_64.
  • 2004-03-22: Released Linux (i386) binaries for the 0.8.118 version.
  • 2003-11-24: Loop control widget added to control panel.
  • 2003-11-24: The povray mode now honours the camera constant in the rendering parameters.
  • 2003-05-01: Can now translate the molecules, not only zoom and rotate
  • 2003-01-28: Released source for the 0.8.117 version.

Picture gallery

Click on this image to see a snapshot of ymol running on my Linux box. Now a AMD Athlon64X2 4200+, running Scientific Linux 4.4. The windowmanager is ion3-rc20070608. Ymol doesn't work so well with only tabs (but quite acceptable if you know how to deal with ion :-), so here a floating workspace is used. Ymol snapshot
This picture was generated with the stereo mode and the povray raytracer. The image portrays liquid water. Liquid water
This picture demonstrates the new stereographic mode, showing an [Al(H2O)6]3+ cluster. Aluminum hexahydrate
Realtime animation generated via the socket interface with the python program testsocket.py Realtime anim
small ethanol triangelize Ethanol rendered with the new triangelize mode. This mode might be useful for publishing and possibly posters, since vector graphics is used throughout, apart from looking a bit better on screen. PDF example available here
Click on this image to see an animation of a vibrational mode of [K(H2O)2]+. This uses the default ymol mode where bonds are drawn using polygons and atoms are drawn using a number of circles. Potassium and two water molecules in
the gas phase, trapped in a vibration, with no possibility to give
away any energy.
Click on this image to see an animation of the vibrations in a MgO crystal. This uses the simplest ymol mode, where bonds are drawn using lines and atoms are not drawn at all. Here fogging is also used to make more distant bonds drawn closer the color of the background. MgO wireframe
An animation of the motion of a lithium ion dissolved in a mixture of water and acetonitrile saved by ymol as a set of povray input files and put together with time dependent transparency in the same image. Click for a larger image. Blurred motion
Click on this image to see an animation of liquid water (a big gif animation!). liquid water
Click on this image to see an animation of an exchange of a water molecule around a lithium ion. lih2oexchange
Click on this image to see an image rendered with POVRAY. The molecules are snapshots of the animation of an exchange of a water molecule around the lithium ion. povimage
Click on this image to see a MPEG movie of a rotating NaCl unit cell, rendered with POVRAY within Ymol. povanim

The ymol library

The ymol library makes it easy to use ymol as a visualization package. An example C-program:

#include <stdio.h>
#include <math.h>
#include "ymolsock.h"

int main()
{
  double t=0.;
  int n=200;
  double radius=5.;
  double step=1./(n*50);
  double pi=3.1415926;
  ymolsock_init();
  while (1)
    {
      int i;
      if (ymolsock_check_ymol())
	{
	  if (ymolsock_write_natoms(n))
	    {
	      for (i=0; i<n; i++)
		{
		  double x=radius*sin(3*(t+i*pi*2/n));
		  double y=radius*cos(5*(t+i*pi*2/n));
		  double z=radius*cos(7*(t+i*pi*2/n));
		  ymolsock_write_atom(i,1,x,y,z);
		}
	    }
	}
      t+=pi*2*step;
    }

  ymolsock_deinit();
  return 0;
}
An example Fortran-program:
      program testsock
      implicit double precision (a-h,o-z)
      t=0.d0
      n=200
      r=5.d0
      step=1.d0/(n*50);
      pi=3.1415926
      call yscini
 10   call yscchy(ierr)
      if (ierr.ne.0) then
        call yscwna(n,ierr)
        if (ierr.ne.0) then
          do i=1,n
            x=r*sin(3*(t+i*pi*2/n))
            y=r*cos(5*(t+i*pi*2/n))
            z=r*cos(7*(t+i*pi*2/n))
            call yscwat(i,1,x,y,z,ierr)
          enddo
        endif
      endif
      t=t+pi*2*step
      goto 10
      call yscdin
      stop
      end
When ymol is compiled and installed as an ordinary user on a Linux x86_64 platform an include file and a library is installed in $HOME/lib/Linux.x86_64. The C program above can then easily be compiled using:
gcc -O2 -o testsock testsock.c -L$HOME/lib/Linux.x86_64 -I$HOME/lib/Linux.x86_64 -lymol -lm
The Fortran program above is easily compiled as well using:
g77 -O2 -o testsock testsock.for -L$HOME/lib/Linux.x86_64 -lymol

The ymolssh command

ymolssh The ymolssh command can be used to visualize a simulation running on a remote computer if you or the remote computer is behind a firewall. If there's no firewall in between, it is only necessary to start ymol and copy the "ymol_sockimport" to the directory where the simulation is running. If the simulation is running on the computer named simmachine in the directory simdirectory it is only necessary to type
ymolssh simmachine:simdirectory 10201
The port (10201) on the remote host (simmachine) used to forward the ymol data is necessary to give as well. Use any unused port.
Should the simulation be running on a remote computer with no ssh-access, it may be necessary to go to that machine in steps. This is also supported by ymolssh:
ymolssh simmachinefrontend:simdirectory 10201 simmachine 10201
See the image for a real example of this.
This page contains graphics rendered with Ymol.

More Chemistry software for Linux @ linux4chemistry

Back to Daniel Spångbergs homepage
Last updated Wed Oct 17, 2007

Valid HTML 4.0!