cymetric is a Python package for learning of moduli-dependent Calabi-Yau metrics using neural networks implemented in TensorFlow.
The current version is an alpha-release so not all features mentioned below are on the main branch yet. Features with an (*) will be released soonish.
This guide assumes that you have a working Python 3 (preferably python 3.7 or above) installation (and Sage and Mathematica, if you want to use these features as well). So running python3
should work on your system. Moreover, it assumes that you have installed git. Note that both are standard on Mac and most Linux distributions. For Windows, you will typically have to install them and make sure that for example Python works correctly with Mathematica if you are planing on using the Mathematica interface.
If you want to use any existing python installation (note that we recommend using a virtual environment, see below), just run in a terminal
pip install git+https://github.com/pythoncymetric/cymetric.git
To run the example notebooks, you need jupyter. You can install it with
pip install jupyter notebook
Create a new virtual environment in a terminal with
python3 -m venv ~/cymetric
Then install with pip directly from github
source ~/cymetric/bin/activate
pip install --upgrade pip
pip install git+https://github.com/pythoncymetric/cymetric.git
pip install jupyter notebook
python -m ipykernel install --user --name=cymetric
Create a new environment with
conda create -n cymetric python=3.9
Then install with pip directly from github
conda activate cymetric
pip install git+https://github.com/pythoncymetric/cymetric.git
Since sage comes with python, all you need to do is run
pip install git+https://github.com/pythoncymetric/cymetric.git
from within a sage notebook. If you'd rather keep ML and sage separate, you can just install the package (without tensorflow etc.) using
pip install --no-dependencies git+https://github.com/pythoncymetric/cymetric.git
Then you can use the function prepare_toric_cy_data(tv, "toric_data.pickle"))
to create and store all the toric data needed, and then run the ML algorithms with this data file from a separate package installation (with tensorflow).
The whole installation process is fully automatic in the Mathematica notebook. Just download it and follow the instructions in the notebook. In a nutshell, you run
Get["https://raw.githubusercontent.com/pythoncymetric/cymetric/main/cymetric/wolfram/cymetric.m"];
PathToVenv = FileNameJoin[{$HomeDirectory, "cymetric"}];
python = Setup[PathToVenv];
You can also use an already existing installation. To do so, you run
Get["https://raw.githubusercontent.com/pythoncymetric/cymetric/main/cymetric/wolfram/cymetric.m"];
PathToVenv = FileNameJoin[{$HomeDirectory, "cymetric"}];
ChangeSetting["Python", PathToVenv]
python = Setup[PathToVenv];
Note that this will create a .m file (in the same folder and with the same name as the mathematica notebook) which stores the location of the virtual environment. If you delete this file, mathematica will install a new virtual environment the next time you call Setup[PathToVenv]
.
Once you have installed the package (either in python, or in sage, or in Mathematica), you are probably looking for some examples on how to use it. We provide some tutorials/examples for each case. Just download the example file somewhere on your computer and open it in jupyter. If you created a virtual environment as explained above, you can simply open a terminal and type
jupyter notebook
This will open jupyter in your web browser. Navigate to the folder where you downloaded the files and click on them to open.
We summarize the mathematical conventions we use in this .pdf file.
We welcome contributions to the project. Those can be bug reports or new features, that you have or want to be implemented. Please read more here.
You can find our paper on the arXiv. It will be presented at the ML4PS workshop of NeurIPS 2021. If you find this package useful in your work, cite the following bib entry:
@article{Larfors:2021pbb,
author = "Larfors, Magdalena and Lukas, Andre and Ruehle, Fabian and Schneider, Robin",
title = "{Learning Size and Shape of Calabi-Yau Spaces}",
eprint = "2111.01436",
archivePrefix = "arXiv",
primaryClass = "hep-th",
reportNumber = "UUITP-53/21",
year = "2021",
journal = "Machine Learning and the Physical Sciences, Workshop at 35th NeurIPS",
}