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?

asked in General questions by (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

https://www.github.com/kpeeters/cadabra_jupyter_examples

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.

answered by (61.8k 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:

https://rjai.me/posts/google-colab-conda/

https://stackoverflow.com/questions/54015543/swift-kernel-in-google-colaboratory

https://medium.com/@erdemalpkaya/run-kaggle-kernel-on-google-colab-1a71803460a9

https://www.roelpeters.be/running-an-r-kernel-in-google-colab/

https://gist.github.com/tueda/a200b3f747d0fc864be8b4dd09be5a1e

+1 vote

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

!pip install -q condacolab
import condacolab
condacolab.install()
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.

answered by (61.8k points)

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

...