Thanks for your reply.
I used Spack to install dofinx, directly following the instruction in GitHub - FEniCS/dolfinx: Next generation FEniCS problem solving environment.
While dealing with this, I found a similar article,
Complex assembly
However, it seems that he used source installation, which did not work in my computer.
I tried to use
source /usr/local/bin/dolfinx-complex-mode
source /usr/local/bin/dolfinx-real-mode
but couldn’t find the path, thus failed.
Could you give some instructions for dealing with this situations?