−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 |ψ⟩=(1√4a†0a†1+1√4a†0a†2+(1+I)1√4a†1a†2)|0⟩, and |ψ⟩=(1√2a†0a†1+1√2a†0a†2)|0⟩.
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