Support/Jupyter

From Jmol
Revision as of 17:16, 11 September 2021 by Perrim (talk | contribs)
Jump to navigation Jump to search

Running JSmol in Jupyter notebooks

The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text.

JSmol may be implemented in a Jupyter Notebook through Jupyter Notebook Extensions, which blend javascript with the notebook environment. One extension is jupyter-jsmol by Adam Fekete. Jupyter-jsmol provides a python wrapper to the JSmol widget.

Installation

Jupyter-jsmol can be installed with pip in your notebook virtual environment. (Note the use of the underscore in the pip package)

pip install jupyter_jsmol

Old versions of Jupyter Notebooks require you to enable the extension:

jupyter nbextension enable --py [--sys-prefix|--user|--system] jupyter_jsmol

If you use JupyterLab you'll have to install the extension:

jupyter labextension install @jupyter-widgets/jupyterlab-manager

Examples

There are several examples on the jupyter-jsmol github

Wayne Decatur has setup a Binder container to demonstrate usage

ChemCompute has jupyter-jsmol preinstalled in its Jupyter notebooks. ChemCompute is a free website for students to run Computational Chemistry jobs. Through ChemCompute's Jupyter Notebook you can run a calculation with Psi4 and view the output in JSmol.

  1. Go to ChemCompute and login or register at the top right. You can likely login with your institutional login.
  2. Access an example Jupyter Notebook

Contributors

Perrim, AngelHerraez