Cube (.cub, .cube)
Background & Context
-
- MIME type: chemical/x-cubeGaussian cube file.
- Used by electronic structure programs to store orbital or density values on a three-dimensional grid.
- Plain-text format.
- Can contain volumetric data for an arbitrary number of orbitals.
- Maintained by Gaussian, Inc.
Import & Export
- Import["file.cub"] imports a list of molecules from a Cube file.
- Export["file.cub",expr] exports a molecule or list of molecules to a Cube file.
- Import["file.cub",elem] imports the specified element from a Cube file.
- Import["file.cub",{{elem1,elem2,…}}] imports multiple elements.
- The import format can be specified with Import["file","Cube"] or Import["file",{"Cube",elem,…}].
- Export["file.cub",mol] creates a Cube file from a molecule containing a "VolumetricData" key in its MetaInformation.
- Export["file.cub",{expr1,expr2,…},{{elem1,elem2,…}}] treats each expri as specifying the corresponding elemi.
- Export["file.cub",expr,opt1->val1,…] exports expr with the specified option elements taken to have the specified values.
- Export["file.cub",{elem1->expr1,elem2->expr2,…},"Rules"] uses rules to specify the elements to be exported.
- When creating a Cube file, volumetric data can be either in the molecule expression as MetaInformation or given to Export as a separate element.
- See the following reference pages for full general information:
-
Import, Export import from or export to a file CloudImport, CloudExport import from or export to a cloud object ImportString, ExportString import from or export to a string ImportByteArray, ExportByteArray import from or export to a byte array
Import Elements
- General Import elements:
-
"Elements" list of elements and options available in this file "Summary" summary of the file "Rules" list of rules for all available elements - Data elements:
-
"Molecule" a symbolic representation of the molecule model "VolumetricData" an Association containing the electronic orbital information "Graphics3D" a 3D graphic containing a model of the molecule along with contours representing electronic isosurfaces - The "VolumetricData" element contains the following keys:
-
"DataRange" a list of bounding box coordinates {{xmin,xmax},{ymin,ymax},{zmin,zmax}} "Data" a list of three-dimensional arrays specifying the value of the orbital wavefunction or density on a grid "OrbitalNumber" an optional list specifying numerical values for the orbitals
Options
- General Import options:
-
IncludeMetaInformation True whether to include the volumetric data in the molecule's MetaInformation - For the "Graphics3D" element, Import has the same options as ContourPlot3D, with the following changes:
-
Contours {-.03,.03} specifies the values for the drawn isosurfaces ContourStyle Opacity[0.8] specifies the style for the isosurfaces - Export options:
-
"Header" Automatic header information from the file "Comment" None comment to write on the second line
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Import and plot the electronic density from a Cube file:
Copy to clipboard.
In[1]:=1
✖
https://wolfram.com/xid/0spytr56-k2513h
Direct link to example
Out[1]=1
Import and plot a Cube file containing two orbitals:
Copy to clipboard.
In[1]:=1
✖
https://wolfram.com/xid/0spytr56-l1qvfo
Direct link to example
Out[1]=1
Import a molecule from a Cube file:
Copy to clipboard.
In[1]:=1
✖
https://wolfram.com/xid/0spytr56-vga
Direct link to example
Out[1]=1
Find a matching Entity for the molecule:
Copy to clipboard.
In[2]:=2
✖
https://wolfram.com/xid/0spytr56-1n1w74
Direct link to example
Out[2]=2
Find the volumetric data in the molecule's MetaInformation:
Copy to clipboard.
In[3]:=3
✖
https://wolfram.com/xid/0spytr56-09ggx0
Direct link to example
Out[3]=3
Export the molecule to a Cube file:
Copy to clipboard.
In[4]:=4
✖
https://wolfram.com/xid/0spytr56-dd353w
Direct link to example
Out[4]=4