On Jun 6, 6:12 pm, Tomo Lazovich <[email protected]> wrote: > Hi everyone, > Hi,
> I've been working on representations of operators and kets in the position > and momentum bases. So far, from what I can tell, the desired behavior is to > return something like DiracDelta(x_1-x_2) for a representation of |x_1> > (position ket), and something like x_1*DiracDelta(x_1-x_2) for the > representation of the X operator (position operator). > > My question, then, is what should the representation of a full expression > look like. Lets say we execute the following lines: > > >> x_ket = XKet() > >> x_op = XOp() > >> represent(x_op*x_ket, basis=XOp()) > > With the current behavior (well, once that desired behavior is fully > implemented), it would return > > >> x_1*DiracDelta(x_1-x_2)**2 > > because it simply returns the representations of each QExpr individually, so > we get two delta functions out. > > Is this what we actually expect the output of representing an expression > like that to be? No that's not what's expected. Whatever the representation of A and B are, the representation of A*B is definitely not equal to the product of the representations of A and of B. In your case the x_op*x_ket is just a new ket, call it psi_ket. The representation of psi_ket in the position basis would be <x_dummy| psi_ket>. So that's what I would expect to get in general. Whether it should reduce to something simple is a different story. You need to do some more manipulation to get <x_dummy|psi_ket> in terms of the representations of x_op and x_ket themselves. If you do it you get x_ket*DiracDelta(x_ket-x_dummy). You can look up the manipulation in a quantum mechanics text. It involves inserting a resolution of unity between x_op and x_ket and evaluating the integral over position, which is trivial in this case because of the delta function. > Comments are greatly appreciated! Thanks > > Tomo Cheers, Julien -- 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.
