pip install -U .
or should you want to edit the source:
pip install --no-deps -U -e .
To install it directly from github (e.g. in a colab notebook):
pip install -U git+https://github.com/jcmgray/cotengra.git
Other than that, the optional dependencies are detailed below.
The recommended selection of optional dependencies from below covering most use-cases is:
kahypar tqdm optuna loky networkx autoray
To perform the hyper-optimization (and not just randomly sample) one of the following libraries is needed:
optuna- Tree of Parzen Estimators used by default
baytune- Bayesian Tuning and Bandits - Gaussian Processes used by default
chocolate- the CMAES optimization algorithm is used by default (
skopt- random forest as well as Gaussian process regressors (high quality but slow)
nevergrad- various population and evolutionary algorithms (v fast & suitable for highly parallel path findings)
If you want to experiment with other algorithms then the following can be used:
python-igraph- various other community detection algorithms (though no hyperedge support and usually worse performance than
The latter two are both accessed simply using their command line interface and so the following executables should be placed on the path somewhere:
The parallel functionality can requires any of the following:
The following packages enable visualization:
If you want to perform the contractions using
cotengra itself you’ll need:
which supports at least
autograd among others.