stannum icon indicating copy to clipboard operation
stannum copied to clipboard

Comprehensive complex number support

Open ifsheldon opened this issue 4 years ago • 0 comments

As mentioned in README, we have now these limitations:

  • The registered field with complex_dtype=True must be an appropriate VectorField or ScalarField
    • If it's VectorField, n should be 2, like v_field = ti.Vector.field(n=2, dtype=ti.f32, shape=(2, 3, 4, 5))
    • If it's a ScalarField, the last dimension of it should be 2, like field = ti.field(ti.f32, shape=(2,3,4,5,2))
  • The semantic of complex numbers is not preserved in kernels, so you are manipulating conventional fields, and as a consequence, you need to implement complex number operators yourself

Since I want to keep this library as lightweight as possible, I won't handcraft some sophisticated support on complex numbers now but rather wait for upstream Taichi to support complex numbers. Here is the related upstream issue.

ifsheldon avatar Dec 30 '21 19:12 ifsheldon