1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// use num_traits::Float;
// use std::ops::{Add, Mul};
// trait Vector:
// Add<Self, Output = Self> +
// Sub<Self, Output = Self> +
// Mul<Self::Field, Output = Self> +
// Sized
// {
// type Field: Float + Copy;
// fn zero() -> Self;
// }
// trait Metric<V>
// where
// V: Vector,
// {
// fn sqrt(&self) -> impl Vielbein<V>;
// fn dot(&self, v: V, w: V) -> V::Field;
// fn det(&self) -> V::Field;
// fn dvol(&self) -> V::Field
// where
// V::Field: Float,
// {
// self.det().sqrt()
// }
// fn norm(&self, v: V) -> V::Field
// where
// V: Copy,
// V::Field: Float,
// {
// self.dot(v, v).sqrt()
// }
// fn angle(&self, v: V, w: V) -> V::Field
// where
// V: Copy,
// V::Field: Float,
// {
// self.dot(v, w) / (self.norm(v) * self.norm(w))
// }
// }
// trait Sym<V>
// where
// V: Vector,
// {
// fn metric(&self) -> impl Metric<V>;
// fn otimes(v: V, w: V) -> Self;
// }
// trait Vielbein<V>
// where
// V: Vector,
// {
// /// Induce metric
// fn metric(&self) -> impl Metric<V>;
// }