Updated function of `levi_civita` function. Added tests.

* Also `is_canonical` has been updated accordingly