Skip to content

Avogadro at the APS March Meeting and Q-Chem Workshop

So last week was extremely busy. The APS March Meeting was held in Pittsburgh and Q-Chem held a workshop on Q-Chem at the end of the week. I presented a poster on Avogadro (shown below), met lots of interesting people and got lots of new ideas for both research and Avogadro.

Avogadro poster

As we push towards making a 1.0 release of Avogadro, getting feedback from users in the scientific community is extremely important. As Q-Chem chose to use Avogadro as the builder/visualizer in their workshop I had the opportunity to observe new Avogadro users interact with our application for the first time. I also had the opportunity to help them overcome some initial issues and gained a few new insights.

I was very pleased to meet people at all stages of their career who were very interested in having an open source application that can provide a framework for building and visualizing molecules. I also realized that two of the most sought after features in Avogadro right now are the capability to easily make movies, and a z-matrix editor. People loved the ray-traced images of surfaces, coincidentally I received a request from someone in the press wanting to use an image I put up on my blog last year of ray-traced benzene molecules.

I look forward to hearing from some of the new users we gained in the last week. It is great to see Avogadro receiving more attention. I have started to work on the z-matrix editor and spent the weekend experimenting with movies - more to come soon!

Manifest Hell...The New DLL Hell?

I am going to shock you all and admit that I am not a Windows programmer! I do however know quite a bit about cross-platform development and have now learnt the joy that is the manifest in Windows development. It seems that DLL hell is now a thing of the past, all hail manifest hell. A week ago I was not aware of these wonderful little files and this post is an attempt to document what I learned while packaging Avogadro for Windows.

After listening to Bill's talk at Camp KDE I was convinced that it really was a good idea to use CPack to package Avogadro. So when I got back home I spent a day or two getting a Windows development environment set up for Avogadro. We have several dependencies such as Qt and this post documenting a bug in the Visual Studio 9 service pack. So I edited the manifest and lied about the version of the DLLs - it believed me.

Next I found that none of our plugins would load. They are Qt plugins that implement most of the functionality in Avogadro. I found a very long thread on this subject, the crux of which is that the embedded manifests are causing Windows to look for the runtime libraries in the plugin directory. Copying them did indeed work but was not optimal. I found that by adding set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO") to our CMakeLists.txt manifests were no longer made for our plugins (which are loadable modules).

So all is quite well with our Windows build now I think. If you would like to try out a new Windows installer, then please download it from here and let me know if it works for you. I have tested it on Windows 2000 and XP virtual machines. This is not the final installer, I need to add some extra data files for OpenBabel and ensure I got the other dependencies right.

If anyone with more Windows experience knows of better solutions please let me know. CPack is absolutely awesome, it seems a shame that the deployment of applications is made so difficult. I know that plugins are not as widely used and so hopefully this post will add to the collective knowledge indexed by Google.

Qt Going LGPL

Just to add that I think this is absolutely amazing news - Qt is going to add LGPL licensing as an option. For the few situations I have questioned using the Qt library it has mainly been an issue of license. I think this is huge news and now cannot see any downsides to using Qt when working on C++ GUI applications and libraries.

Thanks - I can't wait to thank some of you in person at Camp KDE!

Git and Automatic ChangeLog Generation

After our move to use Git and GitHub to host our repository I got thinking about ChangeLogs. Having a version controlled file, where you manually add details about what the version control system should be recording seems like it should not be necessary. I searched and couldn't find a solution that generates ChangeLogs in the style we prefer, which is a variant of the GNU ChangeLog.

So I wrote a quick Python script to try and accomplish this task. It may not be the prettiest Python code as I have never written more than five or six lines of Python before. ChangeLogs always seemed to be the biggest source of merge conflicts whenever we would work in branches, or just all be working at the same time. This is why I think it is necessary to automatically generate something like this that can be generated with source tarballs.

I called it gitlog2changelog.py and it has all of the basics down already. It may not be the most general script but works pretty well for us. I need to add some extra parsing for file creation/deletion so that we can add the + or - in front of the file names. Is there a general need for this? Are there better scripts out there that I dd not spot?

2008-12-29  Tim Vandermeersch <email@protected>

  ∗ libavogadro/src/pluginmanager.cpp: replace getenv(...) with
  QProcess::systemEnvironment()

  ∗ libavogadro/src/elementtranslate.h: Replace "A_DECL_EXPORT extern ..." with
  "A_EXPORT extern ..."

  ∗ CMakeLists.txt: use /MD compiler flag for MSVC

2008-12-28  Marcus D. Hanwell <email@protected>

  ∗ libavogadro/src/molecule.cpp, libavogadro/src/molecule.h,
  libavogadro/src/python/molecule.cpp: Lots of documentation updates,
  reorganised the functions and grouped in Doxygen tags. Some minor changes
  too, more are needed for const correctness.

  ∗ testfiles/multicubes.cube.gz: Removed from our source as it is the same
  size as all the other files put together. May be we should provide a more
  extensive sample of files in a separate distribution.

  ∗ libavogadro/src/engines/bsdyengine.cpp: Ported to use the new bond position
  functions.

  ∗ libavogadro/src/bond.cpp, libavogadro/src/bond.h: Added functions to
  retrieve bond positions, still need to implement the mid-point function.

  ∗ libavogadro/src/bond.h: Documentation updates.

  ∗ libavogadro/src/python/bond.cpp: Added missing Atom include.

  ∗ libavogadro/src/atom.cpp, libavogadro/src/atom.h: Documentation updates,
  added member function groupings and a destructor.

  ∗ libavogadro/src/atom.cpp, libavogadro/src/bond.cpp, libavogadro/src/bond.h:
  Added some atom accessor functions to the Bond class. This should make using
  bonds easier. Fixed assignment order in Atom constructor.

Avogadro Has Moved to GitHub and Git

After some discussion on IRC the Avogadro Project has moved its version control over to GitHub. Our new repository can be found here. Most of us are old Subversion users, and a few of us started out with CVS. I think we are still getting our head around the workflow but feel it is worth the effort for all the advantages the move will bring.

There are some great visualisations from GitHub. I have always loved the speed of Git when compared to other version control I have used. It is also great for adding in bigger changes and not having to halt development in other areas for fear of merge issues. We shall see over the coming months how positive the move was, but I am confident it will be. I have been using Git locally through git svn for over a year now I think.

For those who might wonder, the conversion was not totally automatic. The branches and tags git-svn leaves you with are not Git branches and tags. It basically required me to manually create the branches and tags. So for our repository I ran the following,

mkdir avogadro-git
cd avogadro-git
git svn init https://avogadro.svn.sourceforge.net/svnroot/avogadro --stdlayout
git config svn.authorsfile ../avogadro/authors.txt
git svn fetch

At that point I went and grabbed a coffee, took care of the dog...

git remote add origin git@github.com:cryos/avogadro.git
git push origin master

This got us most of the way there but lacked all of our tags and branches. I found that none of the push options worked as the tags and branches needed to be made into full Git entities first.

git branch -a (show all the branches)
git branch 0.8 0.8
git branch 0.6 0.6
git branch primitive primitive
git tag -f 0.6.0 tags/0.6.0
git tag -f 0.6.1 tags/0.6.1
git push --all origin
git push --tags origin

After all that we have our tags as Git tags and our branches as Git branches. You can browse them and clone the repository. A few of us have been experimenting and everything looks good. Adding current developers as collaborators enables them to push directly to the repository. There are also some web interfaces that allow for pulling from forks.

So if all goes to plan now, there will be no more commits to our old Subversion repository. We have preserved all of our history and I made sure the author metadata was improved. Hopefully this will make our development process more streamlined. We appreciate any and all tips, this looks like a good guide to keeping a fork in sync, pushing and pulling where necessary.

Now back to coding - we want to get a new release out!



New Addition to the Family

On Monday we had a new addition to the family arrive - an Asus Eee PC 1000! So far I am pretty impressed with the hardware. The Linux installation was pretty disappointing but I never really intended to keep that anyway. I played around with it on Monday as I built a chroot for the new arrival (pictured below).

Asus Eee PC  1000

I went for the 10" model as I was worried about the size of the keyboard on the smaller ones. I also liked the sound of the SSD drive and it looked like a great little unit. I ended up building a custom stage 4 Gentoo tarball for it on my desktop and installing it here. I have it running the new KDE 4.1.2 ebuilds along with a few KDE 3 apps I can't do without.

All in all it seems to be working pretty well. I only got round to installing Gentoo on it yesterday. So far I have the webcam, wired and wireless networking working. I am using WICD to control networking. I would love to see a Qt4/KDE 4 frontend that integrates better but it is an awesome little app.

This is my first post on it, the screen isn't a bad size and the battery life seems to be good. I am on the road today and my wife acted as an unwilling hand model. I still haven't managed to get the asus_laptop or asus_acpi modules to load and so am missing all those devices. It claims no such device.

I will hopefully be able to post more at some point in the future. I certainly think this is great for being on the road and Skype is working with the webcam. I did use the 2.6.27 kernel whicih made things a lot easier I suspect. I might try building a vanilla kernel soon to see if that lets me insert the asus_laptop module successfully.

For now I have quite a few hours to kill in the BA lounge at JFK!

Stephen Fry and GNU's 25th Birthday

This is a little belated as the weekend was hectic but I want to wish GNU a happy 25th birthday too! Stephen Fry made a video to wish GNU a happy 25th birthday which I really enjoyed. I may be biased as an English man and a big fan...

Stephen Fry GNU 25th Birthday

I think he did a great job of describing open source in a very approachable way for those of us who are less geeky. You can also download a higher quality video. I miss QI, and thick-cut back bacon! Neither of which seem to be available over here. Enjoy the video and think of us English people living in a foreign land ;-)

ACS Avogadro Talk Slides and Poster

I kept meaning to put the slides to my Avogadro talk and the poster I presented at the recent ACS meeting in Philadelphia. Things have been really hectic these last few weeks but here they are. The talk was presented in the chemical eduction section, on Monday 18 August, "Avogadro: An integrated approach to teach computational chemistry modeling, simulation and visualization". The slides were made using LaTeX Beamer and the talk itself was focused on the use of Avogadro when teaching computational chemistry.

Avogadro poster presented at ACS meeting

I also presented a poster at Sci-Mix on Monday, 18 August, and at the main computational chemistry poster session on Tuesday, 19 August. You may have guessed already but I used LaTeX - this time the A0 poster package. The poster title was "Avogadro: A framework for quantum chemistry simulation and visualization". I really enjoyed the two poster sessions and met lots of interesting people during the sessions.

You can grab copies of the slides or poster by clicking on their titles. It was certainly a very interesting conference, although it was so big it was difficult to choose where to go and what to see at times. Especially as some of the hotels with talks I wanted to attend were thirty minutes apart on foot. It was a great opportunity to tell other scientists about the work we are doing as well as introducing some of the concepts of open source to the wide and varied list of attendees I had the pleasure of meeting.

Chemistry Visualisation and Tools Meeting

Last week I was privileged to be invited to speak at a meeting about molecular modelling with a focus on tools, GUIs and visualisation. The meeting was held at the Holiday Inn in Runcorn and the Daresbury Laboratory (England). I wasn't expecting to be back in England quite so soon, having only just returned to Pittsburgh at the end of January.

The meeting was a great opportunity to present some of the latest work I and others in the Avogadro and OpenBabel communities have been doing to create tools that enable the building of molecules and structures, as well as their visualisation. It was also a great chance to hear some very interesting talks by the developers of other building tools and some quantum codes. Donald and I were also invited to Daresbury Laboratory to work with some of the CCP1GUI developers.

