# dyntri-rs
Dynamical Triangulations in Rust

[![Crates.io Version](https://img.shields.io/crates/v/dyntri-core)](https://crates.io/crates/dyntri-core)
[![docs.rs](https://img.shields.io/docsrs/dyntri-core)](https://docs.rs/dyntri-core)
[![GitLab License](https://img.shields.io/gitlab/license/dynamical-triangulation%2Fdyntri-rs?color=cornflowerblue)](https://gitlab.com/dynamical-triangulation/dyntri-rs/-/blob/main/LICENSE)

The [`dyntri-core`](https://crates.io/crates/dyntri-core) crate aims to form a base and provide standard triangulation and graph structures,
which DT generators can use to provide interoperability and make use of the provided observables.
The [`dyntri-edt2d`](https://crates.io/crates/dyntri-edt2d) and [`dyntri-cdt2d`](https://crates.io/crates/dyntri-cdt2d) crates provide implementations of 2D Euclidean and Causal Dynamical Triangulation generators respectively.

This repository is a major refactor of the old [`dyntri`](https://gitlab.com/dynamical-triangulation/dyntri) crate, with a focus on interoperability and simplicity.

## Using the library
Add the following dependencies via [crates.io](https://crates.io) for the latest release versions.
Alternatively, if you would like the latest development version you can use `cargo`'s 
[feature](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-git-repositories) to add dependencies directly from a git repository.
Create a Rust project and to `Cargo.toml` add:
```toml
[dependencies]
dyntri-core = { git = "https://gitlab.com/dynamical-triangulation/dyntri-rust.git" }
# Add desired triangulation generators
dyntri-cdt2d = { git = "https://gitlab.com/dynamical-triangulation/dyntri-rust.git" }
dyntri-edt2d = { git = "https://gitlab.com/dynamical-triangulation/dyntri-rust.git" }
```
This will use the most recent commit of the `main` branch.
It is also possible to use other versions of the library, for options see the [Cargo docs](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-git-repositories)

### Documentation
[![https://docs.rs/dyntri-core](https://img.shields.io/badge/docs-dyntri--core-blue)](https://docs.rs/dyntri-core)
[![https://docs.rs/dyntri-edt2d](https://img.shields.io/badge/docs-dyntri--edt2d-blue)](https://docs.rs/dyntri-edt2d)
[![https://docs.rs/dyntri-cdt2d](https://img.shields.io/badge/docs-dyntri--cdt2d-blue)](https://docs.rs/dyntri-cdt2d)


### Example of use
Check out the `/examples` directories of the different crates to see examples of use.

## Creating visualizations
To make visualizations of the triangulations look at the [`dyntri-visualization`](https://gitlab.com/dynamical-triangulation/dyntri-visualization)
crate.