I need to compute two equations related with trace and inverse of a around 30000 x 30000 density matrices. The equations are
-trace( W_i %*% C)
and
-trace(W_i %*% C %*% W_j C)
I know W_i, W_j and inverse of C. These equations are related with Pearson estimating functions. I am trying to use R and package Matrix, but I couldn't compute the C matrix, using solve() or chol() and chol2inv(). I do not know with is possible using solve() to solve a system of equation and after compute the trace. It is common to use solve function to compute something like C^{-1} W = solve(C, W), but my equation is a little bit different. Any help is welcome. I am thinking about to use RcppArmadillo, but I am not sure that it is able to compute my equations.