Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+1 vote

Google Colaboratory provides Computational power to improve work efficiency. Is it possible to run Cadabra kernel in Google Colaboratory?

in General questions by (2.1k points)

2 Answers

+1 vote

Colab does not make this easy. In principle all ingredients are there, since you can install Conda and then use the cadabra2-jupyter-kernel package to install the Cadabra kernel. What's lacking is a simple way to switch the kernel of that running notebook; I haven't found anything so far.

An alternative is to use Binder https://mybinder.org/ , which allows you to setup an environment in a github repository and then start a notebook from that same repository. See


for an example of how to do this. The environment.yml file in that repo specifies that we want to install the cadabra2-jupyter-kernel conda package. If you go to the binder site and tell it to open a notebook from this repo, it will build a Docker image with this kernel installed, and allow you to open the schwarzschild.ipynb notebook, asking you to specify which kernel you want to use.

Please let me know if you encounter problems with this, or if you figure out how to run the Cadabra kernel on Colab.

by (82.0k points)

binder works, but its computational performance is not better than colab. If one uploads a previously saved notebook into colab, she will get the option to change the kernel, but I don't know why it doesn't work when I have installed cadabra-kernel and changed the kernel to cadabra. As far as I know, colab supports java, r, swift, kaggle, etc. These links may be helpful:






+1 vote

To add to my earlier answer: you can install Conda and then the Cadabra kernel with

!pip install -q condacolab
import condacolab
conda install cadabra2-jupyter-kernel

In principle it should then be possible to use that kernel from another notebook, as all your notebooks should be running inside the same VM. It didn't work for me, but maybe you have more luck.

by (82.0k points)

Oh, I know this. But I'm not luckier than you.