LMCAS
Lamina Computer Algebra System
载入中...
搜索中...
未找到
differential_geometry.hpp
浏览该文件的文档.
1/**
2 * @file differential_geometry.hpp
3 * @brief 微分几何:度量张量,克里斯托弗符号,黎曼曲率张量.
4 */
5#pragma once
7#include "result.hpp"
8#include "symbolic.hpp"
9#include <memory>
10#include <vector>
11#include <string>
12
13namespace LMCAS {
14
17
18/**
19 * @brief 计算度量张量的逆
20 * @param g_ij 协变度量张量(矩阵表示)
21 * @return 逆变度量张量 g^ij
22 */
24 const std::shared_ptr<SymbolicExpr>& g_ij,
26);
27
29 const std::shared_ptr<SymbolicExpr>& g_ij
30);
31
32
33/**
34 * @brief 计算第一类克里斯托弗符号 Γ_{kij}
35 * @param g_ij 度量张量
36 * @param coords 坐标变量列表
37 * @param k 索引
38 * @param i 索引
39 * @param j 索引
40 * @return 符号表达式
41 */
43 const std::shared_ptr<SymbolicExpr>& g_ij,
44 const std::vector<std::string>& coords,
45 int k, int i, int j,
47);
48
50 const std::shared_ptr<SymbolicExpr>& g_ij,
51 const std::vector<std::string>& coords,
52 int k, int i, int j
53);
54
55
56/**
57 * @brief 计算第二类克里斯托弗符号 Γ^k_{ij}
58 * @param g_ij 度量张量
59 * @param g_up_ij 逆度量张量
60 * @param coords 坐标变量列表
61 * @param k 上标索引
62 * @param i 下标索引
63 * @param j 下标索引
64 * @return 符号表达式
65 */
67 const std::shared_ptr<SymbolicExpr>& g_ij,
68 const std::shared_ptr<SymbolicExpr>& g_up_ij,
69 const std::vector<std::string>& coords,
70 int k, int i, int j,
72);
73
75 const std::shared_ptr<SymbolicExpr>& g_ij,
76 const std::shared_ptr<SymbolicExpr>& g_up_ij,
77 const std::vector<std::string>& coords,
78 int k, int i, int j
79);
80
81
82/**
83 * @brief 计算黎曼曲率张量 R^rho_{sigma mu nu}
84 * @param g_ij 度量张量
85 * @param coords 坐标变量
86 * @param rho 上标
87 * @param sigma 下标1
88 * @param mu 下标2
89 * @param nu 下标3
90 * @return 符号表达式
91 */
93 const std::shared_ptr<SymbolicExpr>& g_ij,
94 const std::vector<std::string>& coords,
95 int rho, int sigma, int mu, int nu,
97);
98
100 const std::shared_ptr<SymbolicExpr>& g_ij,
101 const std::vector<std::string>& coords,
102 int rho, int sigma, int mu, int nu
103);
104
105/**
106 * @brief 计算标量函数沿向量场 X 的李导数 L_X f = sum Xⁱ*partialf/partialxⁱ.
107 *
108 * 支持迭代李导数(order 次重复应用).
109 *
110 * @param f 标量函数
111 * @param X 向量场分量(与 vars 一一对应)
112 * @param vars 坐标变量名列表
113 * @param order 迭代阶数(默认 1)
114 * @return 李导数表达式
115 */
117 const std::shared_ptr<SymbolicExpr>& f,
118 const std::vector<std::shared_ptr<SymbolicExpr>>& X,
119 const std::vector<std::string>& vars,
120 int order,
122);
123
125 const std::shared_ptr<SymbolicExpr>& f,
126 const std::vector<std::shared_ptr<SymbolicExpr>>& X,
127 const std::vector<std::string>& vars,
128 int order = 1
129);
130
131
132/**
133 * @brief 计算微分形式的外微分 d(form).
134 *
135 * k-形式的系数按递增坐标指标组合的字典序排列.对于指标组合
136 * J=(j0,...,jk),输出系数为
137 * sum_r (-1)^r * partial(omega[J 去除 jr]) / partial(x[jr]).
138 * 0-形式传单个系数;n 维空间中的 n-形式映射为空的 (n+1)-形式系数表.
139 *
140 * @param form_coeffs 按上述顺序排列的形式系数(0-形式传单元素 [f])
141 * @param degree 形式次数,范围为 [0, vars.size()]
142 * @param vars 坐标变量名列表
143 * @return 外微分后的系数列表
144 */
146 const std::vector<std::shared_ptr<SymbolicExpr>>& form_coeffs,
147 int degree,
148 const std::vector<std::string>& vars,
150);
151
153 const std::vector<std::shared_ptr<SymbolicExpr>>& form_coeffs,
154 int degree,
155 const std::vector<std::string>& vars
156);
157
158
159} // namespace LMCAS
#define LMCAS_API
DifferentialGeometryExprResult christoffel_first_kind_checked(const std::shared_ptr< SymbolicExpr > &g_ij, const std::vector< std::string > &coords, int k, int i, int j, ComputationContext &context)
DifferentialGeometryExprResult metric_inverse_checked(const std::shared_ptr< SymbolicExpr > &g_ij, ComputationContext &context)
const std::vector< Polynomial< BigInt > > const BigInt ComputationContext & context
__attribute__((visibility("default"))) VectorCalculusFieldResult gradient_checked(const std __attribute__((visibility("default"))) VectorCalculusFieldResult gradient_checked(const std __attribute__((visibility("default"))) VectorField gradient(const std const std::vector< std::string > & vars
Result< std::shared_ptr< SymbolicExpr > > DifferentialGeometryExprResult
const std::vector< FGLMPoly > const MonomialOrder & order
DifferentialGeometryExprResult christoffel_second_kind_checked(const std::shared_ptr< SymbolicExpr > &g_ij, const std::shared_ptr< SymbolicExpr > &g_up_ij, const std::vector< std::string > &coords, int k, int i, int j, ComputationContext &context)
DifferentialGeometryExprResult riemann_curvature_tensor_checked(const std::shared_ptr< SymbolicExpr > &g_ij, const std::vector< std::string > &coords, int rho, int sigma, int mu, int nu, ComputationContext &context)
DifferentialGeometryVectorResult exterior_derivative_checked(const std::vector< std::shared_ptr< SymbolicExpr > > &form_coeffs, int degree, const std::vector< std::string > &vars, ComputationContext &context)
DifferentialGeometryExprResult lie_derivative_checked(const std::shared_ptr< SymbolicExpr > &f, const std::vector< std::shared_ptr< SymbolicExpr > > &X, const std::vector< std::string > &vars, int order, ComputationContext &context)
Result< std::vector< std::shared_ptr< SymbolicExpr > > > DifferentialGeometryVectorResult
符号表达式主类 SymbolicExpr 及其工厂方法,运算接口.