Implement `__sympy__()` method and `densematrix()` function