Open mikldk opened 3 years ago
library(caracas) A <- matrix_sym(2, 2, "a") B <- matrix_sym(2, 2, "b") tensor <- function(A, B) { s <- get_sympy() caracas::eval_to_symbol(s$tensorproduct(A$pyobj, B$pyobj)) } AB <- tensor(A, B) AB matrify(eval_to_symbol(AB$pyobj[[1]][[1]]))
library(caracas) A <- matrix_sym(2, 2, "a") B <- matrix_sym(2, 2, "b") tensor <- function(A, B) { s <- get_sympy() caracas::eval_to_symbol(s$tensorproduct(A$pyobj, B$pyobj)) } AB <- tensor(A, B) AB matrify(eval_to_symbol(AB$pyobj[[1]][[1]]))