Author Topic: Cube file export: erroneous shift?  (Read 2700 times)


  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Cube file export: erroneous shift?
« on: May 21, 2019, 11:28:37 am »

I've been trying to export Cube files using Turbomole's proper program, but it seems that the exported volumetric data is always spatially shifted for some reason.

Minimal reproducible example:

For a simple H2 molecule with the symmetry axis along z (cf. .xyz file at the bottom), this picture shows what the total density exported by Turbomole 7.3.1 as a Cube file looks like (visualized using VMD, but I've tried VESTA as well with similar results):

Clearly, there is some shift of the density that shouldn't be there. Note that this uses the atom positions contained in the Cube file itself; using those from the original .xyz file is even worse:

All of this works perfectly fine with .plt files, however, as shown here:

Unfortunately, I have to use Cube files, because some tools that I want to use only work with those, and I haven't found any utility that can convert .plt to .cub.

Am I doing anything wrong or is this just broken?

Thank you very much in advance for any suggestions!

Kind regards

.xyz file:

Code: [Select]
h 0.0 0.0 -0.37
h 0.0 0.0 0.37

UPDATE: For the time being, I figured out a workaround: Export as .plt, convert this to .dx using, then convert this to .cub using babel. This seems to produce correct Cube files. But it would still be nice if this could work correctly out-of-the-box in Turbomole.
« Last Edit: May 21, 2019, 01:02:15 pm by sheidrich »


  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 470
  • Karma: +0/-0
Re: Cube file export: erroneous shift?
« Reply #1 on: May 22, 2019, 04:18:13 pm »

cub files can be defined in different ways, especially the order of the data can vary. Usually tools like VMD check and use the options, but this does not seem to be always the case.

Turbomole cub files contain the line:


if this is ignored by the program you use, you will get wrong pictures.

Writing a plt -> cub converter is not a big issue, I will try to provide one here:

as soon as possible.

Changing the defaults is a bit dangerous as there are others who use Turbomole cub files in the way they are defined now. Perhaps introducing a 2nd cub file format might be a reasonable addition...



  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Cube file export: erroneous shift?
« Reply #2 on: May 23, 2019, 05:21:46 pm »
Thank you very, very much for going to the trouble of writing a converter just for this issue! The Cube files it produces are displayed correctly in both VMD and VESTA, so I'll use this from now on.

Kind regards & thank you once again