stannum
stannum copied to clipboard
Comprehensive complex number support
As mentioned in README, we have now these limitations:
- The registered field with
complex_dtype=Truemust be an appropriateVectorFieldorScalarField- If it's
VectorField,nshould be2, likev_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 be2, likefield = ti.field(ti.f32, shape=(2,3,4,5,2))
- If it's
- 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.