sympy.physics.quantum.pauli

This pull request contains a few minor fixes for the sympy.physics.quantum, and a new module for pauli operators, like sigma x, sigma y, sigma z, and the annihilation and creation operators sigma minus and sigma plus.

The pauli sigma operators are of course a special case of the angular momentum spin J operators, but I think they are deserve operator classes of their own because they are so commonly used. I have been looking at ways of making the new pauli operator classes subclasses of spin J classes, but I found that there was no advantage in doing that, because I had to reimplement all the methods and add new ones. However, earlier this summer when I discussed the  sympy.physics.quantum.fermion and sympy.physics.quantum.boson modules with @ellisonbg I also mentioned that I had worked a bit on these pauli operator classes and he recommended asking @flacjacket for advise and discussion on how these pauli operator classes could be related to the existing spin J operator classes.

So, @flacjacket, if you could have a look at this PR and give comments I would be very grateful. Also @ellisonbg  and @certik might be interested in having a look.

Here are a few ipython notebook that demonstrates a few applications of the new pauli operators implemented in this PR:

http://nbviewer.ipython.org/github/jrjohansson/sympy-quantum-notebooks/blob/master/lecture-sympy-quantum-two-level-system.ipynb

http://nbviewer.ipython.org/github/jrjohansson/sympy-quantum-notebooks/blob/master/lecture-sympy-quantum-atom-cavity.ipynb

http://nbviewer.ipython.org/github/eunjongkim/reproduced-papers/blob/master/Reproduce-PRA-80-033846-2009-Zueco.ipynb
Yes, it is otherwise ready to go. Thanks for adding the tests.

On Wed, Oct 8, 2014 at 4:39 PM, Robert Johansson <notifications@github.com>
wrote:

> In sympy/physics/quantum/pauli.py:
>
> > +        return self
> > +
> > +    def _print_contents_latex(self, printer, *args):
> > +        if self.use_name:
> > +            return r'{\sigma_x^{(%s)}}' % str(self.name)
> > +        else:
> > +            return r'{\sigma_x}'
> > +
> > +    def _print_contents(self, printer, *args):
> > +        return 'SigmaX()'
> > +
> > +    def _eval_power(self, e):
> > +        if e.is_Integer and e.is_positive:
> > +            return SigmaX(self.name).__pow__(int(e) % 2)
> > +
> > +    def __mul__(self, other):
>
> Thanks for your feedback - I really appreciate it. In your opinion, would
> this PR be mergable if I remove the '*mul*' methods?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/sympy/sympy/pull/8051/files#r18619907>.
>



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger@calpoly.edu and ellisonbg@gmail.com