Skip to content

Specifying the norm of complex function #226

Discussion options

You must be logged in to vote

The expression ψ**2 is not calculating the squared norm, but it is equivalent to ψ*ψ. To calculate the squared norm you could either use abs(ψ)**2, which returns a real number, or ψ * conjugate(ψ), which returns a complex number (with vanishing imaginary part). Both versions should work equally well, although I have not tested this in detail.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Elliotepsteino
Comment options

You must be logged in to vote
1 reply
@david-zwicker
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants