2

I'm looking for free (as in freedom) software for Linux that allows me to visualize simple crystal lattices and produce images such as this:

NaCl structure

Good features would be the ability to easily choose colors, add labels, select how many unit cells to show and add custom geometry like in the picture (faces). I should be able to create the structure from scratch in the software or using a well-documented non-proprietary file format. It shouldn't be too tied down to actual chemistry: I should be able to create "quasi-atoms", e.g. as stand-ins for molecules or whole classes of atoms.

3 Answers 3

3

I would suggest taking a look at the IVisual kernel for Jupyter - it is an port of the Visual Python library to Jupyter - as such it lets you model 3D structures very flexibly from within your browser - there is even an animated structure very similar to what you are looking for implemented in less than 100 lines including the animation.

  • Free, Gratis & Open Source
  • Cross Platform
  • Flexible any 3D modelling not just crystals
  • Non-propitiatory language
  • Easily add labels, change colours, etc.
  • Jupyter Notepads are stored in a plain text format and able to be exported to a number of other formats.
  • JupyterHub would allow live models on a server.

The AtomicSolid Example

enter image description here

Update 2022

Things have moved on a long way in the 6 years since I wrote the above answer and looking into it again in response to a question from @Casimir below I found that the landscape has changed.

The IVisual mentioned above has been incorporated into VPython-Jupyter which means that it can be installed with pip install vpython

There is also the Python Materials Genomics (pymatgen) package (written in python) and the Crystal Toolkit which is written in Python on top of the Dash framework from Plotly. These can be seen and used in an online instance available free (this will run your calculations on a supercomputing cluster such as NERSC, OLCF, ALCF or SDSC so will likely be much faster than running on your own machine).

Crystal Toolkit can be locally run from within a Docker instance needs a free Materials Project API key or pymatgen & crystal toolkit can be pip installed and used within Jupyter Lab by following the instructions here.

Citations

Materials Project

A. Jain*, S.P. Ong*, G. Hautier, W. Chen, W.D. Richards, S. Dacek, S. Cholia, D. Gunter, D. Skinner, G. Ceder, K.A. Persson (*=equal contributions) The Materials Project: A materials genome approach to accelerating materials innovation APL Materials, 2013, 1(1), 011002. doi:10.1063/1.4812323 bibtex

Pymatgen open-source library

S. P. Ong, W. D. Richards, A. Jain, G. Hautier, M. Kocher, S. Cholia, D. Gunter, V. L. Chevrier, K. Persson, G. Ceder Python Materials Genomics (pymatgen) : A Robust, Open-Source Python Library for Materials Analysis. Computational Materials Science, 2013, 68, 314–319. doi:10.1016/j.commatsci.2012.10.028 bibtex

Crystal Toolkit

S. P. Ong, W. D. Richards, A. Jain, G. Hautier, M. Kocher, S. Cholia, D. Gunter, V. L. Chevrier, K. Persson, G. Ceder Python Materials Genomics (pymatgen) : A Robust, Open-Source Python Library for Materials Analysis. Computational Materials Science, 2013, 68, 314–319. doi:10.1016/j.commatsci.2012.10.028 bibtex Online Crystal Toolkit

3
  • 1
    Looks like development on IVisual stopped in 2016. Is the source code/docs still available somewhere? Couldn't find it on GitHub.
    – Janosh
    Commented Jun 18, 2022 at 12:37
  • 1
    @Casimir - it looks like John has integrated his code into VPython-Jupyter github.com/vpython/vpython-jupyter - the original source code is available on pypi on the page linked above. Commented Jun 19, 2022 at 4:49
  • @Casimir - Thank-you for the query - this led me to take a look at how things have moved on in the last few years and the answer was enormously. I have updated my answer to include the information that I found. Commented Jun 19, 2022 at 8:10
1

To me it seems like a lot of people are trying to write software for this, but none of it is user-friendly or polished. In particular, documentation is usually very bad. Here is some of the software I have tried so far:

  • Jmol has a Crystal community apparently, but there isn't any documentation on how to actually create and display crystals with it
  • Gcrystal "is now part of the Gnome Chemistry Utils" but doesn't show up on their website (although they do have an entry for it on their manuals page). I installed it from my distribution's repository (where it was still available as a standalone package under its own name) and tried it, but all I got was a blank screen even after adding atoms. It also had a tendency to segfault.
  • Avogadro at least has basic tutorials on its website, but the one on crystals is yet to be written. Nobody can write it, however, because the edit link takes you to a CloudFlare 404 page with no editing capabilities. I tried using it but the atoms kept randomly disappearing (all of them at once) so I didn't get far before becoming annoyed with it.

With the exception of Jmol, I only found the software through my distribution's package manager. None of the other applications show up in a Google search for "crystal visualization".

1

There are to more free options (free more like a beer though):

They both go beyond just visualization and offer crystal structure analysis. Olex2 also is often being used for complete crystal structure refinement.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.