Thank you very much Eric! It works perfectly well for my needs.
I've tested the time spent for calculating the Riemann tensor (restarting the kernel to avoid cache) for three different simplifying methods: the standard, the simplify, and a function that just returns the expression. It makes a huge difference.
For the Kerr-Newman metric, without simplification is ~500x faster (considering the wall time).
- default
CPU times: user 5min 6s, sys: 4.16 s, total: 5min 10s
Wall time: 3min
- simplify
CPU times: user 40.1 s, sys: 359 ms, total: 40.4 s
Wall time: 27.3 s
- no simplification
CPU times: user 468 ms, sys: 785 µs, total: 468 ms
Wall time: 340 ms
For the metric given by
[-1, 0, 0, 0]
[0, h11(t, r, th, ph), h12(t, r, th, ph), h13(t, r, th, ph)]
[0, h12(t, r, th, ph), h22(t, r, th, ph), h23(t, r, th, ph)]
[0, h13(t, r, th, ph), h23(t, r, th, ph), h33(t, r, th, ph)]
the results are more even impressive. No simplification is ~4000x faster.
- default
CPU times: user 40min 26s, sys: 17.9 s, total: 40min 43s
Wall time: 31min 29s
- simplify
CPU times: user 3min 10s, sys: 978 ms, total: 3min 11s
Wall time: 2min 44s
- no simplification
CPU times: user 715 ms, sys: 14.2 ms, total: 729 ms
Wall time: 573 ms
Best wishes,
Rogerio