I presented my talk on Avogadro on Wednesday morning and have made the slides available here. Donald gave an introduction to Avogadro, some of the history and the architecture before I gave my presentation. We finished by taking questions while I demonstrated the Avogadro application. I think it was extremely productive. We had many more conversations over dinner and drinks later as well as in a workshop setting on Thursday afternoon.

It was great to be able to put a face to a few of the names and discuss current issues more informally in the evening. The talks were all of a very high quality and from a varied list of speakers from other open source projects, some of the free quantum codes as well as commercial products. I have come away from the meeting with a much better appreciation of the needs in the community and I feel that Avogadro is in a great position to fill the apparent void.

I am glad that we were able to get surface and orbital support working in Avogadro before the meeting. Right now we only support Guassian cube files but the implementation is general enough that I will be able to add support for further formats. I really think that if we can get enough people collaborating on a common project everyone can get the tool they need to effectively do their research at a much lower investment than could be achieved by working on many separate projects.

I met Tristan Youngs, the developer of Aten, who had implemented some really nice features in his molecular builder that is much more focussed on molecular mechanics. It is well worth checking out. As is Zeobuilder which was developed by Toon Verstraelen. They both implement some great features and have strengths in different areas. Of course my dream is to integrate many of these features via Avogadro plugins and have one editor which is capable of being used in a diverse range of applications.

It was also great to speak to Mario Valle who is doing some very interesting work in the area of new visualisation methods and supports a large user base of computational chemistry users. There were of course so many other talks but you can look at the schedule yourself and I think the slides of all the talks should be available in the near future.

I feel sure that many good things will come out of this meeting and hope to be able to attend similar meetings in the future. I would like to thank Jens once again for hosting the meeting and taking care of everything. I hope to see some patches and/or commits from him in the near future ;-)

Avogadro 0.6.1 Released

I am pleased to announce that I tagged and released Avogadro 0.6.1 yesterday evening. This is a bug fix release which fixes one pretty large bug that slipped through - the OpenGL context was lost if switching between virtual desktops, multiple views etc rendering the OpenGL window useless unless the application was restarted. As such I would encourage anyone running Avogadro 0.6.0 to upgrade to this new version. It also features several smaller bug fixes and feature enhancements.

Avogadro 0.6.1 running in a KDE 4 session

The screen shot above shows Avogadro 0.6.1 running in a KDE 4 session. One of the small visual tweaks I made was to add a second light source to our default OpenGL scene which really helps to illuminate the other side of the scene. Thanks go out to Albert for his suggestion of adding another light source. Hopefully there are no really big bugs remaining but Avogadro is still in the beta stages of its development. It is rapidly approaching a stable release though and I am very happy with our progress so far.

We would love to hear what you think of Avogadro. I had one person question why we always have to use the latest and greatest version of OpenBabel and felt I should offer some explanation. Many of the features exposed in Avogadro use functions and structures in OpenBabel. I myself was quite heavily involved in improving OpenBabel's support for Gaussian cube files and the cube format so that we could load and display orbitals for example. As such we often add new features or fix bugs in OpenBabel trunk and so a new release of OpenBabel must be used in order for everything to work.

There are already ebuilds for this latest version in the Gentoo tree. Ubuntu/Debian builds are in the process of being built. We should hopefully have Mac and Windows binaries very soon too.

I am headed to a meeting in the UK where Donald and I will be talking with other scientists about visualisation in chemistry and related areas. We will of course be showing off Avogadro as well as talking with many other people working in this area. I am very much looking forward to it and hope that this will lead to further innovation in the Avogadro project as well as the open source chemistry movement in general. It will of course be great to have a full English breakfast and some real ale too!

Avogadro 0.6 Released

Earlier today we released Avogadro 0.6. This release is quite overdue and we had originally planned to make a release around the new year. This release has many, many new features that have been implemented since the last release.

Avogadro 0.6.0 displaying an orbital

