inquanto-nglview

InQuanto NGLView extension.

class VisualizerNGL(geometry, background_color='#FFFFFF')

NGLView visualizer for inquanto.

Parameters:
  • geometry (Union[List[Tuple[str, Tuple[float, ...]]], GeometryPeriodic, GeometryMolecular]) – Molecular or unit cell geometry.

  • background_color (str, default: "#FFFFFF") – Background color of NGLView stage. Used as the backgroundColor NGL stage parameter, so may be a preset color name i.e. “red”, “white” etc. or sRGB code.

visualize_fragmentation(source, atom_labels=None, fragment_colors=None, fragment_color_seed=6)

Visualize a DMET fragmentation scheme of the molecule.

Fragmentation groups should be defined in the molecular geometry with the Geometry.set_groups() method.

Note

Not compatible with periodic geometries.

Parameters:
  • source (str) – The heading of the column defining the fragmentation in the geometry dataframe, Geometry.df().

  • atom_labels (str, default: None) – Label type for atoms, can be “index”, “symbol” or None.

  • fragment_colors (Optional[List[str]], default: None) – Color of each fragment. Formatted for the NGL add_ball_and_stick() method, so may be preset color names i.e. ["red", "blue"...] or sRGB code. Order corresponds to ordering of fragments in geometry dataframe geometry.df[source].

  • fragment_color_seed (Optional[int], default: 6) – RNG seed for generating fragment colors. Used only if fragment_colors is None.

Returns:

NGLWidget – An ngl widget showing the molecule with fragments highlighted.

visualize_molecule(atom_labels=None)

Generate a ball-and-stick visualization of the molecule.

Parameters:

atom_labels (str, default: None) – Label type for atoms, can be “index”, “symbol” or None.

Returns:

NGLWidget – An ngl widget showing the molecule.

visualize_orbitals(cube_orbitals, atom_labels=None, red_isolevel=-0.55, blue_isolevel=0.55)

Visualize the input orbital atop the molecular or periodic structure.

Parameters:
  • cube_orbitals (str) – A string containing the contents of a .cube file, which details the shape of an orbital.

  • atom_labels (str, default: None) – Label type for atoms, can be “index”, “symbol” or None.

  • red_isolevel (float, default: -0.55) – The isolevel at which to color the orbital isosurface red.

  • blue_isolevel (float, default: 0.55) – The isolevel at which to color the orbital isosurface blue.

Returns:

NGLWidget – An ngl widget showing the visualized orbital, and the molecular or unit cell structure.

visualize_unit_cell(atom_labels=None)

Generate a ball-and-stick visualisation of the unit cell.

Draws the cell edges, and atoms inside.

Parameters:

atom_labels (default: None) – Label type for atoms, can be “index”, “symbol” or None.

Returns:

NGLWidget – An ngl widget showing the unit cell.