Hans, On Mon, Sep 19, 2011 at 12:03 PM, Hans Harhoff Andersen <[email protected]> wrote: > Hi. > I have been trying to figure out how to use sympy.physics.quantum > specifically the qubit/gate part. I have gotten qubits working and I > have applied various operators to them (with some guesswork/trial-and- > error), but I can't figure out how to define my own operators. I'd > like to provide a matrix which should then become an operator/gate. > How do I do this. I have tried using gate.UGate but I complains that > my matrices do not have is_integer method.
I don't remember exactly but I think that UGate may not be fully working. It should not be difficult to fix the problems though. But, in the meantime if you simply want to create a new single qubit gate, I would look at the implementation of the existing single qubit gates. It should be quite simple to follow that pattern and create your own subclass. As far as UGate goes, could you file a bug report on sympy's issues page? > Is there a good place for examples/documentation of how to use the > quantum package in general and qubits in specific? Right now the best place to learn about it is the code itself, as well as the tests. > > Best regards, > Hans > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > > -- Brian E. Granger Cal Poly State University, San Luis Obispo [email protected] and [email protected] -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