I am especially proud of the new support for displaying surfaces. This initially led to the surface engine that displays a Van der Waals surface. Tim added the ability to map the electostatic surface potential onto that. I then began work on adding support for displaying orbitals. This led to me getting commit access to OpenBabel and making quite a few commits as I got Gaussian cube loading working. While I was there I couldn't resist improving the Grid classes (still a little more I would like to add in).

Another new feature I am really pleased with is the QGraphicsView based periodic table. I think it works very nicely and I am hoping to add this code to Kalzium. I think the Avogadro library is in great shape for me to begin porting Kalzium to use it. Tim and Geoff have been doing some amazing work in OpenBabel on improving the force fields used for geometry optimisations.

We have also been doing a lot of work to improve Avogadro's performance when rendering large systems. We have added quickRender functions and OpenGL display lists to improve interactivity as well as threading calculations where this made sense. We have a cool little colour widget Geoff coded too that allows colours to be displayed and picked easily, improved default layout and one of my personal favourites - persistent settings in most of Avogadro.

There are certainly some bugs remaining. I would like to get to the bottom of as many as I can and hope to make one or two bug fix releases in the 0.6 branch. We would love to get feedback from people. We have already made a source release and a Mac binary. I will be adding Gentoo ebuilds shortly and we will hopefully get a Windows binary out by early next week.

Hope you enjoy this release. I think we are getting close to a stable API that we can call 1.0 and have most of the core features I was hoping to get into Avogadro. Our framework is extremely modular and extensible and I hope that we will be able to build up a community around Avogadro. It was also great to be able to make this release on 29 February - we have so few of them ;-)

Avogadro: New Orbital Support and Gaussian Cube Format

So over the weekend I spent quite a lot of time hacking away at OpenBabel working on the Gaussian cube format support I needed to get working in order to be able to visualise electronic orbitals. The initial support was taken from Molekel but contained no error checking and it was not reading in the example cube file I had.

Thankfully a colleague pointed out a page with details on the Gaussian cube format and I used this as a basis to get it working in OpenBabel with better error checking and a more resilient tokenisation of the cube points. I made my first few commits to OpenBabel over the weekend and got at least simple Gaussian cube files loading that only contain one cube. More will follow I am sure.

Benzene HOMO orbitals visualised in Avogadro

After I got the file loading sorted a few more changes to Avogadro got me my first ever orbitals in Avogadro - the benzene HOMO! I believe the cube file came from the JMol test files. Geoff informed me that chemists for some reason see positive as blue and negative as red. That seemed very strange to me and I had initially put it the other way around. Growing up playing with electronics it seemed to me that positive should be red just as the wires in a circuit have a red positive... Other than that orbitals seemed to be working well and I was very pleased.

CH3Cl electrostatic potential visualised in Avogadro

Next I started to load up some other cube files I had been given as examples. I thought the above image of the electrostatic potential of CH3Cl looked very nice. When I showed Geoff he also liked it and we wondered if it had been visualised in this way before. I know normally the cube would be mapped onto the Van der Waals surface of a molecule.

Anyway I was pleased and also felt more productive as I now have my laptop back up and running and am developing on Gentoo again. It would be great to hear what other people think of this new support. I am already working on various improvements to the code and getting ready for another release of Avogadro!

Avogadro: Surface Support

I am pleased to announce that we now have working surface support in Avogadro. We originally began working on support for surfaces around November time when Geoff improved the support in OpenBabel for grids and added some initial code to the Avogadro repository. Quite quickly it became evident that this algorithm did not deal well with data sets containing discrete objects that you wanted to polygonise.

I began a search of the available algorithms and came across a very nice guide to the marching cube algorithm with example code. I had a brief look for a C++ implementation and didn't find anything initially, began implementing what was on his page and then came across Zhu3d which is a Qt 4 based program that actually uses an implementation of the algorithms described in the guide and references them. As it is GPL licenced code I imported the relevant class into our repository and began the task of adapting it to fit into our framework.

Avogadro surface pointsAvogadro surface lines

