Table of Contents
Complex
boolean, read only
For a wavefunction psi, psi.Complex returns a boolean (true or false) stating if the wavefunction contains complex numbers or not.
Example
We can define the functions $$ |\psi\rangle = \left(\frac{1}{\sqrt{4}} a^{\dagger}_0 a^{\dagger}_1 + \frac{1}{\sqrt{4}} a^{\dagger}_0 a^{\dagger}_2 + (1+I)\frac{1}{\sqrt{4}} a^{\dagger}_1 a^{\dagger}_2 \right)|0\rangle, $$ and $$ |\psi\rangle = \left(\frac{1}{\sqrt{2}} a^{\dagger}_0 a^{\dagger}_1 + \frac{1}{\sqrt{2}} a^{\dagger}_0 a^{\dagger}_2 \right)|0\rangle. $$
For the former psi.Complex() is true for the later psi.Complex() is false
Input
- Example.Quanty
NF=3 NB=0 psi = NewWavefunction(NF, NB, {{"110",sqrt(1/4)},{"101",sqrt(1/4)},{"011",(1+I)*sqrt(1/4)}}) print(psi.Complex) psi = NewWavefunction(NF, NB, {{"110",sqrt(1/2)},{"101",sqrt(1/2)}}) print(psi.Complex)
Result
true false