Matrix power
mat_pow(x, pow = "1")
A caracas_symbol
, a matrix.
Power to raise matrix x
to
if (has_sympy() && sympy_version() >= "1.6") {
M <- matrix_(c("1", "a", "a", 1), 2, 2)
M
mat_pow(M, 1/2)
}
#> c: ⎡ _______ _______ _______ _______⎤
#> ⎢ ╲╱ 1 - a ╲╱ a + 1 ╲╱ 1 - a ╲╱ a + 1 ⎥
#> ⎢ ───────── + ───────── - ───────── + ─────────⎥
#> ⎢ 2 2 2 2 ⎥
#> ⎢ ⎥
#> ⎢ _______ _______ _______ _______ ⎥
#> ⎢ ╲╱ 1 - a ╲╱ a + 1 ╲╱ 1 - a ╲╱ a + 1 ⎥
#> ⎢- ───────── + ───────── ───────── + ───────── ⎥
#> ⎣ 2 2 2 2 ⎦