pyxtal.viz module

This module handles visualization. Mostly powered by py3Dmol

pyxtal.viz.addBox(view, vecs, viewer=None)[source]
pyxtal.viz.addlines(view, orig, axes, viewer=None)[source]
pyxtal.viz.display_atomic(struc, size=(600, 300), scale=0.25, radius=0.1, supercell=(1, 1, 1), show_wp=False)[source]

display the molecular crystals generated from pyxtal. If the animation is False, only dump the structure to cif and let py3Dmol display it. If animation is on, show the generation of molecules in the crystal as an animation.

Parameters:
  • size – (width, height) in tuple

  • scale – the size of sphere

  • radius – the size of stick

  • supercell – replicate the crystal (valid only when animation is False)

  • show_wp – whether or not highlight the unique wyckoff site

Returns:

py3Dmol object

pyxtal.viz.display_cluster(molecules, cell, Ps, cmap='YlGn', s_opacity=0.5, size=(400, 300), style='sphere')[source]
pyxtal.viz.display_crystals(strucs, size=(600, 300), supercell=(1, 1, 1), labels=None)[source]

display the molecular crystals generated from pyxtal. two modes of animations are supported: slider or movie

Parameters:
  • size – (width, height) in tuple

  • supercell – replicate the crystal (valid only when animation is False)

  • labels – labels for each structures

Returns:

py3Dmol object

pyxtal.viz.display_mol_crystals(strucs, size=(600, 300), supercell=(1, 1, 1), axis=None, animation='slider', interval=2000)[source]

display the molecular crystals generated from pyxtal. two modes of animations are supported: slider or movie

Parameters:
  • size – (width, height) in tuple

  • supercell – replicate the crystal (valid only when animation is False)

  • animation – slider or movie

Returns:

py3Dmol object

pyxtal.viz.display_molecular(struc, size=(600, 300), supercell=(1, 1, 1), axis=None, animation=False, interval=2000)[source]

display the molecular crystals generated from pyxtal. If the animation is False, only dump the structure to cif and let py3Dmol display it. If animation is on, show the generation of molecules in the crystal as an animation.

Parameters:
  • size – (width, height) in tuple

  • supercell – replicate the crystal (valid only when animation is False)

  • axis – 3-vector to reprent the rotational axis

  • animation – whether or not display the animation

Returns:

py3Dmol object

pyxtal.viz.display_molecular_site(site, id=None, size=(400, 300), axis=True, ax_id=range(0, 3), box=False)[source]

display the Wyckoff site in the molecular crystals generated from pyxtal.

Parameters:
  • site – pyxtal.wyckoff_site.mol_site object

  • id – list of molecules to display. If None, display all molecules in this site

  • size – (width, height) in tuple

  • axis – boolean, whether or not display the rotational axis

  • axis_label – whether or not display the unitcell axis labels

Returns:

py3Dmol object

pyxtal.viz.display_molecule(molecule, center, cell, size=(400, 300))[source]

display the molecules in Pymatgen object.

Parameters:
  • mol – pymatgen molecule

  • center – molecular

  • size – (width, height) in tuple

Returns:

py3Dmol object

pyxtal.viz.display_molecules(molecules, size=(400, 300), animation=False, center=False)[source]

display the molecules in Pymatgen object.

Parameters:
  • molecules – a list of pymatgen molecules

  • size – (width, height) in tuple

  • animation – whether or not display animation

  • center – highlight center or not

Returns:

py3Dmol object