> +    >>> from sympy.physics.quantum.spin import JzKet
> +    >>> from sympy.physics.quantum.density import Density, fidelity
> +    >>> from sympy.physics.quantum.represent import represent
> +    >>>
> +    >>> up = JzKet(S(1)/2,S(1)/2)
> +    >>> down = JzKet(S(1)/2,-S(1)/2)
> +    >>> amp = 1/sqrt(2)
> +    >>> updown = (amp * up) + (amp * down)
> +    >>>
> +    >>> # represent turns Kets into matrices
> +    >>> up_dm = represent(up * Dagger(up))
> +    >>> down_dm = represent(down * Dagger(down))
> +    >>> updown_dm = represent(updown * Dagger(updown))
> +    >>> updown2 = (sqrt(3)/2 )* up + (1/2)*down
> +    >>>
> +    >>> print fidelity(up_dm, up_dm)

``print`` is unnecessary here.

---
Reply to this email directly or view it on GitHub:
https://github.com/sympy/sympy/pull/1459/files#r1342305

-- 
You received this message because you are subscribed to the Google Groups 
"sympy-patches" group.
To post to this group, send email to sympy-patches@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-patches+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to