Skip to main content

Crate dyntri_core

Crate dyntri_core 

Source
Expand description

§Dynamical Triangulation

Dynamical Triangulation (DT) in Rust.

The 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. This crate provides triangulation functionality for arbirary dimensions using Rust const generics.

§Triangulation Generators

Currently, there are two companion crates dyntri-edt2d and dyntri-cdt2d that provide implementations of 2D Euclidean and Causal Dynamical Triangulation (EDT/CDT) generators respectively.

§Using the crate

The central structures of this crate are the Triangulation and CausalTriangulation, providing the base functionality to work with triangulations. These are designed to work for any dimension, and there are also aliases for the most common use cases:

Additionally, there is the Graph structure, which provides a standard graph implementation. This Graph implements most of the interesting quantities/observables, like the sphere volume profile and the average sphere distance, as well as many breadth-first search functions that can be used for many distance based measurements like correlations.

§Example of use

Here is an example using the dyntri-edt2d generator. Crucially a Triangulation2D triangulation is constructed, which can then be used to perform any measurement one would like.

use dyntri_edt2d::generator::random_uniform_triangulation;
use dyntri_core::graph::observables::asd;
use rand_xoshiro::Xoshiro256StarStar;

// Create RNG
let mut rng = Xoshiro256StarStar::seed_from_u64(42);

// Generate an 2D EDT triangulation using direct sampling (as [`PlanarMap`])
let planar_map = random_uniform_triangulation(1000, &mut rng);
// Construct triangulation
let triangulation = planar_map.construct_triangulation();
// Check the Euler characteristic formula for spherical topology
assert_eq!(triangulation.num_vertices(), 1000 / 2 + 2);

// Get the vertex graph of the triangulation
let graph = triangulation.vertex_graph();
// Measure the average sphere distance (epsilon=0)
let asd = asd::asd(&graph, 0, 10);
println!("{:?}", asd);

§Implementing custom generator

To make use of dyntri-core using a custom generator, all one needs to do is implement a function to construct a Triangulation or CausalTriangulation2D from whatever generator one has. From these all the functionality coming from this crate is available. If so desired one can also directly implement the construction of a Graph from one’s generator, which may be more effecient then indirectly constructing it from a triangulation.

Modules§

graph
triangulation