{% extends "layout.html" %}

{% block title %}Cadabra: use with Jupyter{% endblock %}

{% block head %}{%- endblock %}

{% block main %}
<h1>Cadabra in Jupyter</h1>

<h2>General</h2>
<p class="hyphenate">
  By virtue of the Cadabra kernel for Jupyter, it is possible to use
  Cadabra from a Jupyter notebook. This allows you to use Cadabra
  notation in a familiar environment, and make use of
  e.g.&nbsp;Jupyter widgets for visualisation, or other things which
  are currently not possible in the Cadabra notebook interface.
</p>
  <div class="splash_image">
	 <img src="/static/images/ss_jupyter.png" alt="[screenshot]"/>
  </div>
<p class="hyphenate">
  The Cadabra Cloud service makes use of Jupyter to provide you with
  an on-line service to run Cadabra; send an email
  to <a href="mailto:cloud@cadabra.science?Subject=Cadabra%20Cloud%20access&Body=I%20would%20like%20to%20register%20for%20beta%20access%20to%20Cadabra%20Cloud.">cloud@cadabra.science</a>
  if you want to get access.
</p>
<br/>

<h2>Installation</h2>
<p class="hyphenate">
  If you do a standard build from source, or if you obtained Cadabra
  from a binary package (at least version 2.3.1.15), you will get the
  Cadabra Jupyter kernel automatically. You should be able to start
  the Jupyter notebook as usual with
</p>
<div class="output">  jupyter notebook</div>
<p class="hyphenate">
  The 'New' button in the top-right of the screen should then give you
  the option of creating a new notebook with a 'Cadabra2' kernel. If
  that fails, and the error messages produced by Jupyter indicate that
  it cannot find the Cadabra kernel, you may need
  to <a href="faq.html#q_01_01">adjust your <tt>PYTHONPATH</tt></a>.
</p>

<!--<h2>Old Xeus-based kernel</h2>
<p>
  To obtain the Cadabra kernel for Jupyter, you need to either install
  it from Anaconda,
  or <a href="https://github.com/kpeeters/cadabra2/JUPYTER.rst">build
  it yourself</a>. To install, ensure that the required channel is
  active, and update/install:
</p>
<div class="output">  conda config --add channels conda-forge
  conda update --all
  conda install cadabra2-jupyter-kernel</div>
<p>
  If the above went well, you should now be able to start the Jupyter
  notebook as usual with
</p>
<div class="output">  jupyter notebook</div>
<p>
  The 'New' button in the top-right of the screen should then give you
  the option of creating a new notebook with a Cadabra kernel.
</p>-->

<h2>Differences with Cadabra's own notebook</h2>
<p class="hyphenate">
  When you use Cadabra within Jupyter, most things will work as in
  Cadabra's own notebook interface. The main thing to keep in mind is
  that Jupyter notebooks (with extension <tt>.ipynb</tt>) and Cadabra
  notebooks (with extension <tt>.cnb</tt>) are not the same file
  format. You can read notebooks created in Jupyter into the Cadabra
  <tt>cadabra2-gtk</tt> client, and you can (as of version 2.3.3)
  export Cadabra notebooks as Jupyter notebooks (or convert them using
  the <tt>cadabra2ipynb</tt> command-line utility), but it is good to
  keep this in mind.
</p>
<p class="hyphenate">
  You <em>can</em>, however, make use of Cadabra packages inside the
  Jupyter notebook, so you can still do <tt>import something</tt>
  where <tt>something.cnb</tt> is a Cadabra notebook.
</p>

{%- endblock %}

