Creating user-defined geometric spaces
Create a geometric space with default definitions
using SymbolicGA
@geometric_space weird_space (3, 4, 5)
@weird_space (macro with 2 methods)
x = rand(12); y = rand(12)
@weird_space x::1 ⟑ dual(y::1)
(KVector{10, Float64, 12, 66}(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6625292907801456, -0.046685280930826654, 0.6918204713319779, -0.5282966182075828, 0.277722097590168, -0.012547843569732554, 0.0008841867224303951, -0.013102598139306974, 0.010005570192801093, -0.005259863201392905, -0.2492110101429065, 0.3331403771435769, -0.023474814340714897, 0.34786889567372015, -0.26564400560480794, 0.13964732672173424, 0.581440542323967, 0.114298984197345, -0.32032002312756347, 0.022571425106156732, -0.3344817390884508, 0.2554211373254167, -0.1342732313289355, -0.2207868515519691, -0.11630712593303597, 0.17009668031046604, -0.14131252710609582, 0.009957620166837829, -0.14756011616110398, 0.11268170512523254, -0.05923603980959043, 0.8370879907998863, -0.06900870259604502, 0.5449308375936804, -0.4518079376761689, 0.6246284585599258, -0.044014589952576386, 0.6522439998078416, -0.4980747370502719, 0.26183465114652793, -0.7162428560950966, 0.2485197178890973, -0.9083277272063732, 0.5544459454041504, -0.636432078134029, -0.6249591659627444, 0.04403789332681409, -0.6525893281646024, 0.4983384410177139, -0.2619732786078002, 1.5589934248889283, -0.264605222907143, 1.332379211310215, -0.9620096581195561, 0.45709754446974243, 0.7941824297336159), KVector{12, Float64, 12, 1}(3.6134633472528903))
Create a geometric space with extra definitions.
@geometric_space extra_space 3 quote
>>(x, y) = versor_product(y, x)
*(x, y) = geometric_product(y, x)
I = 1.0::e123
end
@extra_space (macro with 2 methods)
x = rand(3); y = rand(3)
@extra_space begin
yᵈ = y::1 * I
yᵈ >> x::1
end
KVector{1, Float64, 3, 3}(0.12811210067340303, 0.13141966419364873, 0.6583006509258774)
Create a geometric space with non-default bindings.
bindings = Bindings(refs = Dict(:* => :geometric_product))
@geometric_space no_defaults 3 bindings
@no_defaults (macro with 2 methods)
x = rand(3); y = rand(3)
@no_defaults x::1 * y::1
(KVector{0, Float64, 3, 1}(1.2854860682220715), Bivector{Float64, 3, 3}(-0.09416254007154135, -0.1622587248135437, -0.2597486051579351))
Note that you will always have access to the built-in functions.
This page was generated using Literate.jl.