question about quantum operator algebra
hi, I am searching for a software or library that can handle operator algebra in quantum mechanics. For example, I would like to caculate the commutator [a,H], where the Hamiltonian "H"=\epsilon a^{\dag}a, and "a" is annihilation operator for, say, an osilator. I tried GiNaC, and read much documentation, and get little clue. I wonder if there is a direct implementation of these kind of operator algebra in GiNaC. Thank you in advance.
Hi!
hi, I am searching for a software or library that can handle operator algebra in quantum mechanics. For example, I would like to caculate the commutator [a,H], where the Hamiltonian "H"=\epsilon a^{\dag}a, and "a" is annihilation operator for, say, an osilator. I tried GiNaC, and read much documentation, and get little clue. I wonder if there is a direct implementation of these kind of operator algebra in GiNaC.
You can declare those operators as noncommutative symbols. I assume that you are using version 1.3.x. Then it goes as e.g., const unsigned my_tinfo = 2; symbol a("a", return_types::noncommutative, my_tinfo); symbol adag("adag", return_types::noncommutative, my_tinfo); H = epsilon*adag*a; ex commu = a*H - H*a commu = rewrite_operators(commu); The global constant my_tinfo is arbitrary, but for safety it should not be one that is already in use (see http://www.ginac.de/viewcvs/GiNaC/ginac/tinfos.h?hideattic=0&rev=1.27.2.3&view=markup). You would have to define the function rewrite_operators yourself. It could be something like ex rewrite_operators(const ex &x) { if (is_a<ncmul>(x)) { ... constructing the result of rewriting is done here ... return result; } else return x.map(rewrite_operators); } Good luck! Chris
"C" == Canhua <dreameration@gmail.com> writes: C> hi, I am searching for a software or library that can handle C> operator algebra in quantum mechanics. For example, I would like
If you wish to calculate commutators based on a Lie algebra (e.g. Heisenberg-Weyl one), there is a fancy way to implement it through a derived class from clifford. See for example my message http://www.ginac.de/pipermail/ginac-devel/2005-July/000793.html However for big powers it work very slowly and you may get much more exciting performance with the Singular package: http://www.singular.uni-kl.de/ Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv@maths.leeds.ac.uk -- www: http://maths.leeds.ac.uk/~kisilv/
Or if you prefer to work in Python, you can try SAGE: http://sage.scipy.org/sage/ that (among other software) also interfaces Singular. Ondrej On 5/5/07, Vladimir Kisil <kisilv@maths.leeds.ac.uk> wrote:
"C" == Canhua <dreameration@gmail.com> writes: C> hi, I am searching for a software or library that can handle C> operator algebra in quantum mechanics. For example, I would like
If you wish to calculate commutators based on a Lie algebra (e.g. Heisenberg-Weyl one), there is a fancy way to implement it through a derived class from clifford. See for example my message
http://www.ginac.de/pipermail/ginac-devel/2005-July/000793.html
However for big powers it work very slowly and you may get much more exciting performance with the Singular package:
http://www.singular.uni-kl.de/
Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv@maths.leeds.ac.uk -- www: http://maths.leeds.ac.uk/~kisilv/ _______________________________________________ GiNaC-list mailing list GiNaC-list@ginac.de https://www.cebix.net/mailman/listinfo/ginac-list
participants (4)
-
Canhua
-
Chris.Dams@mi.infn.it
-
Ondrej Certik
-
Vladimir Kisil