With some code from Geoff, more pointers from Geoff, some reading and quite a bit of help from Tim (not sure if he has a web page/blog) we got it working. Since then Tim has actually fixed a big bug in OpenBabel that was causing crashes and done more work on the IsoGen class. The screenshots above show the results of our early work where initially we got points and then lines working. I was very pleased at this stage as it adds a feature that had been missing for quite some time to the Avogadro framework.

Avogadro surface with filled trianglesAvogadro surface with filled triangles coloured by electrostatic charge

I then got filled triangles added with transparency support, allowing us to visualise the underlying structure of the molecule and map other parameters onto the surface. Tim then added electrostatic charge mapping to the colour of the surface which I hope you agree is already looking very good.

There is still quite a bit left to do. I need to move the class into libavogadro and out of the engines, integrate it into our Painter API, implement caching and am thinking of using the Qt Concurrent framework to do intelligent multithreading once Qt 4.4 is released as surface generation is quite slow for big molecules. I also need to link the mesh size to the global quality level and see what other optimisations might be possible. Another big one is adding support for visualising molecular orbitals. Geoff has already done a lot of work on the back end in OpenBabel for this and so hopefully it will not take me long to get it added in.

Lots to do but some great progress already. I would love to know what you think. Once we have been able to polish this new feature a little I hope we can get a release out of the door so that more people can test out these new features and let us know what they think, point out bugs and shower us with compliments ;-) Until then I hope you enjoy the screenshots!

Note: For some reason the exported graphics shown in this post were not antialiased. They are on screen and I need to look into why they are not when I export graphics in this way.

Avogadro: Just Hit Commit 1000!

I just made a few commits using my trusty git svn dcommit (I am still really loving git and it looks like the bug I reported may be fixed in it now too). Then I saw the commit numbers - we just hit commit 1000. Development has really been accelerating recently and I haven't had time to write about as much as I wish I could.

Hopefully I will get a chance to take some screenshots and show off some of the latest stuff. I have coded a QGraphicsView based periodic table I am pretty happy with. It is compact, allows elements to be chosen, shows our colour scheme and even displays a little extra information on the selected element. Then there is the ribbon engine which is coming along but needs some loving attention from some bio people.

I am very pleased with the new quick rendering stuff we have added. It still has its issues. I had fixed some but some of Benoit's recent commits seem to have reintroduced the cache problem upon engine changes. Tim has added a new hydrogen bond engine which looks great thanks to some stipple line stuff from Geoff. There is some great stuff in the properties dialogs too along with lots of improvements to our force fields.

There is certainly lots more for us to do. The biggest thing I still haven't gotten in yet is surface support! I really want to get that sorted as I think it will be both useful and should look great. Along with some extra dialogs for graphics export, POV-Ray rendering etc.

Avogadro: New Ring & Polygon Engines

I recently added a couple of new engines to Avogadro and the screen shot below shows them both. The ring engine finds all the rings of the molecule and draws a transparent plane through the ring. The polygon engine finds atomic centres with three or more atoms bonded and draws a polygon around that atom. This is only done for atoms that are not the common organic types.

Avogadro using the ring and polygon engines

I think these are useful engines that have been prompted by user requests. May be not as exciting as the ribbon engine or the surface support we are working on but useful to display certain structures. The ring engine has not been without its problems though as you can probably spot in the image below showing the ring engine rendering a carbon nanotube.

Avogadro using the ring engine to render a nanotube

The lighting just flips at certain points - the same happens as you rotate molecules that are using the ring or polygon engine. I guess the lighting is flicking on at certain angles. I would be interested if anyone with more OpenGL knowledge than I might know how I can improve the rendering. Some rings are near white and some of the back rings don't seem to be drawn - that could actually be drawing order though which is always tough to get right.

Comments and tips are always welcome. The big challenge right now is getting surface support added in. This is something I think we really need and I would use in my daily work as I am sure many others would. I have been reading up on marching cubes and stuff but would welcome tips in that area too!