On Mon, Oct 12, 2009 at 8:41 AM, Ondrej Certik <ond...@certik.cz> wrote: > On Mon, Oct 12, 2009 at 4:51 AM, Øyvind Jensen <jensen.oyv...@gmail.com> > wrote: >> Nice! >> >> Here are patches for the quick and easy stuff. They can be applied to >> the branch you posted. I also noticed some other small issues, and they >> are corrected in the patches. >> >>> 4) please use explicit imports in the example. Then it would be clear >>> that the import: >>> >>> from sympy.physics.secondquant import * >>> >>> doesn't import AntiSymmetricTensor. >>> >> I agree that explicit imports is better code, so lets change it. (The >> attached patches fix that.) >> >> But anyway, shouldn't AntiSymmetricTensor be imported by 'import *'? In >> my own code branch the example runs without error, so why doesn't it run >> in your branch? > > I don't know. If you want, just publish your branch to github, it will > make things easier. > > Ah, I know why --- I had sympy installed in my pythonpath and it used > that sympy instead. I have removed it and now it works. > > Indeed, it takes couple minutes to finish. > >> >> I'll write doctests, but that will take me some time. > > Cool. I have pushed your patches into my branch.
For Brian -- this is the output of the coupled_cluster example: $ python examples/intermediate/coupled_cluster.py Calculates the Coupled-Cluster energy- and amplitude equations See 'An Introduction to Coupled Cluster Theory' by T. Daniel Crawford and Henry F. Schaefer III Setting up hamiltonian Calculating nested commutators comm1... comm2... comm3... comm4... construct Hausdoff expansion... ********************* extracting CC equations from full Hbar CC Energy: $f^{k}_{c} t^{c}_{k} + \frac{1}{4} t^{cd}_{kl} v^{kl}_{cd} - \frac{1}{2} t^{c}_{l} t^{d}_{k} v^{kl}_{cd}$ CC T1: $f^{a}_{c} t^{c}_{i} + f^{k}_{c} t^{ac}_{ik} + t^{c}_{k} v^{ak}_{ic} + \frac{1}{2} t^{cd}_{ik} v^{ak}_{cd} - f^{k}_{i} t^{a}_{k} - \frac{1}{2} t^{ac}_{kl} v^{kl}_{ic} + t^{a}_{l} t^{c}_{k} v^{kl}_{ic} + t^{d}_{l} t^{ac}_{ik} v^{kl}_{cd} + \frac{1}{2} t^{a}_{l} t^{cd}_{ik} v^{kl}_{cd} + \frac{1}{2} t^{c}_{i} t^{d}_{k} v^{ak}_{cd} + \frac{1}{2} t^{d}_{i} t^{ac}_{kl} v^{kl}_{cd} - f^{k}_{c} t^{a}_{k} t^{c}_{i} - \frac{1}{2} t^{c}_{k} t^{d}_{i} v^{ak}_{cd} + \frac{1}{2} t^{a}_{l} t^{c}_{i} t^{d}_{k} v^{kl}_{cd} - \frac{1}{6} t^{a}_{l} t^{c}_{k} t^{d}_{i} v^{kl}_{cd} + \frac{1}{3} t^{a}_{k} t^{c}_{l} t^{d}_{i} v^{kl}_{cd} + f^{a}_{i}$ CC T2: $\frac{1}{2} t^{ab}_{kl} v^{kl}_{ij} + \frac{1}{2} t^{cd}_{ij} v^{ab}_{cd} + f^{k}_{i} t^{ab}_{jk} P(ij) + t^{a}_{k} v^{bk}_{ij} P(ab) + \frac{1}{2} t^{ad}_{ij} t^{bc}_{kl} v^{kl}_{cd} + \frac{1}{2} t^{ad}_{kl} t^{bc}_{ij} v^{kl}_{cd} - f^{a}_{c} t^{bc}_{ij} P(ab) - t^{a}_{l} t^{b}_{k} v^{kl}_{ij} - t^{c}_{i} v^{ab}_{jc} P(ij) + \frac{1}{4} t^{ab}_{kl} t^{cd}_{ij} v^{kl}_{cd} + f^{k}_{c} t^{a}_{k} t^{bc}_{ij} P(ab) + f^{k}_{c} t^{c}_{i} t^{ab}_{jk} P(ij) + t^{d}_{k} t^{ac}_{ij} v^{bk}_{cd} P(ab) + t^{ac}_{ik} v^{bk}_{jc} P(ab) P(ij) + t^{ad}_{il} t^{bc}_{jk} v^{kl}_{cd} P(ij) + \frac{1}{2} t^{a}_{k} t^{cd}_{ij} v^{bk}_{cd} P(ab) + \frac{1}{2} t^{c}_{i} t^{d}_{j} v^{ab}_{cd} P(ij) + \frac{1}{2} t^{ab}_{il} t^{cd}_{jk} v^{kl}_{cd} P(ij) - t^{c}_{l} t^{ab}_{ik} v^{kl}_{jc} P(ij) - \frac{1}{2} t^{a}_{l} t^{b}_{k} t^{cd}_{ij} v^{kl}_{cd} - \frac{1}{2} t^{c}_{i} t^{ab}_{kl} v^{kl}_{jc} P(ij) + t^{a}_{l} t^{b}_{k} t^{c}_{i} v^{kl}_{jc} P(ij) + t^{d}_{i} t^{ac}_{jk} v^{bk}_{cd} P(ab) P(ij) + \frac{1}{2} t^{c}_{i} t^{d}_{l} t^{ab}_{jk} v^{kl}_{cd} P(ij) - t^{a}_{k} t^{c}_{i} v^{bk}_{jc} P(ab) P(ij) - t^{a}_{l} t^{d}_{k} t^{bc}_{ij} v^{kl}_{cd} P(ab) - t^{a}_{l} t^{bc}_{ik} v^{kl}_{jc} P(ab) P(ij) - \frac{1}{2} t^{c}_{l} t^{d}_{i} t^{ab}_{jk} v^{kl}_{cd} P(ij) + \frac{1}{4} t^{c}_{i} t^{d}_{j} t^{ab}_{kl} v^{kl}_{cd} P(ij) + \frac{1}{2} t^{a}_{k} t^{c}_{i} t^{d}_{j} v^{bk}_{cd} P(ab) P(ij) - t^{a}_{l} t^{d}_{i} t^{bc}_{jk} v^{kl}_{cd} P(ab) P(ij) - \frac{1}{2} t^{a}_{l} t^{b}_{k} t^{c}_{i} t^{d}_{j} v^{kl}_{cd} P(ij) + v^{ab}_{ij}$ Ondrej --~--~---------~--~----~------------~-------~--~----~ 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 this group at http://groups.google.com/group/sympy-patches?hl=en -~----------~----~----~----~------~----~------~--~---